By sjames on
I've disabled the user login and password box.
I want to just have a login menu item at the bottom of left navigation bar specifically for admins.
when admins login, I would like to have the logout menu item appear so they can logout.
can anyone tell me how I can do that?
please help because I don't find this in the forum archives.
thanks.
Susan
Comments
It is quite simple,
It is quite simple, actually.
Go in admin/menu and add a new menu item. As the title you could give 'Login' for the login link. For the Path, type
loginfor this is the path that the login-password block uses itself.
And as the parent, choose the parent menu at the bottom of which you want to place your login/logout links.
Repeat the same for the logout link but obviously replace the path
loginbylogoutThat's about it.
hmm...
thanks for the quick response.
this is drupal-4.7.3 upgraded from 4.6.4
I followed your exact procedure, but 'login' isn't recognized as the path. I had to type the full path http://www.shreemaa.org/user/login for Login menu item.
and then when I login, both the login and logout menu items are there. only logout menu item should be there.
when I logout, everythng is correct because Login menu item is there and logout menu item disappears.
so, Login menu item isn't going away after login and it should.
For the path, i guess i got
For the path, i guess i got you wrong. Type in 'user/login'. Without the quotes. No need for the whole path.
And you are totally right about the sticky login that wont disappear after actual login. And i havent found a way to get rid of it.
Sorry for that, i thought i could have helped you better ;-(
As described above, you'll
As described above, you'll have to create menu and then show the block. You have to add a PHP snippet so the menu only appears when people are logged of:
When someone is logged in, the block won't show.
Depends on what you want to
Depends on what you want to achieve.
I have not disabled the loggon module but removed it from the frontpage and acces it bij putting /user after the domainname. This will only work when you have activated clean urls otherwise it is /?q=user . When a admin is logged in he is able to see the logout link.
This solution is simple fast and will do the trick if your aim is not to show the login module for a visitor.
Well, you're absolutly
Well, you're absolutly right.
The thing i did, was just disable the login block. I then created a new menu with 2 items:
user/login and user/register. I then enabled the block that shows that menu and put the above PHP snippet so it only shows when someone isn't logged in. When i log in, the block dissapaers.
It's also simple, but yes... everybody will see the login link, not box!
If you really want to hide the login from everyone who isn't logged in, then you'll have to use the trick describes above.
edit: @Tmanagement: the problem with your solutions is, when someone goes to for example /book or /blog, they also see a login box because you only made it dissapaer from the frontpage...
@Passero This is not
@Passero
This is not correct. Removing the login module from the block overview wil make your login field disappear on every page. At least this is the case with Drupal 3.7.4.
Removing this module (uncheck it at your block overview) will remove this module on every page and is then accesable at yourdomain.com/user instead.
Well, that's what i said,
Well, that's what i said, right?
You said that you only removed it from the frontpage, that's not the same as disabling the login block completlly...
Good point ;)
No comment on that one. I will be more precise in the future when I try to help someone.
Thank you very much... this
Thank you very much...
this saved some sleep
php snippet
thanks to all for the help with login! much appreciated!
where do I put the php snippet code?
I want the login/logout link to appear at the bottom of Navigation menu, so I don't need a new menu.
there's no field for me to put the php snippet for that menu.
any ideas?
Hmm, putting it in the
Hmm, putting it in the block
Person who loved FOOD and DRUPAL