Conditional Content

Problems with permise conditions exclusively referred to "Public" or "Registered" or "Members"

10 months 3 weeks ago #72955

Jean Marc NIKLAUS's Avatar Jean Marc NIKLAUS

Hi,
I want to create following conditional fields:

1) Show a text only for public, but NOT registered visitors, nor Members.
2) Show a text only for people who are registered, but NOT for Public, and Not for Members
3) Show a text only for Members, but NOT for Public nor for "only" registered people.

For example 1) "You have to logIn to read more" 2) "Thank you for logging" or "More content available only for Members" 3) "Dear member, your download link is xxx.xxx."

I tried it for hours, but it never works with none of these conditions:

{show accesslevels="Public"}You have to logIn to read more{show-else}Keep reading:{/show}

{show matching_method="any" accesslevels="Public,Registrated"}More content available only for Members{show-else}Specially for our Members{/show}

{show accesslevels="Members"}Dear member, your download link is xxx xxx {show-else}Thank you for Reading. Members have the permission to download the file{/show}

{show accesslevels!="Public"}Keep Reading:{show-else}You have to logIn to read more{/show}

{show matching_method="any" accesslevels!="Registrated,Public"}Specially for our Members:{show-else}More content available only for Members{/show}

{show accesslevels!="Members"} Thank you for Reading. Members have the permission to download the file{show-else}Dear member, your download link is xxx xxx{/show}

I tried the same with usergrouplevels or usergrouplevels!, but never works clean: Mostly shows the same content in Public and Registered, but none of these restrictions are absolutely specific.

My usergroups:
Public
- Registrated
- - Students
- - - Members
- - - - Group Leaders
- - - - - Teachers

Access Levels:
All 6 Usergroups can access to public,
R,S,M,G,T can access to Registrated,
S,M,G,T can access to Students,
M,G,T can access to Members,
G,T can access to Group Leaders, and
T can access to Teachers

My Joomla is 3.7, everything actualized. Using Chrome, Firefox.

I want to use it for Students and Teachers too. The simple text samples are only for demonstration.

What am I doing wrong?

Thank you for your help!
Regards,
Jean

P.S. I love your extensions! they are literally amazing!

10 months 3 weeks ago #72963

Peter van Westen's Avatar Peter van Westen Admin

First: the matching method is only useful if you are using multiple conditions. So you don't need to change/add that.

Secondly: there is a difference between Access Levels and User Groups. So make sure you are using the correct condition.
You can use the editor button to help you create the correct tag and syntax.

10 months 3 weeks ago #72966

Jean Marc NIKLAUS's Avatar Jean Marc NIKLAUS

Sorry, I don't understand your response.
Can you be more concrete please?

10 months 3 weeks ago #72969

Peter van Westen's Avatar Peter van Westen Admin

You are using the Matching Method 'ANY' in your tags:

{show matching_method="any" accesslevels="Public"}
The matching method only is useful when combining multiple assignments in one tag.
So this will be sufficient:
{show accesslevels="Public"}

You are showing a list of your user groups. However in your tags you are using the accesslevels attribute.
For example: accesslevels="Miembro FMDS"
Do you actually have an Access Level called "Miembro FMDS"? Or is that the name of a user group? if so, use the usergroups attribute.

Before going further, read the documentation:
www.regularlabs.com/extensions/conditionalcontent/tutorial

10 months 3 weeks ago #72978

Jean Marc NIKLAUS's Avatar Jean Marc NIKLAUS

Peter, I edited and eliminated the little text incoherences in my first topic, who were caused by inattention in my traduction.

When you show again, you'll see all my Accesslevels and user groups, and how they are arranged.
I actualized the text withhout matching method "any"

Obviously, I was knowing and trying everything from the www.regularlabs.com/extensions/conditionalcontent# tutorial before I decided to ask you.

Meanwhile, I'm staying still with the same problem. What am I doing wrong?

10 months 3 weeks ago #72980

Peter van Westen's Avatar Peter van Westen Admin

As an example, you have:

accesslevels!="Public"
As you stated, all your usergroups have the 'Public' accesslevel.
This means that no-one will see that text. And everyone will see the {else} text.

accesslevels!="Registrated,Public"
The same for this assignment.

