<font face="verdana,sans-serif">It was still not catching the "node/%nid".<br>I did a quick fix as written .htaccess rewrite to redirect user from /article/hello to /mymodule/article/hello.<br><br>RewriteRule ^article/hello$ /mymodule/article/hello [L]<br>
<br>My updated hook_menu <br><br></font><font face="verdana,sans-serif">$items['mymodule/</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>);</font><br><font face="verdana,sans-serif"><br>
I am happy now :)<br><br>Thanks Nancy.<br><br></font><br><div class="gmail_quote">On Thu, Feb 17, 2011 at 8:08 PM, nan wich <span dir="ltr"><<a href="mailto:nan_wich@bellsouth.net">nan_wich@bellsouth.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><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" face="bookman old style, new york, times, serif" size="4"><i><b>Nancy</b></i></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 face="Tahoma" size="2">
<hr size="1">
<b><span style="font-weight: bold;">From:</span></b> Deva <<a href="http://devendra.in" target="_blank">devendra.in</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>><br><b><span style="font-weight: bold;">To:</span></b> <a href="mailto:development@drupal.org" target="_blank">development@drupal.org</a><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><div><div></div><div class="h5">
<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 <a href="http://localhost/article/hello" target="_blank">http://localhost/article/hello</a> 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>
</div></div></div></blockquote></div><br><br clear="all"><br>-- <br>:DJ<br><br><br>