Skip to Content Skip to Menu

[SOLVED] CB Conditional Help?

10 years 1 month ago - 10 years 1 month ago #248900 by zingerdigital
[SOLVED] CB Conditional Help? was created by zingerdigital
Question 1

I'm looking to use a Tab Conditional that checks to see if the #displayed user has a certain View Access Level in order to show a Tab

How would I setup the Condition??? (If?, Is?, To?, Then?, For?, As?)


Question 2

I've setup a conditional on a tab to hide it. I set the "FOR" as...

Registration: disable
Profile Edit: enable
Profile View: enable

What happens is, the tab hides only on the Profile View, not the Profile Edit. Both are enabled.
Why doesn't it hide on the Profile Edit???


Thanks
Robert
Last edit: 10 years 1 month ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8283
  • Karma: 1443
10 years 1 month ago #248925 by krileon
Replied by krileon on topic CB Conditional Help?
Best I can suggest is try the below, but I've no idea if it's going to work. CB Conditionals can't check against view access levels yet, but it will be able to in its next release.

Field: Custom > Value
Value: [cb:if user="#me" viewaccesslevel includes "VIEW_ACCESS_LEVEL_HERE"]1[/cb:if]
Translate Value: Disable
Operator: Equal To
Value: 1
Translate Value: Disable

That ideally would return a 1 if the user has the VIEW_ACCESS_LEVEL_HERE specified. If it does then the condition will match and the fields conditioned mode will apply. See the below tutorial for further substitution usage information.

www.joomlapolis.com/support/tutorials/107-use-cases/18353-using-substitutions-throughout-cb

What happens is, the tab hides only on the Profile View, not the Profile Edit. Both are enabled.
Why doesn't it hide on the Profile Edit???

No idea, you'd need to provide the condition you're using as it could just be an issue with the conditional configuration.


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.

Please Log in or Create an account to join the conversation.

10 years 1 month ago #248928 by zingerdigital
Replied by zingerdigital on topic CB Conditional Help?
For Question 2:

My conditon is pretty simple.....

Field: Custom > Value
Value: [gid]
Translate Value: Disable
Operator: Equal To
Value: 14
Translate Value: Disable


14 is referencing one of my groups

Like i said when I have Profile View and Profile Edit Enabled....I still see the tab in the Profile Edit mode.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8283
  • Karma: 1443
10 years 1 month ago #248936 by krileon
Replied by krileon on topic CB Conditional Help?
The [gid] won't do anything anymore unless you're on an older CB with Joomla 1.x. If you want to match a usergroup you can try the below.

Field: Custom > Value
Value: [cb:if user="#me" gids includes "14"]1[/cb:if]
Translate Value: Disable
Operator: Equal To
Value: 1
Translate Value: Disable

Aside from that I don't know what to tell you as like I said it doesn't have support for view access level and usergroup conditions yet, but it will with next release. The above is just an attempt at working around the lack of such a feature by using IF conditions to actually perform the initial conditioning.


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.

Please Log in or Create an account to join the conversation.

10 years 1 month ago #248943 by zingerdigital
Replied by zingerdigital on topic CB Conditional Help?
I tried to use one of the fields from the pulldown, the "username" field.
And that worked the way it is supposed to, with enabling Profile View and Profile Edit.

I guess I'll have to wait until the next version to be able to use "viewaccesslevel" and "gids"

My work around is along with the condition, I'm using the CB Privacy and setting the Edit Display
That seems to work for now

Thanks,
Robert
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum