Skip Navigation

[Resolved] How to display Checkboxes as unordered list on frontend?

This support ticket is created 5 years, 3 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.

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 michelG-2 5 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1318571

Hello,
I have created a custom field "checkboxes" in a post field group for a custom post type. I want to display in the frontend the different values for any given post as an unordered list. I have also created a view to loop through the different values checked for a given post.

The view works as much as selecting the correct values to display, but I cannot find a way to display each value separately. I get an unordered list with a single item containing all the different values separated by a comma. I understand this (comma separated) is the default display option when you create the checkboxes, but I have not found a way not to treat all checkboxes as a whole.

It looks like this would be quite a standard way to display checkboxes, so I assume I am missing something obvious, just don't know what! So any help would be appreciated.

#1318707

Hello,

Yes, it is possible to display custom checkboxes field as unordered list, for example:

<ul>
<li>[types field="my-checkboxes" separator="</li><li>"][/types]</li>
</ul>

More help:
https://toolset.com/documentation/customizing-sites-using-php/functions/#checkboxes
separator:
text or html tags to insert between each field

#1319037

Thanks, this is what I needed. Works perfectly.