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

dnewkerk’s picture

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.

lallen30’s picture

It worked perfect!!!

Thanks so much for your post.

Anonymous’s picture

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.

function tabname_tweaker_menu_alter(&$items) {
  $items['node/%node/edit']['title callback'] = 'tabname_tweaker_title_callback';
  $items['node/%node/edit']['title arguments'] = array(1);
}

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).

liquidcms’s picture

and for the default View/Edit tabs on the User page use these:

  $items['user/%user/view']['title'] = t('Home');
  $items['user/%user_category/edit']['title'] = t('Account');