By lallen30 on
Please help.
I'm trying to rename the 'track' tab in My account user profile to 'Track your activity'.
I found this post:
http://drupal.org/node/127559
and it mentions editing the code in locale.module. But I cant find what code to put in it.
Can someone please point me in the right direction to find the code to to make this change or post the code that would work.
Thank you so much for your help
Comments
hook_menu_alter
No you never should edit core or a module's code directly. The methods used for removing local task tabs are similar to what you need to just rename them instead:
http://drupal.org/node/483324
http://drupal.org/node/68792
For instance, with hook_menu_alter, you could replace the line (from the first link referenced above) like this:
Change
$items['user/%user/track']['type'] = MENU_CALLBACK;To
$items['user/%user/track']['title'] = t('New name');Hope this helps.
It worked perfect!!! Thanks
It worked perfect!!!
Thanks so much for your post.
renaming with variable?
hi,
for some reasons i feel like presenting the "edit" tab to my users differently then the default, showing the content type they are able to edit. So the tab should not say only "edit" but "edit post" or "edit group" etc.
As far as i understand, the above example shows only a method for a static change, and unfortunately i have no clue about what to change to be able to insert the content type.
Have been searching high and low, but till now did not find something pointing in this direction.
Anyone any hints for me?
edit: found an answer by myself for this (ok, a little bit offtopic) issue:
there is a module called Tab name tweaker which is a bit big name for that module, cause it actually only enables you to change to "View" tab. But this can be done for all nodes, or separately for each node type, including usage of tokens.
This module can/could be quite easily modified (i think so) to work with other tabs as well.
I just changed the occurences of "view" in the module code to "edit" to do it what i wanted to have.
As you can see, this will only work for nodes with the node-path. But i think this will work for others like /user/... etc as well (am a complete noob so far).
default tabs
and for the default View/Edit tabs on the User page use these:
Peter Lindstrom
LiquidCMS - Content Solution Experts