Showing Different Content to Different Joomla Users

One of our Joomla training members asked this question: "I need to give access to certain login individuals to specific content."

Now, there are Joomla extensions that will close off different parts of the site to different groups of users, but this member wanted something different. They wanted to drill down much more accurately and show different content to different individual users, even within one article.

To do this you need the "inline ACL Content Plugin" and here's how you use it.

Install inline ACL Content Plugin

tutuploadsmedia_1287949431709.png

Visit the inline ACL page on https://extensions.joomla.org. Click "Download" to go to the developer's site and find the file. Download the file to your desktop.

In your Joomla administrator area, go to Extensions >> Plugin Manager and enable the plugin.

Different Content to Different Joomla Users

tutuploadsmedia_1287950737037.png

In order to test out the inline ACL plugin, I went to Site >> User Manager and create three different users. Take note of their username and also their number in the right-hand column called "ID". You'll be able to use either the username or the ID# to show users different content:

tutuploadsmedia_1287950775837.png

Create The Content For Each User

tutuploadsmedia_1287951062823.png

Go to Content >> Article Manager and open up and article that you want to place content inside.

Use this formula for the code:


 {iACL type=username testa}Hi testa!{/iACL}

{iACL type=username testb}Hi testb!{/iACL}

{iACL type=username testc}Hi testc!{/iACL}

When the "testa" signs in, they will see "Hi testa!". When "testb" signs in, they will see "Hi testb!" and so on.

You can also do this by using the ID#s:


 {iACL type=userid 62}Hi testa!{/iACL}

{iACL type=userid 63}Hi testb!{/iACL}

{iACL type=userid 64}Hi testc!{/iACL}

When the user with ID# 62 signs in, they will see "Hi testa!". When the user with ID# 63 signs in, they will see "Hi testb!" and so on.

If you want to show content only to unregistered users, use this:


 {iACL type=userid 0}Hi unregistered users!{/iACL}

Other Options Using inline ACL

{iACL type=!userid 62}Your text{/iACL}
the content between the tags is invisible for the users with the specified IDs. Again you can target unregistered users by using ID# 0.
{iACL type=!username testa}Your text{/iACL}
the content between the tags is invisible for the users with the specified usernames.
{iACL type=group author,guest}Your text{/iACL}
the content between the tags is visible for the specified groups only. Possible values are: guest, registered, author, editor, publisher, manager, administrator, super administrator, special
{iACL type=!group author,guest}Your text{/iACL}
the content between the tags is invisible for the specified groups. Possible values are: guest, registered, author, editor, publisher, manager, administrator, super administrator, special