Skip Navigation

[Resolved] Display a text by Toolset Conditional output

This thread is resolved. Here is a description of the problem and solution.

Problem:

I have 2 multi-checkboxes fields. In the content template I place them together in a container.

This is the outcome I want:

If the both fields have values than add ", " in between two fields

Solution:

You can try to modify the codes as below:

https://toolset.com/forums/topic/display-a-text-by-toolset-conditional-output/#post-1662777

Relevant Documentation:

https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/

This support ticket is created 4 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 2.13 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by WeiS2074 4 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#1661159
capture.JPG

I have 2 multi-checkboxes fields. In the content template I place them together in a container. I try to use conditional output, but don't know what I should enter in the value.
This is the outcome I want:
If the both fields have values than add ", " in between two fields

Here is the HTML:
<p>[types field='type-a' separator=', '][/types] [types field='type-b' separator=', '][/types]</p>

#1662777

Hello,

You can try to modify the codes as below:

<p>[types field='type-a' separator=', '][/types][wpv-conditional if="( $(wpcf-type-a) ne '' ) AND ( $(wpcf-type-b) ne '' )"], [/wpv-conditional][types field='type-b' separator=', '][/types]</p>

And test again, more help:
https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/

#1663173

My issue is resolved now. Thank you!