Joomla 1.7 – 5 Easy Steps to Create Guest Only Access to Menus and Modules

by Elaine on September 18, 2011

Joomla 1.7 Tutorial:  How to Display Modules for Guests only and Hide Once Logged In

By default Registered users on your Joomla website can see all modules and menus that are assigned to the Access Level of Public and Registered.   So it becomes a little tricky if you want to show a subset of modules or menus to only registered users and a different subset to non registered users.   Below I will show you how to do this.  High level of what needs to be done:

  • Create a New User Group in User Manager
  • Create a New ACL Group in User Manager
  • Edit the Public ACL Group in User Manager
  • Edit User Manager Options
  • Change Access Levels in Menus and Modules

For example I want a new user group named “Guest” which is equivalent to the non registered users on my site to see x modules and x menus.  The steps are below:

1. Create a New User Group in User Manager

Joomla 17 cmsmind elaine add new group guest Joomla 1.7   5 Easy Steps to Create Guest Only Access to Menus and Modules

Joomla 1.7 - Create a New User Group in User Manager

You will need to create a new user group since Public Group is the parent group to Registered.  Registered users will see Registered+ Public.  If you create a new user group under Public, Registered users will not see it.

  • Login to your Joomla 1.7 Administrator panel
  • Click on Users, Groups, Add New Group
  • Under User Group Details, enter the follow values:
      • Group Title = Guest
      • Group Parent = Public
  • Click on Save & Close

2.  Create a New Access Group in User Manager

joomla 17 cmsmind elaine new viewing acl guest Joomla 1.7   5 Easy Steps to Create Guest Only Access to Menus and Modules

Joomla 1.7 - Create a New Access Group in User Manager

The new Guest user group will need to have it’s own ACL so you can assign modules and menus to it.  This ACL will only have access to itself.

  • Click on Users, Access Levels, Add New Access Level
  • In Level Details, enter in the follow values:
      • Level Title = Guest
  • Under User Groups Having Viewing Access, Select only the following:
      • Use the checkbox to select = Guest
  • Click on Save & Close

3.  Edit the Public Access Group in User Manager

joomla 17 cmsmind elaine edit public acl add guest Joomla 1.7   5 Easy Steps to Create Guest Only Access to Menus and Modules

Joomla 1.7 - Edit the Public Access Group in User Manager

Since your Joomla website has been created with many modules and menus already that have Public as the assigned access, you must now allow the Guest group to view all modules and menus with access to Public.

  • Click on Users, Access Levels
  • Click and edit the Public ACL
  • Under the User Groups Having Viewing Access, also use the check to select:
      • Guest
  • Click on Save & Close

4. Edit User Manager Options

joomla 17 elaine cmsmind user config guest group Joomla 1.7   5 Easy Steps to Create Guest Only Access to Menus and Modules

Joomla 1.7 - Edit User Manager Options

Now in the user manager there is a group defined just for non registered users and you must change this to the new group you created in step 1.

  • Click on Users, User Manager
  • Click on the Options button on the right side
  • In the Users Configuration, select the Component tab and set the following values:
      • Guest User Group = Guest
  • Click on Save & Close

 

5.  Change Access Levels in Menus and Modules in Module Manager

joomla 17 cmsmind elaine module change acl guest only Joomla 1.7   5 Easy Steps to Create Guest Only Access to Menus and Modules

Joomla 1.7 - Change Access Levels in Menus and Modules in Module Manager

Now you can go to your Extensions Module Manager and configure your modules as required.  Select the modules that you want to be visible to guests only and change the access to Guest.  Menus are also configured in the Module manager so you can do the same with the Menus.  For example I will change the access for “Who’s Online” to be visible only by Guests/Non registered users:

  •  Click on Extensions, Module Manager
  • Search for and edit “Who’s Online”
  • Under Details, set the following value:
      • Access = Guest
  • Click on Save & Close

So that’s all that is required to prevent your registered users from seeing modules that are for Guests only, but you will also need to go through all existing modules on your Joomla website that you want this applied to.  Repeat step 5 for all modules you want to be displayed to Guests only.

Thanks,

Elaine

 Joomla 1.7   5 Easy Steps to Create Guest Only Access to Menus and Modules

Elaine

Elaine is the founder of CmsMind, an online blog providing Joomla and Wordpress tutorials. Elaine lives in Toronto and when she is not online, she is either Marathon and Triathlon training or travelling and racing somewhere in the world. Find her also at: Save Money, Premium Themes and Templates, and at Webhosting Tips.

More Posts - Website

{ 11 comments… read them below or add one }

whitmark October 4, 2011 at 9:34 pm

I have a related challenge in that I have a separate Guest and Member user groups and I want to maintain a separate set of three menus for Public, Guest (registered), and Member (registered and paid) visitors. I would like all three menus to display to all three groups so its clear what you get if you register and eventually become a member. I setup each User Group and Category with their respective nested access control level (e.g., Public > Guest > Member) as well as assign an access level to each article within the category using the batch processing. From there, I set the three menus, menu items, and modules to the Public level so they are always visible. This seems to work fine for unauthorized access to single article links where I get “You are not authorised to view this resource.” message however, if I am linking to a component like a category blog, I get the dreaded “#404 Category not found” error message. If I go back and set the Categories to be public, I can avoid the #404 error, but the content is blank when I would prefer the “You are not authorised to view this resource.” or some other redirect. Seems like showing restricted menu options to promote registration/membership yet be able to gracefully handle when clicked would be a common use case. Is there a better way to do this? Thanks for hosting a very helpful site!

Reply

Dennis December 10, 2011 at 10:49 am

Thank you! This is what I was searching for :)

Reply

Elaine December 10, 2011 at 3:05 pm

Hi Dennis,
No Problem! Glad my post can help you.
Thanks for your visit,
elaine

Reply

Jhuliano Moreno February 2, 2012 at 9:52 pm

Thank you very much! Excelent, and people in Joomla forum talking about making a “hack” on the code.
You rock broh!

Reply

Elaine February 3, 2012 at 5:56 am

Hi Jhuliano,
No Problem, I’m glad the post helped you.
Thanks for your visit,
elaine

Reply

Chris February 16, 2012 at 10:05 pm

Thank you! Excellent tutorial and very easy to follow, used this method to create a login / logout link combo to show the proper link whether a user is logged in or not. Great job!

Reply

Elaine February 16, 2012 at 10:42 pm

Hi Chris,
No problem. Thanks for your comments and letting me know that it worked for you. I love getting responses back. :)
Thanks for your visit,
elaine

Reply

Ishan Paudwal May 11, 2012 at 5:16 pm

Thanks buddy worked like charm .. i tried every thing but nothing worked … n this was most convenient way to do my job .. hats off

Reply

fuxo October 30, 2012 at 1:06 pm

Elaine, really thanks for your manual – works perfectly.

Reply

Elaine November 2, 2012 at 2:26 pm

Hi Tuxo,
No problem. Glad it worked for you :)
Thanks for your visit!
elaine

Reply

Helvecio November 5, 2012 at 1:12 am

Hi Elaine!
I came across your post because it’s not clear to me a why have a Guest Only Access.
I understand one uses it when wants a guest user see things differently from a registered user, for example. So, I understand Guest Only Access also requires a generel login (guest) and password (****), OK?
Is this the concept used when there’s a demo site, for example?
Sorry if this sounds stupid, but it’s really NOT clear to me.
Thank you if you can clarify this for me.
All the best!

Reply

Leave a Comment

Captcha Captcha Reload

Older Post:

Newer Post: