8

In the user page (www.example.com/user), there are [View | Edit] tabs. Is it possible to hide the View tab and leave Edit tab there?

1
  • For which Drupal version are you asking?
    – Berdir
    May 11, 2011 at 9:49

3 Answers 3

5

Use Tab Tamer, which allows you to move, hide and disable tabs on various pages.

Tab Tamer is an administration utility that provides easy re-ordering, hiding, and deactivation of tabs and subtabs. You can also rename tab labels.

13

You could also just use hook_menu_local_tasks_alter() in D7:

function MYMODULE_menu_local_tasks_alter(&$data){
foreach ($data['tabs'][0]['output'] as $key => $value) {
        if ($value['#link']['path'] == "user/%/view"){
            unset($data['tabs'][0]['output'][$key]);
        }
    }
}

Documentation

1
  • Thank you for this nice answer! I added if($data['tabs']) before the foreach in order to check whether there are any tabs. Otherwise, if that is not the case, one gets an error message.
    – Jeroen
    Jun 26, 2015 at 21:54
0

If you give the appropriate permission to the user, only then the view and edit tag will visible otherwise it will not be visible. (For checking you can sign out from the website and click the menu in user page. The view and edit tag will not visible)

0

Your Answer

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

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