Skip Navigation

[Resolved] looping comma separated name form "field" type

This support ticket is created 4 years, 7 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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by WillL606 4 years, 7 months ago.

Assisted by: Waqar.

Author
Posts
#1606189
Screen Shot 2020-04-29 at 12.58.51 PM.png

Tell us what you are trying to do?
I have example of looping names from a another View, but I can't seem to translate the loop for names from a field.

Here is what have:
<div class="gatherlist-author">by [types field="essay-author"][/types], [types field="publicationdate" style="text" format="F j, Y"][/types]</div>

And all I want to do is insert commas if more than one name on this [types field="essay-author"][/types]

Is there any documentation that you are following?
I have tried to follow examples, but I keep getting code in the output.

Is there a similar example that we can see?

What is the link to your site?
hidden link

#1606709

Hi Will,

Thank you for contacting us and I'd be happy to assist.

For fields with multiple instances/values, you can use the "separator" attribute to include a separator of your choice:
https://toolset.com/documentation/customizing-sites-using-php/functions/#textfield

For example, for a comma-separated output, you can update your field shortcode to:


[types field="essay-author" separator=", "][/types]

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1607413

My issue is resolved now. Thank you!