If you want to show specific stuff to guests, you will need to create a separate gues usergroup and set that as the default.
See: joom3.zemplate.com/the-administrative-in...levels/access-levels
And google for 'joomla guest user group'.

10 months 3 weeks ago #73002

Jean Marc NIKLAUS's Avatar Jean Marc NIKLAUS

Confidential information:
(hidden)

10 months 3 weeks ago #73012

Peter van Westen's Avatar Peter van Westen Admin

Please see my previous reply. That should explain what you are doing wrong.

Can you give one simple example of a tag that is not acting like you expect it?
So one tag and one situation (user login) and one url in which I can see the 'issue'.

10 months 3 weeks ago #73023

Jean Marc NIKLAUS's Avatar Jean Marc NIKLAUS

ok:

{show matching_method="any" accesslevels="Public,Registrado"}2b Should show this text to Public and Registrado only{show-else}2b_For members and Students {/show}
Unlogged, shows “2b Should show this text to Public and Registrado only” (OK)
Logged in as Registrado, shows “2b Should show this text to Public and Registrado only” (OK)
Logged in as Member, shows “2b Should show this text to Public and Registrado only” (error)


{show accesslevels!="Registrado"}2c to public and members{show-else}2c_to registrados"{/show}
Unlogged, shows “2c to public and members” (OK)
Logged in as Registrado, shows “2c_to registrados” (OK)
Logged in as Member, shows “2x_to registrados” (error)


{show accesslevels!="Public"}1c to Reg and Memb, but not public{show-else}1c_to public{/show}
Unlogged, shows “1c_to public” (OK)
Logged in as Registrado, shows “1c_to public” (error)
Logged in as Member, shows “1c_to public” (error)


{show accesslevels="Public"}1b only to Public{show-else}1b_to all NOT Public{/show}
Unlogged, shows “1b only to Public” (OK)
Logged in as Registrado, shows “1b only to Public” (error)
Logged in as Member, shows “1b only to Public” (error)

:P

Confidential information:
(hidden)


All other samples (text in black or orange) are working correctly.

10 months 2 weeks ago #73024

Peter van Westen's Avatar Peter van Westen Admin

Sorry, but I already explained this.
It is working as it should.

See: www.regularlabs.com/forum/conditionalcon...red-or-members#72980

I don't know what else I can tell you to explain how access levels work.

10 months 2 weeks ago #73028

Peter van Westen's Avatar Peter van Westen Admin

Although this is not the place to get support on the basic of Joomla, like how access levels work, I'll give it another shot...

The way you have your access levels set up, the Registered access level has all the access rights the Public level has, plus some more.
And the Students level has access to everything the Registered level has, plus more.

That is a nested structure, where every nested level has the access of everything above it.

If you assign something to the Registered access level, then the Students, Teachers and every other nested access level will also be able to see it.

So when you have a tag like this:

{show accesslevels="Registrado"}
that will pass for all your access levels except the Public level.

When you have this:
{show accesslevels="Public"}
that will pass for all visitors, as all have public access. In other words, using that is useless.

If you only want to show something to Students and all other nested access level below it, simply do:
{show accesslevels="Students"}
That will then b visible for Students, Members, etc.
But not for Public and Registered.

10 months 2 weeks ago #73030

Jean Marc NIKLAUS's Avatar Jean Marc NIKLAUS

Your response shows that obviouly you still didn't understand my question.

I know about rights, don't need a lesson about basics: How can I resolve to give EXCLUSIVE access to one (nested) level, (like the extension "NiceContent Access" who was able to reduce the permits to public:no, registered:no, Students:yes, Members:no, Teachers:yes). NiceContentAccess worked very well until now, but they are not updating, and I had to eliminate it recently after updating Joomla.

Now my question again: How can I resolve the same thing efficiently with conditional content? Is it possible to resolve it without rearranging my nested levels, or how would you recommand to make it the most efficient way with RegularLabs?

I Just need a suggestion from a professional like you. Just a good idea, concretely, with an example how would YOU resolve this little challenge the best way, nothing more.

Sorry, Peter, I'm not programmer, I'm MD, and I'm giving a lot of excellent free content to people, who will be financiated by other advanced contents. Please help a last shot, and I'll do it.

10 months 2 weeks ago #73031

Peter van Westen's Avatar Peter van Westen Admin

Not with access levels. Do that with user groups.