Elxis CMS Forum

Support => General => Topic started by: xmanhattan on March 18, 2020, 15:23:55

Title: access view
Post by: xmanhattan on March 18, 2020, 15:23:55
Hello all,

I am curious about the access view plugin.  It sounds like it could be great to use with closed groups.
I checked the documentation and the forum but didn't find any info.

I tried it by creating a new category and a new article within that category, and then inserting
Code: [Select]
<p><code class="elx5_plugin">{accessview gids="2,3,4,5"}For the Private User Group{/accessview}</code></p>but I must be missing something with regards to how it works.
All I am seeing is a yellow background with, This content is not available for you

A little guidance on the subject please.
Thank you in advance.
Title: Re: access view
Post by: michalis1984 on March 18, 2020, 16:51:25
Hello all,

I am curious about the access view plugin.  It sounds like it could be great to use with closed groups.
I checked the documentation and the forum but didn't find any info.

I tried it by creating a new category and a new article within that category, and then inserting
Code: [Select]
<p><code class="elx5_plugin">{accessview gids="2,3,4,5"}For the Private User Group{/accessview}</code></p>but I must be missing something with regards to how it works.
All I am seeing is a yellow background with, This content is not available for you

A little guidance on the subject please.
Thank you in advance.


The content of the plugin (in this situation a message 'For the Private User Group') is visible to the specified user categories. In your situation, its visible to user categories 2,3,4,5.

Other user groups see the default message 'This content is not available for you'.

If you are logged in to the website with your administrator account means your user category is 1. So you see the default 'locked' message.
If you are logged out, you are guest, so your user category is user 7. So again you see the 'locked' message.

To see the functionality, create a member on your website in user groups 2,3,4, or 5 and you will see the content.

Or change gids to "1" so the content will be visible only when you are logged as administrator. Logout to see the locked message.
Title: Re: access view
Post by: xmanhattan on March 19, 2020, 10:06:20
Hello Michalis1984,

Okay, but is there a way to create say a category and of course a menu button that will only give access to the logged in user level or am I thinking too much?

If so, should this be applied to the category to apply to all pages within?

Thanks for your reply.
Title: Re: access view
Post by: perseas on March 19, 2020, 23:14:48
See how I use it if you think it can help.
In an article add this plugin and only 5: Guest, 6: External user, 7: User can view this text.
If someone logs in as 4: Author, 5: Publisher, 2: Manager, or 1: Administrator doesn't see it.
My code is:

Code: [Select]
<code class="elx5_plugin">{accessview gids="5,6,7"}<strong>Itaque nostrum est-quod nostrum dico</strong><br>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quonam, inquit, modo? Illum mallem levares, quo optimum atque humanissimum virum, Cn. Quae quidem vel cum periculo est quaerenda vobis;
{/accessview}</code>

Test it.
Title: Re: access view
Post by: xmanhattan on March 20, 2020, 12:19:27
Okay, so it is only viewable by those who are logged in with the appropriate level.
I also checked the source code and it does not show in there.
Simple enough for a special message to authorized users.

Thanks to all.
Title: Re: access view
Post by: datahell on March 21, 2020, 09:22:31
The purpose of the plugin is to show/hide portions of an article to specific users. If you want to make a category and/or article available only to specific users then set the permissions to the category/article and don't use the plugin. In plugin's parameters there is an option to set if you want to display the warning message to unauthorized users or not.


Example usage:

{accessview gids="1,2,3,4,5"}<a href="#">Secret link for logged-in users</a>{/accessview}
{accessview gids="7"}<div class="elx5_warning">Login to access the secret download link</div>{/accessview}
Title: Re: access view
Post by: xmanhattan on March 21, 2020, 13:16:55
Thank you datahell!