Hide Login Menu Item to Logged In Users

Need help with the Administration of your Joomla! 2.5 site? This is the spot for you.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
saxman1815
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Wed Jul 11, 2012 9:00 pm

Hide Login Menu Item to Logged In Users

Postby saxman1815 » Fri Jan 25, 2013 3:00 pm

I have a login menu item in my main menu. Access level is set to Public. My problem is that when my users login, they still see the login menu item (as well as the logout menu item, which is set to registered only).

I have checked and double checked my access levels. I have public (which is set to the public group only) and I have registered (which is set to only show to the registered group). I realize that registered is a parent of public, but I know there is a way to hide the login item to logged in users, because I have done it before. I just can't remember for the life of me how I accomplished this. I have checked everything I can think to check on my other site, but still can't remember how to do this.

Any ideas?

Thanks in advance!

User avatar
rcarey
Joomla! Explorer
Joomla! Explorer
Posts: 464
Joined: Sat Apr 25, 2009 9:20 pm
Location: Minnesota (USA)
Contact:

Re: Hide Login Menu Item to Logged In Users

Postby rcarey » Fri Jan 25, 2013 3:53 pm

Assuming you are using 2.5.x, you need to create a group for non registered users (with the parent being Public) This group is supplied in Joomla 3.0. Then go to User Manager -> Options. Under the Component tab set Guest User Group to the group that is to be assigned to anyone not logged in (but it is not assigned to any logged in users).

Create a new access level "Guest" and the only group assigned to it is this guest group. Then on the menu item, select the access level to Guest. That should accomplish what you want.
Randy Carey, the iCue Project http://iCueProject.com : developing an intelligent approach to improving the CMS user experience,
Careytech Studios http://careytech.com custom development for tailored or value-added web solutions

ppetree
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Wed Nov 13, 2013 7:43 pm
Location: South Florida
Contact:

Re: Hide Login Menu Item to Logged In Users

Postby ppetree » Tue Jun 03, 2014 10:06 am

I hate to zombie this but how do you do this in 3.x?

User avatar
rcarey
Joomla! Explorer
Joomla! Explorer
Posts: 464
Joined: Sat Apr 25, 2009 9:20 pm
Location: Minnesota (USA)
Contact:

Re: Hide Login Menu Item to Logged In Users

Postby rcarey » Tue Jun 03, 2014 10:16 am

The difference in 3.x is that it already comes with a Guest usergroup and access level, so you do not need to create these in 3.x as you need to in 2.5. So as stated previously, just set the menu item's access level to Guest.
Randy Carey, the iCue Project http://iCueProject.com : developing an intelligent approach to improving the CMS user experience,
Careytech Studios http://careytech.com custom development for tailored or value-added web solutions

User avatar
greenbean
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Fri Jul 04, 2008 4:18 pm
Contact:

Re: Hide Login Menu Item to Logged In Users

Postby greenbean » Wed May 25, 2016 9:14 pm

I must have removed my Guest Group. Here's what I did, works like a charm. Joomla 3.5.1
Created a new article called "Welcome" and set everything except the title to hide.
Created a new article called "Good Bye" and set everything except the title to hide.

I had a hidden menu, if you don't you will need to create one. (you need to do this so you do not get the message access denied after your guest has logged in)

Menus --> hidden menu --> New Item
Menu Item Type --> Article --> Single Article --> Welcome --> Access Public --> Set everything to hide except the title
Menu Item Type --> Article --> Single Article --> Good Bye--> Access Pulbic --> Set everything to hide except the title
Menu Item Type --> Users --> Login Form --> Access Public --> Set redirect to your Welcome Page
Menu Item Type --> Users --> Logout --> Access Public --> Set redirect to your Welcome Page

Users --> Manage --> User Groups
Created a new group "Guest" with the parent "Public"
Created a new Viewing Access Level "Guest" having access to Guest
Users --> Manage --> Options (the gear on the right)
Guest Group set to "Guest"
---
Menus --> Main Menu --> New Item
Menu Item Type --> System Links --> Menu Alias --> Hidden Menu --> Login Form
Set the Access (on the right) to "Guest"
Publish...
Now you have a login menu item that only displays when users are not logged in! Brilliant.
---
One more piece
Menus --> Main Menu --> New Item
Menu Item Type --> System Links --> Menu Alias --> Hidden Menu --> Logout
Set the Access (on the right) to "Registered"

Now your logged in users can easily log out, and your not logged in users can easily login.
Be the change you want to see in the world.

Gpgrant
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Mar 07, 2011 5:42 am

Re: Hide Login Menu Item to Logged In Users

Postby Gpgrant » Wed Jun 15, 2016 9:06 pm

Brilliant! Thanks for writing this up. Works perfectly.

User avatar
greenbean
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Fri Jul 04, 2008 4:18 pm
Contact:

