Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By turkeybat on
I'm using Drupal 5.x.
I need to know how to remove the primary links I'm using for Navigation on my site from the login page. Everything on my login page looks good except that the tabs in the upper right corner show. I just don't want them to be seen until a user is logged in.
Thanks!
Kristen
Comments
from just the login page or
from just the login page or from all pages before the user has logged in?
for just the login page:
Option A;
In the page.tpl.php file wrap the primary-links print statement like so:
Option B:
- copy the page.tpl.php file over to a page-user.tpl.php file and edit it.
Look for the line that says something like "theme('links', $primary_links,..) and remove it.
- drupal will use the page-user.tpl.php file as the template file when you go over to the login page. this may also screw up your user profile pages.
For from all pages before the user has logged in - you can do Option A and remove the
||arg(0)
bitthere are other options: define a region to contain the navigation links in your template.php file - add the primary links to this block - edit the page.tpl.php file and replace the print of the primary_links with the region you defined. head over to block configuration and disable this block from being displayed for an anonymous user on the "user" page.
From all pages would be
From all pages would be good, before a user is logged in. I'm really new to Drupal so I don't know where to find the page.tpl.php file to alter it. Could you tell me how to do this?
Thank you!
=-=
page.tpl.php is in the theme folder of the theme in use.
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )
To remove athe tabs for all
To remove athe tabs for all pages of users not logged in...
This is what is currently there...
if ($primary_links):
print theme('menu_links', $primary_links)
endif;
I need to change it to...?
if ($primary_links):
print theme('menu_links', $primary_links)
I'm not familiar with this code so I'm not sure where to put this. I don't want to mess up anything so I'd like to do this correctly!
Thank you :)
=-=
remove
replace with:
would help if we knew what theme you are using to give theme specific help
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )
Ok just did it. Now when I
Ok just did it. Now when I go to my website all I see is this:
Parse error: syntax error, unexpected '<' in /home/mywebsite/public_html/sites/all/themes/bluebreeze-5.x-1.2/page.tpl.php on line 49
=-=
blue breeze puts the primary links in a div that being said you need to find:
and replace with
give that a run, this should not allow primary links to be shown unless the user is indeed logged in.
_____________________________________________________________________
My posts & comments are usually dripping with sarcasm.
If you ask nicely I'll give you a towel : )
It worked!
You are awesome! It worked! I would not have been able to figure this on my own. Or many of the other aspects of this website I'm trying to build without your help. I truly appreciate the time you have taken to help me! Now on to the next task, the address book!