Hi Toolset team,
I am trying to display the selected checkboxes options as an unordered list, instead of a text list divided by commas.
Is this possible? I checked the documentation and forums but could not find out how to achieve that.
I also read that the checkboxes custom field is still 'old code'. Could that lead to any troubles or incompatibilities later, e.g. when the current checkboxes is replaced by one built with with new code? I am just checking, because in that case I may go for another interim solution.
Many thanks,
Alex
You could use a Single Field Block, then in the Inspector's Field Settings choose "Raw values" as output mode, and insert opening a closing List tags to the separator
The problem is you wouldn't be able to open (the first li tag) and close (the last li tag) the list tags, since the Blocks do not allow for this, and hence, it's not possible to display a checkboxes field like that in blocks with just settings
You'd have to use the ShortCode, for example, in a Text and Fields Bock, and wrap the ShortCode in a li (open and close tags), and then also use closing and opening tags in the separator attribute of the ShortCode.
I've added the ability to WRAP as a feature request so this can be considered in future.
Please let me know if you need help with the ShortCode using separators
Thank you, Beda!
I am glad it is possible to do this using ShortCode.
I tried this one, but that only gave 1 bullet:
<ul>[types field="included" state="checked" seperator="<li></li>][/types]</ul>
I read through the forum solutions and documentation, but could not get it to work unfortunately.
What would be the correct way of doing this?
Many thanks for your help,
Alex
With shortcodes, it'd be done let's say in a Text and Fields Block, like so:
<li>[types field='boxes' output='raw' separator='</li><li>'][/types]</li>
Or,
<li>[types field='boxes' separator='</li><li>'][/types]</li>
Note, this will display the value of each option
Given we open and close the list, it'll produce a bullet for each option checked.
This is best inserted in HTML editing mode of a Text and Fields Block.