I would like to alter/change structure of main menu links (programmatically!) for logged in users. What is the simplest way to do this?

1 Answer 1


I hope, Drupal 7 main-menu - change item text if user logged in you check this first.

If this does not complete your requirement, then, u have to override the theme_menu_link hook.


You can check whether the user is logged in or not by checking boolean $logged_in. If it is true, user is logged in else not.

  • i hope the second link will help me. Basically, i want to create a new menu for every user that is logged in.
    – gregab
    Commented Feb 11, 2013 at 8:10
  • yeah, then you override that hook to get what you need. :-) Commented Feb 11, 2013 at 8:18
  • I don't think this is the best way to create a new menu. Here you can check one link at a time, but it would be better to create whole menu at the same time. Wouldn't it?
    – gregab
    Commented Feb 11, 2013 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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