Correct writting

1 year 3 months ago - 1 year 3 months ago #332435 by sereniteam
Correct writting was created by sereniteam
In a "text zone field" type how can I set condition to show different message ? 

Is my writing correct in relation with condition of a radio-box field  named "cb_titre" ( Value of the cb_titre could be 1, 2, 3, 4 or 5 ) 

In the parameter and then in AFFICHAGE on the profil (public ) I wrote the following code : 
[cb:if cb_titre==1]blablabla [/cb:if]
[cb:if cb_titre==2]nanana [/cb:if]
....
Is there something missing to catch or to test the cb_titre value ? 


But it don't work 

Thank you for your help
I ask you that because I use a lot of text fields and conditions to show them or to hide them. If I can organize with "If "condition I would save number of fields instead of one with correct code in it. 


 

SereniTeam

Please Log in to join the conversation.

1 year 3 months ago #332441 by krileon
Replied by krileon on topic Correct writting

In the parameter and then in AFFICHAGE on the profil (public ) I wrote the following code :
[cb:if cb_titre==1]blablabla [/cb:if]
[cb:if cb_titre==2]nanana [/cb:if]
....
Is there something missing to catch or to test the cb_titre value ?

That's not valid substitution syntax. Our substitution syntax is well documented below.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

If you want to check if a text field has a value or not you can use the below.

Not Empty (Text Field)
Syntax: [cb:if FIELD_NAME!=""]The text field is not empty.[/cb:if]
Example: [cb:if cb_mytext!=""]The text field is not empty.[/cb:if]

Empty (Text Field)
Syntax: [cb:if FIELD_NAME=""]The text field is empty.[/cb:if]
Example: [cb:if cb_mytext=""]The text field is empty.[/cb:if]

If you want to check if a radio field has a specific value selected you'd just condition against that value. Example as follows.

Value Selected (Radio Field)
Syntax: [cb:if FIELD_NAME="VALUE"]The radio VALUE is selected.[/cb:if]
Example: [cb:if cb_myradio="1"]The radio 1 is selected.[/cb:if]


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: sereniteam

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.257 seconds