Hi
I removed Login Block from left side bar menu and put a menu item 'Login/Register' as its title and 'user' as its path in the primary links location (top right). now problem is this link is always available even users login.
I want to know how can i hide (or rename this link to logout or sth else) this link (Login/Register) when users login to the system.
drupal version : 4.7.4
thanks.

Comments

vm’s picture

check out the loggintoboggan module it has a setting very similar to this. There was a post about how to do it with code in the forums not that long ago, maybe a search on drupal.org or google would turn it back up.

Saied Taghavi’s picture

Hi and thanks a lot for your attention.
I saw logintoboggan module and its features but my problem is not building a full featured login system and current login/logout/register system of drupal is suitable for me.
I think the desired algorithm is very easy:
1- create a menu called 'primarymenu'. done
2- assign it to primary links block. done
3- create a menu item 'login/register' as a child of 'primarymenu' with path 'user'. done
4- create a menu item 'logout' as a child of 'primarymenu' with path 'logout'. done
5- if ( site viewer == anounumous ) {
show 'login/register' link ;
hide 'logout' link ;
} else {
show and hide vice versa ;
}

my problem is how to done last step.

vm’s picture

this handbook page may help ? http://drupal.org/node/17272

this thread also http://drupal.org/node/102202
which refers to the loginmenu.module which you may choose to use, or look under the hood of.

Saied Taghavi’s picture

the first link was very good and i think found the way. if i create a custom menu item using PHP the problem will be solved.