Problem:
How to output a comma-separated list using a View but not having a trailing comma after the last item.
Solution:
You need to output the content followed by a comma for most of the loop iterations except the last one, where you would output the content only.
You output different content for different iterations using the wpv-item shortcode.
This is handled automatically if you use the Loop Wizard and choose the comma-separated list output option.
Relevant Documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-item
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 |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
This topic contains 2 replies, has 2 voices.
Last updated by 5 years, 11 months ago.
Assisted by: Nigel.