0

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.

Thanks

0

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

|improve this answer|||||
  • 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 '13 at 15:38
-1

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

    <?php
    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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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