Skip to Content Skip to Menu

Implement and/or in CB Conditionals

9 years 4 months ago #265864 by guillebril
Implement and/or in CB Conditionals was created by guillebril
Hi Kyle! I was wondering if you have any work around for the CB Conditionals that could use AND and OR operations.

I am trying to display the menu only to visitors that have the same Organization Name (cb_orgnameforstaff) as the name of the Organization (cb_orgnamefororg) or if the user is a super user.


Value: [cb:if user=“#me" cb_orgnameforstaff=cb_orgnamefororg or usertype="Super Administrator “]1[/cb:if]
Equal to: 1
Then: show

This is not working so far. Thanks a lot!

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
9 years 4 months ago #265867 by krileon
Replied by krileon on topic Implement and/or in CB Conditionals
There is no OR or AND implementation in CB Conditional. It has no code to account for this. Your usage may work, but it's not following substitution usage nor is usertype valid as you need to use viewviewaccesslevel.

[cb:if viewaccesslevel includes "1"]I am Public[/cb:if]

You can try the below, but I've no idea if it'll work as it's not really a scenario we've tested and covered.

[cb:if user=“#me" cb_orgnameforstaff="[cb_orgnamefororg]" or viewaccesslevel includes "3"]1[/cb:if]

The view access level with an id of 3 is the Special access level, which super users should have. You can create a new one specific to super users as well and use it instead.


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.

9 years 4 months ago #265871 by guillebril
Replied by guillebril on topic Implement and/or in CB Conditionals
Thanks kyle but unfortunately it didn't work. It seems CB doesn't support a substitution inside another substitution

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

Moderators: beatnantkrileon
Powered by Kunena Forum