0

I use the Profile2 module and i get in the user edit view the secondary tabs with the extra profile information. How can i move it to the parent tabs and hide the child tabs: "Edit | Info".

2

1 Answer 1

1

Well, for each page, the type of tab is decided my a parameter 'type'. So you can do a hook_menu_alter() on the specific page to change that. Please have a look at the "Rendering Menu Items As Tabs" section of the documentation for hook_menu() to gain idea of what options do what.

3
  • I can only hide the tab, but other things doesn`t work. The tab is evertime hidden, also when i try to rename the title from the tab with these little function. function newtemplate_menu_alter(&$items) {$items['user/%user/edit/extra'] = array('title'=> 'info',)}
    – Bruno
    Commented Oct 4, 2013 at 15:52
  • Bruno, the stuff you wrote in your function will render the menu useless because you are overriding the entire menu definition with that array array('title'=> 'info'); So in effect your menu definition, if it was: $items['user/%user/edit/extra'] = array('page_callback' => '', 'access_callback' => '',) becomes just this: $items['user/%user/edit/extra'] = array('title'=> 'info'); I think you need to grab another level in the array and do something like this: $items['user/%user/edit/extra']['type'] = MENU_LOCAL_TASK; This will only change the type param
    – Neo
    Commented Oct 4, 2013 at 16:00
  • ok, i understand. its not so good to overwrite the array, but then should this work $items['user/%user/edit/extra']['title'] = 'info'; ... it doesnt work, the tab is still not showing with the renamed title.
    – Bruno
    Commented Oct 4, 2013 at 16:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.