Problem:
The customer wants to display a checkboxes field with multiple selections on the front end as a list view. Currently, the field is displayed with a separator, but this method does not allow for proper styling or HTML tags.
Solution:
To display each selected checkbox as a list item, conditional HTML can be used. Here is an example code snippet:
<ul> [wpv-conditional if="( '[types field='your-field' option='0'][/types]' eq '1' )"] <li>Option 1</li> [/wpv-conditional] [wpv-conditional if="( '[types field='your-field' option='1'][/types]' eq '1' )"] <li>Option 2</li> [/wpv-conditional] [wpv-conditional if="( '[types field='your-field' option='2'][/types]' eq '1' )"] <li>Option 3</li> [/wpv-conditional] </ul>
Replace 'your-field' with the actual field name and option='X' with the corresponding option number. This approach allows each selected option to be displayed as a list item, enabling the use of HTML tags for styling.
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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | 9:00 – 12:00 | - |
- | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | 13:00 – 18:00 | - |
Supporter timezone: America/Sao_Paulo (GMT-03:00)
This topic contains 1 reply, has 2 voices.
Last updated by 10 months ago.
Assisted by: Mateus Getulio.