CB conditionals

4 years 8 months ago #313796 by crapouille
CB conditionals was created by crapouille
Hi

Would like to understand the use and goal of CB Conditionals add-on
Demo and video on documentation doesn't inform enough (for my understandig at least)

First of all, I need to know if "CB conditionals" allows to hide or appear any field according the access group of user

Ex 1 for fields only:

User A has "Author level" > can see the City field on any other users's profil
User B has author "registered" level only > cannot see the city on any users's profil
But Need that user B can edit the field 'city' on his own profil

Ex 2 for whole tab:

User A has "Author level" > can see the Tab 'nameTab1' on any other users's profil
User B has author "registered" level only > cannot see the Tab 'nameTab1' on any others users's profil
But Need that user B can see the tab 'nameTab1' on his own profil, for simple view of his profil or for editing his profil.

Currently I am using the view of the tab following access group 'nameGroup1'
But the user who does not have the 'nameGroup1' access, can not see the owned informations of his profile, contained in this tab 'nameTab1' .
He can not change them either no more, because the tab 'nameTab1' does not appear on editing mode.

Cb conditionals can solve this problem?

Someone can help me ?
And give some various case example of the correct goal / use that we can expect from "CB conditionals" ?
Thanks in advance

Please Log in to join the conversation.

4 years 8 months ago #313804 by krileon
Replied by krileon on topic CB conditionals
CB Conditional allows conditioning tabs/fields to show/hide based off various conditions such as a fields value, a usergroup, a view access level, and more. This however is all conditioned against the profile owner. It is not conditioned against the user viewing the profile. It is possible to condition against the user viewing the profile using IF substitutions in a Custom Value condition though. Then to be sure the profile owner always has access you'd simply use an OR condition (it supports unlimited OR/AND conditions) and check the viewing users user id.

CB Privacy does condition against the user viewing the profile. You'd likely just use a forced privacy control then set the privacy rule to your usergroup or view access level. However the profile owner and CB Moderators can always see the field regardless of privacy controls.

In short CB Conditional or CB Privacy can both do what you're wanting. CB Conditionals being more flexible, but more complicated to configured. CB Privacy being easier to configure, but limited in usage (e.g. it can't check against a field value or anything like that). With both cases and usage in mind I recommend just trying it on our demo site below.

demo.cbdemosites.com/

Example conditions as follows.

Display: Field conditional show
Condition 1 (OR)
Field: Custom > Value
Custom Value: [cb:if user="#me" usergroup includes "USERGROUP_ID_HERE"]ACCESS[/cb:if]
Operator: Equal To
Value: ACCESS
Condition 2 (OR)
Field: Custom > Value
Custom Value: [user_id]
Operator: Equal To
Value: [cb:userdata field="user_id" user="#me" /]

Replace USERGROUP_ID_HERE with the actual usergroup id you want to check for. The above would then display the field if the user viewing the profile has that usergroup or they are the profile owner.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: crapouille

Please Log in to join the conversation.

4 years 8 months ago - 4 years 8 months ago #313817 by crapouille
Replied by crapouille on topic CB conditionals
Bought all Addons
Not set the Condition and Privacy at this moment
Beginning with easiest addons, and they make a ++++ to my community
Make my job easier too...
Very happy :-)
The following user(s) said Thank You: nant, krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.204 seconds

Facebook Twitter LinkedIn