<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:12pt"><DIV></DIV>
<DIV>I haven't looked at that code in D7 yet, but based on D6, I am going to guess that it hasn't changed. The URL alias is resolved to the underlying "node/1234" before the menu is looked at. Since the menu specifies "article/hello," it does NOT match "node/1234" and therefore executes the standard "node/%nid" path instead. If you change the menu path to "node/1234," I bet it will do what you want.<BR> </DIV>
<P><FONT color=#ff007f size=4 face="bookman old style, new york, times, serif"><EM><STRONG>Nancy</STRONG></EM></FONT></P>
<P> </P>
<P><FONT face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</FONT></P>
<DIV><BR></DIV>
<DIV style="FONT-FAMILY: arial, helvetica, sans-serif; FONT-SIZE: 12pt"><BR>
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt"><FONT size=2 face=Tahoma>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Deva <devendra.in@gmail.com><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> development@drupal.org<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Thu, February 17, 2011 8:41:21 AM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [development] hook_menu vs path alias Drupal 7<BR></FONT><BR><FONT face=verdana,sans-serif>Hi All,<BR><BR>I am developing a site in Drupal 7. I have a node with alias /article/hello<BR>I also have a hook_menu with "</FONT><FONT face=verdana,sans-serif>/article/hello</FONT><FONT face=verdana,sans-serif>" path registered in my module.<BR>When i access the path in browser http://localhost/article/hello it shows the node instead of calling "</FONT><FONT face=verdana,sans-serif>my_custom_function</FONT><FONT face=verdana,sans-serif>".<BR><BR>$items['</FONT><FONT face=verdana,sans-serif>article/hello</FONT><FONT face=verdana,sans-serif>'] =
array(<BR> 'title' => 'Hello World', <BR> 'description' => 'Hello world', <BR> 'page callback' => 'my_custom_function', <BR> 'access arguments' => array('access content'), <BR> 'type' => MENU_CALLBACK,<BR>);<BR><BR>I want 'my_custom_function' to get called.</FONT><BR><FONT face=verdana,sans-serif>Appreciate your help.</FONT><BR><BR>-- <BR>:DJ<BR><BR><BR></DIV></DIV></div></body></html>