Posted by J V on November 29, 2012 at 2:54pm
I want to alter specific menu items with a hook.
(In my theme's template.php but since it involves hooks I thought this would be more appropriate)
I know the menu, depth, location and menu item id ahead of time - all I need is to change them (In one I need to change the text, in another I need to change the link, both require queries per user)
Using hook_menu_item_link() and hook_menu_alter() don't seem to work.
How do I change these specific menu items?
Comments
hook_menu_alter().
hook_menu_alter().
Jaypan We build websites
This sounds like it may be a
This sounds like it may be a case for overriding
theme_menu_link ( http://api.drupal.org/api/drupal/includes%21menu.inc/function/theme_menu... )
to change the display output rather than altering the actual data of the menu item (router and access control).
I guess it depends on whether
I guess it depends on whether he wants to change the displayed text (hook_menu_alter()) or the outputted HTML (theme_menu_link()).
Jaypan We build websites
This worked perfectly -
This worked perfectly - thanks!
0x539hook_menu_alter
hook_menu_alterclear drupal cache
chetan
Menu Token
Maybe you can use the module Menu Token. With this module you can add any token to menu titles. Very neat.