Hi,

My site is an intranet for employee use only. I don't want anyone to see the primary links until they have logged in. I was able to accomplish this by going to administer > themes > configure and then un-checking primary links. I could then added the primary links back in by enabling the block. That worked, but I lost the tab styling. The tabs were one of the main reasons we chose this theme so I really need to keep them intact.

Can anyone help?

Many thanks,

Laurie

Comments

dddave’s picture

Have you checked the permissions for the contents your main links refer to? Normally links shouldn't be visible by default if the content cannot be visited by the given user.

LSJ’s picture

Under Administer > User Management > Permissions nothing is checked for the anonymous user role. Is that what you mean, or do I need to do something else as well?

This is my first Drupal site...I apologize if I am missing something.

LSJ’s picture

Title: How can I hide the primary links from non-authenticated users without losing the tab styling? » Need to hide primary links from non-authenticated users without losing the tab styling. Can anyone help?
jwolf’s picture

Status: Active » Closed (fixed)
PortableFan’s picture

Status: Closed (fixed) » Active

All though my site isn't strictly private, this question is essentially the same as mine and I'd like to follow up on this. When anyone visits the front page for my site, Primary Links displays Home and My Account. I would like to find out how I can make some sort of rule/exception to not show Primary Links to anonymous users that visit the site. Home links to a user home page that users are redirected to after logging in, so it is moot for anonymous users to have access to that page.

Thanks,

Cory

PortableFan’s picture

Version: 6.x-1.9 » 6.x-2.0

While I'm pretty much a newb, I do have access to a coworker that is able to do PHP or CSS changes for me. Is there some way for me to hide the theme-enabled primary link tabs from showing on frontpage? I'm really hoping someone could help me with this so I can keep the primary links in the lovely tabs instead of having to move to primary links in a block. You can see the site at dev.bulldogs.com.

jeremycaldwell’s picture

Sure the easy way to do this is do edit the page.tpl.php that comes with the theme and wrap the primary menu code in an if statement. This if statement checks to see if it's the front page or not.

<?php if ($is_front): ?>
  <?php // Display this if front page ?>
  <?php else: ?>
  <?php // Display this if not front page ?>
<?php endif; ?>

So if front page, show this, else if not front page, show that. You can place your primary menu code in the "not front page" area and should be all set.

abemonkey’s picture

Another simple way to do this is to make a page-front.tpl.php, copy all the code from the page.tpl.php file into this file and remove the code that generates your primary links.

delty’s picture

The Menu Per Role module seems to do this.

http://drupal.org/project/menu_per_role

-=Delty

jeremycaldwell’s picture

Status: Active » Fixed

Thanks for the info about the Menu Per Role module Diety, very helpful. Marking as fixed as that would be a good way to go.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.