Hello everybody!

This is my first post since I have installed Drupal 6.1 about a week ago. First of all, I have been trying quite a lot of CMS' but so far I can not find the one which fits my need. I hope Drupal would be the last one as I am tired googling and hacking those previous CMS'.

So to the question. Is there any easiest way to have a dynamic $primary_links? For instance, one link in the menu bar will be displayed as "Login" when the user has not been logged in. So when the users click on it, they will be given the login form. But if the users had been logged in, the link should displayed as "Logout", and they will be logged out when they click on it.

Thanks a lot in advance for your help.

Comments

aryanto’s picture

I have been messing around with my theme's page.tpl.php for a while with no luck. But finally, I found much simpler solution. I just need to create 2 menu items in the Menus->Primary Links. One with the name "Login" and the Path set to "user/login". The other one with the name "Logout" and the Path set to "logout".

Next case, please!

codeshark’s picture

Thanks so much for posting this solution. The path 'user' will make the login menu link target the login page but will not make the login link dynamically disappear when the user is logged in. The path 'user/login' does get the dynamic behavior. Thanks again.