Actions

Difference between revisions of "How do you hide something from logged in users?"

From Joomla! Documentation

m (Added categorisation.)
(added more detail by pasting a section from http://docs.joomla.org/Access_Control_List/1.6-2.5/Tutorial#Allowing_Guest-Only_Access_to_Menu_Items_and_Modules)
 
Line 9: Line 9:
  
 
Now only users who are not logged in will be able to see those things.
 
Now only users who are not logged in will be able to see those things.
 +
 +
 +
#Create a new user group called Guest. Make it a child of the Public group as shown below. [[Image:screenshot_acl_tutorial_20110112-01.png|center|frame]]
 +
# Create a new access level called Guest and grant only the Guest group access to this level, as shown below.[[Image:screenshot_acl_tutorial_20110112-02.png|center|frame]]
 +
# Navigate to User Manager→Options→Component and change the Guest User Group from the default value of "Public" to "Guest", as shown below.
 +
[[Image:screenshot_acl_tutorial_20110112-04.png|center|frame]]
 +
 +
Now, if we assign a menu item, module, or other object to the Guest access level, only non-logged in users will have access. For example, if we create a new menu item with access level of Guest, as shown below,
 +
[[Image:screenshot_acl_tutorial_20110112-05.png|center|frame]]
 +
this menu item will only be visible to non-logged-in visitors to the site.
 +
 +
If required other user groups like Author can be granted access in the Guest access level, this would allow Authors to view articles in the front end for editing.
 +
 +
'''N.B. Login/logout in front end (''for changing data in session'') to see the change.'''
 +
 +
 
[[Category:Tips and tricks]][[Category:Joomla! 1.6]]
 
[[Category:Tips and tricks]][[Category:Joomla! 1.6]]

Latest revision as of 17:07, 13 February 2012

Starting in Joomla! 1.6 you can hide modules, menu items, content and other things from logged in users by using the Guest feature.

To make this work you have to go to the user manager and create a new user group, which we could call Guest (although it could be anything). Then create an viewing access level and also call that Guest (or something else if you would rather).

Then go to the user manager options and set the Guest Group to Guest (or the name you chose).

Then finally, assign those modules, menu items or content items which you want to only be visible to visitors who are not logged in to the Guest access level.

Now only users who are not logged in will be able to see those things.


  1. Create a new user group called Guest. Make it a child of the Public group as shown below.
    Screenshot acl tutorial 20110112-01.png
  2. Create a new access level called Guest and grant only the Guest group access to this level, as shown below.
    Screenshot acl tutorial 20110112-02.png
  3. Navigate to User Manager→Options→Component and change the Guest User Group from the default value of "Public" to "Guest", as shown below.
Screenshot acl tutorial 20110112-04.png

Now, if we assign a menu item, module, or other object to the Guest access level, only non-logged in users will have access. For example, if we create a new menu item with access level of Guest, as shown below,

Screenshot acl tutorial 20110112-05.png

this menu item will only be visible to non-logged-in visitors to the site.

If required other user groups like Author can be granted access in the Guest access level, this would allow Authors to view articles in the front end for editing.

N.B. Login/logout in front end (for changing data in session) to see the change.