I am able to add a new tab in the Drupal Main Menu however I only want it to display when a user logs in. In other words this tab should not appear on the site until a user is authenticated.



2 Answers 2


You can create another menu and set access to it in User Permissions

  • hello and welcome. Please make your answer a bit more substantial. Your post is probably true, but does not touch mixing normal tabs with the ones created with the new menu, and it seems it would be needed to fulfil OPs requirements.
    – Mołot
    Dec 16, 2013 at 15:38

You can go to your page.tpl.php where you print your menu and surround it with this code :

    global $user;
    if ( in_array('authenticated user', $user->roles)) 
        // print your menu

This hides the menu if the user is not logged in.

I hope it helps you.

  • Thanks this did the trick. I am using the BARTIK theme. Should this be moved to another folder after I modify?
    – Mc3
    Dec 16, 2013 at 16:38
  • No you don't have to, because the page.tpl.php is specific to your theme. Dec 16, 2013 at 16:44

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.