How to Use the Guest Feature in Joomla?
- by Naveen Kumar
- on Tutorials
Joomla is a very powerful and feature-rich CMS that gives you everything you need to run a fully functional and successful business website.
Sometimes you need to display different content to guest visitors and logged-in users.
Just take a look at this use case. You want to display an article to guest users where you ask them to register on your website to get the premium stuff, and if a user is already logged in, he should not see that article.
And thanks to Joomla, it has a built-in Guest feature that lets you hide content without using any third-party extensions.
In this article, we will learn how to use the Guest feature in Joomla and control the content visibility from a specific group of users.
Getting Started with Verifying Guest User Settings
Joomla provides you with a built-in Guest user group, so you have to verify the settings before proceeding further.
Login to your Joomla website and navigate to Users > Groups. And now check for the Guest user group under the public.
If it is there, you don't need to do anything; otherwise, create a Guest user group as a child of a Public user group.
Now, verify the access level by clicking on Viewing Access Levels. It should be set to Guest.
Now, from the Users screen, click on the "Options" button and look for the "Guest User Group" field and make sure it is set to "Guest."
Add Content for Guest and Registered Users
In the above step, we have verified the settings for guest users, and now, we have to create different content for Guest and Registered users.
In this example, I am using Joomla Articles. You can use modules as well for the same.
To create an article, navigate to Content> Articles > Add a recent article. Add title and content to the article which you want to display for Guest users. Set Access Level to Guest from the right sidebar.
Now repeat the steps to create content for registered users. Add Title and content which you want to display to registered users. And set the access level to Registered.
Testing Your Site
To test your website, you need to create a registered user to test for logged-in users. So if you don't have any registered user, create a user.
Now, visit your public website and check for the articles you have published. You will see the article, which is set to Guest.
Now, I will log in to my account and will see the results.
This is how you can use the Guest feature of Joomla. You can use this same process with menu items and modules for even more content hiding and showing.
Let us know if you have used this Joomla feature or not.