Passer la navigation

[Résolu] Using fields and text block

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:

A user reported that he is trying to show the Types Fields shortcode values within the paragraph tag, but the "Fields and Text" blocks seem to strip the paragraph tag.

Solution:

Guided that this is something related to WordPress and if a paragraph contains only a shortcode, the paragraph tags around the output are stripped.

As a workaround, one can wrap the Types field shortcode inside the "wpv-autop" shortcode.

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-autop

This support ticket is created Il y a 4 years, 2 months. 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 -

Fuseau horaire du supporter : Asia/Karachi (GMT+05:00)

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par matthewW-12 Il y a 4 years, 2 months.

Assisté par: Waqar.

Auteur
Publications
#2320987
back end.png
front end.png

Tell us what you are trying to do?
Display custom field data within p elements

What is the link to your site?
lien caché

With the fields and text block, on the back end, a p element encloses the field data, which is what I want. However, on the front end, a div encloses the field data, and there is no p. Is there a way to control this?

#2322489

Hi,

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

This is something related to WordPress and if a paragraph contains only a shortcode, the paragraph tags around the output are stripped.
(you'll see the same behavior in the core classic or custom HTML blocks)

As a workaround, you can wrap the field shortcode inside the "wpv-autop" shortcode, for example:
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-autop )


[wpv-autop][types field='languages' separator=', '][/types][/wpv-autop]

regards,
Waqar

#2324947

My issue is resolved now. Thank you!