Hi I know I can alter menu links classes/attributes using theme_menu_link() function. But from what I can see, there is no way to determine what current page is being rendered from within the function.

i.e. I have a wep app that loads in 4 pages (ajax) and you can swipe to change page. I need to add an attribute on each menu link and they differ depending on the page.

Question being, how can I determine page from within theme_menu_link();


  • You can use $path = $_GET['q']; using this you can get the path of the page you are in ! – Anil Sagar Oct 22 '12 at 9:10
  • returns 'node'. – Luke Snowden Oct 22 '12 at 9:21
  • When you are in front page you see "node" in other pages you will see exact path ! – Anil Sagar Oct 22 '12 at 9:24

found it,

$page = arg(0);

cheers anyways

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.