[SOLVED] Using an IF statement within a Query Display Row on a [column_ value

6 years 5 months ago - 6 years 5 months ago #298148 by cpaschen
I have a query field with a 'multiple' display.

The query returns [column_state] that I need to use to show/hide different content based on the value in [column_state].

I've tried a few different options with [cb:if
but nothing related to that seems to work.

I've also tried to insert inline php code with an if clause, but that doesn't seem to work either.

Is there any way within a Display's "Row" to create an if clause based on the value of a [column_value]?

Please Log in to join the conversation.

6 years 5 months ago #298163 by krileon
You should be able to use IF substitutions on it like you would any field value. Example as follows.

[cb:if column_value="123"]Pass[/cb:if]

The Template output usage also gives access to PHP as it's output by a template file where the query data is passed.


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.

6 years 5 months ago #298202 by cpaschen
Thanks. I had brackets around the column_name as well. Removed them and it works perfectly.

Could you tell me where to find the template output file (or any docs/other posts that give any details about using that method)?

Please Log in to join the conversation.

6 years 5 months ago #298217 by krileon

Could you tell me where to find the template output file (or any docs/other posts that give any details about using that method)?

The template file can be found in the plugins templates folder below.

/components/com_comprofiler/plugin/user/plug_cbqueryfield/templates

Copy the default template, rename it, then select it as your template within your Query field and start editing the display.php file within your template.


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.

6 years 5 months ago #298245 by cpaschen
More cool ways to customize!

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

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.193 seconds

Facebook Twitter LinkedIn