cbcontent syntax and logic question

13 years 10 months ago #137273 by ThePiston
cbcontent syntax and logic question was created by ThePiston
I want to make a compex query of sorts using the cbcontent module like this:

[code:1][cb:if cb_subscription="4" and cb_gradyear="2010"][/code:1]

Is that the correct syntax? Also, his it possible to use other code to represent the current year so I do not have to remember to change the date?

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X

Please Log in to join the conversation.

13 years 10 months ago #137274 by ThePiston
Replied by ThePiston on topic Re:cbcontent syntax and logic question
ok, I found on Krileon's tutorial that you can use these operators:

and, or, = , !=, , =

Is it not possible to use < or > for integers. I'm asking because I want to be able to use this logic:

[cb:if cb_subscription="4" and cb_gradyear[color=#FF0000]>[/color]"2010"]

CB 2.3, CBsubs 4.3, PHP 7.1, J! 3.9.X

Please Log in to join the conversation.

13 years 9 months ago #137321 by krileon
Replied by krileon on topic Re:cbcontent syntax and logic question
Yes such operators are possible. I've updated the tutorial with all operators viewed via source, but can not confirm if all will work as expected. I recommend CB 1.2.3 as that is the release of which the source was viewed.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.153 seconds

Facebook Twitter LinkedIn