Re: Hide Login Menu Item to Logged In Users

Postby greenbean » Wed Jun 15, 2016 11:27 pm

Glad you found it helpful. I can't edit my original post, but in re-reading I see a mistake.
Menu Item Type --> Users --> Logout --> Access Public --> Set redirect to your Goodbye Page (not your welcome page)
Be the change you want to see in the world.

Gpgrant
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Mar 07, 2011 5:42 am

Re: Hide Login Menu Item to Logged In Users

Postby Gpgrant » Thu Jun 16, 2016 1:20 am

yea I figured that one out. I spent 2 hours on this today before seeing your post so again...BIG THANKS

Gpgrant
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon Mar 07, 2011 5:42 am

Re: Hide Login Menu Item to Logged In Users

Postby Gpgrant » Thu Jun 16, 2016 1:22 am

p.s. I don't know if I'd call myself a "fledgling"...I'm not that bad. :D

User avatar
greenbean
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Fri Jul 04, 2008 4:18 pm
Contact:

Re: Hide Login Menu Item to Logged In Users

Postby greenbean » Thu Jun 16, 2016 2:05 am

You are welcome. I'm not sure who sets the status on the users. I've been using Joomla since 1.5 (10 years)... I think my status changed recently to Apprentice.
Be the change you want to see in the world.

User avatar
DaveOzric
Joomla! Ace
Joomla! Ace
Posts: 1398
Joined: Sat May 22, 2010 10:29 pm
Contact:

Re: Hide Login Menu Item to Logged In Users

Postby DaveOzric » Thu Jun 16, 2016 9:30 pm

rcarey wrote:The difference in 3.x is that it already comes with a Guest usergroup and access level, so you do not need to create these in 3.x as you need to in 2.5. So as stated previously, just set the menu item's access level to Guest.


Easy and very unknown feature. I did not realize J2.5 did not have this too.

TerryVog
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Tue May 12, 2009 6:10 am

Re: Hide Login Menu Item to Logged In Users

Postby TerryVog » Mon Feb 27, 2017 4:18 am

I don't want the login form to appear in an aside. So I made a separate page for it, have the login form module only show up on this page, and I made a menu item in the main menu that refers to it. Then I set the login menu item to show only to guests.

This kind of works. When I click on the login menu item, I get the page with the login form. I fill in my username and password. And the login menu item disappears like I intended. But I also get an error message, saying that I am trying to see a page for which I don't have the right privileges. Which makes sense, because I became a registered user and I just decided that only guests should see this.

If I would be the only user on my site, this wouldn't bother me, because I logged in successfully and I understand why the error message is there. But when the site goes live, I don't want the other registered users to be confused about this.

Is there a way to redirect to another page, immediately after logging in?

User avatar
BeauSanders
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Tue Apr 17, 2007 6:47 pm
Location: South Carolina

Re: Hide Login Menu Item to Logged In Users

Postby BeauSanders » Sat Mar 18, 2017 8:27 pm

Thank you, Greenbean, for your help on this problem. I just completed the fix you outline above in J3.6.5 and it works great.

I changed the titles of the Welcome and Goodbye articles to make them read a little better for our site. I kept the article aliases welcome and goodbye for simplicity.

You can see the fruits of my labor on this project at https://greenvillehigh1966.com.

Thank you for sharing this with our Joomla community.

-BeauSanders

User avatar
greenbean
Joomla! Apprentice
Joomla! Apprentice
Posts: 40
Joined: Fri Jul 04, 2008 4:18 pm
Contact:

Re: Hide Login Menu Item to Logged In Users

Postby greenbean » Sun Mar 19, 2017 12:22 am

Hey! Nice work... 50th reunion! Glad I could be of assistance. These forums have saved me many hours.
Be the change you want to see in the world.

User avatar
GODpleasers
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 201
Joined: Wed Jun 11, 2014 3:47 pm
Location: Wenatchee, Wa
Contact:

Re: Hide Login Menu Item to Logged In Users

Postby GODpleasers » Fri Jun 23, 2017 12:11 am

rcarey wrote:Assuming you are using 2.5.x, you need to create a group for non registered users (with the parent being Public) This group is supplied in Joomla 3.0. Then go to User Manager -> Options. Under the Component tab set Guest User Group to the group that is to be assigned to anyone not logged in (but it is not assigned to any logged in users).

Create a new access level "Guest" and the only group assigned to it is this guest group. Then on the menu item, select the access level to Guest. That should accomplish what you want.



Joomla 3.7.2 here.

Worked perfectly thank you. :-)
GOD Speaks internet radio- :-) GOOD :-) Music that employs life, deliverance, & restoration - COMPLETE :-)
http://godspeaksinternetradio.com/


Return to “Administration Joomla! 2.5”

Who is online

Users browsing this forum: No registered users and 5 guests