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
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.
http://api.drupal.org/api/drupal/includes!menu.inc/function/theme_menu_link/7
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.– gregabFeb 11, 2013 at 8:10
-
yeah, then you override that hook to get what you need. :-) 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?– gregabFeb 11, 2013 at 8:51