This question already has an answer here:
- Change menu link title dynamically? 3 answers
I am trying to change the title ( tab text ) of the standard Drupal menu local task tabs 'View' and 'Edit'. I want them to reflect the content type of the current node. So on the page node/1234 ( which is a blog node, say ) I want the View tab to say 'View blog' etc.
I can change the text using :
$items['node/%node/view']['title'] = 'View blog';
in a hook_menu_alter() function, but I can't seem to get hold of the node itself to test what content type it is to vary the text. The arg() function doesn't return anything within the hook_menu_alter() function for some reason ?
How do I do this ?