I have a Repeating Custom Field and want to output it as a list (each of its items should be a list item) or I want to add an Icon on the front of each.
How can I do that?
To create a list or other HTML structures with Repeating Fields we suggest using the Separator and the Loop intelligently to combine HTML and opening/closing tags in the Field's separator.
The logic is this:
- get the final HTML you want
- make sure you open the HTML before the actual field renders
- as separator use firstly the closing tags, then, reopen the tags for the next item
- make sure the Loop closes with a Closing set of tags.
Example:
<ul><li>[types field='toolset-line' separator='</li><li>' ][/types]</li></ul>
Note that you need to add NOT encoded characters (hence, natural HTML) to the GUI’s separator input field, it will then automatically convert to encoded characters when you insert the ShortCode!
The same logical approach can be taken with other HTML or even FontAwesome Items.
Note that this is limited, do not expect to have too much control over the resulting HTML.
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 |
---|---|---|---|---|---|---|
- | - | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 |
- | - | - | - | - | - | - |
Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)
This topic contains 6 replies, has 2 voices.
Last updated by 6 years, 9 months ago.
Assisted by: Beda.