Skip Navigation

[Resolved] Wrap repeater fields into custom tags

This support ticket is created 4 years, 9 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by romanB-3 4 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#1575657

Hello,
I have a custom repeatable field for media files.
When I display the field on a view, it displays

<em><u>hidden link</u></em>

By adding a

<li>

at the beginning of the view, a separator "

</li><li>

" and another

</li>

at the end, I can display the list into a ul/li HTML tags.
But I would also like to wrap the URLs into custom <a> tags.
What would be the best way to do this ?
Thank you.

#1576059

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Roman,

Thank you for getting in touch.

You can actually do this by using the shortcode below.
https://toolset.com/documentation/user-guides/views/views-shortcodes/#wpv-for-each

There is an example in the documentation that should help you resolve this issue.

For a clearer example have a look at the list below.


<ol>
[wpv-for-each field="wpcf-my-field"]

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

[/wpv-for-each]

</ol>

Where the 'wpcf-my-field' is slug of your custom field.

Please let me know if this helps.

Thanks,
Shane

#1576189

Great, perfect !
Thanks a lot !