Skip Navigation

[Resolved] paragraph tag inserted despite “Manual paragraphs” setting

This thread is resolved. Here is a description of the problem and solution.

Problem:

Auto paragraphs getting added to a Types field when displayed on the frontend.

Solution:

The user was able to resolve this by using the output='raw' attribute to display the exact data that was stored in the database.

Example
[types field='my-field' output='raw'][/types]

Or you can use the our [wpv-noautop] shortcode.
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-310704

This support ticket is created 5 years, 4 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

This topic contains 11 replies, has 2 voices.

Last updated by ABSTRACTUS 5 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#1288923

In a Content Template, I have included the following call:
<p> …
[wpv-if info="wpcf-exhibition_opening_info" evaluate="!empty($info)"]<br /><span style="color:rgb(0, 0, 0); font-family:lucida grande,tahoma,verdana,arial,sans-serif; font-size:12px; line-height:normal; text-align:-webkit-auto">[types field="exhibition_opening_info" class="" style=""][/types]</span>[/wpv-if]</p>

Although the setting is on Manual paragraphs, the output source code on hidden link includes a <p> tag after the <span>:
<p> …
<span style="color:rgb(0, 0, 0); font-family:lucida grande,tahoma,verdana,arial,sans-serif; font-size:12px; line-height:normal; text-align:-webkit-auto"><p>Speed Speech von Iris Ganz, Performancekünstlerin</p>
</span></p>

As a result, the formatting defined in the <span> is now overridden by the <p> formatting and therefore got useless.

How can I prevent Views from inserting this <p> tag? I have set the Template to "Manual paragraphs", so imho that should be the solution, but obviously it is not :-S

Thank you for any idea!

#1288929

Shane
Supporter

Languages: English (English )

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

Hello,

Thank you for contacting our support forum.

The reason why this is happening could be because you are using older versions of our plugins.

Could you update them and let me know if this issue still remains?

Thanks,
Shane

#1288935

Hi Shane,
Thank you, yes the issue remains also after updating the plugins and emptying the cache.
Claudius

#1288963

Shane
Supporter

Languages: English (English )

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

Hi Claudius,

What you can do is to add the wp-noautop shortcode and this should help.

Have a look here.
https://toolset.com/documentation/user-guides/views-shortcodes/#vf-310704

Thanks,
Shane

#1289029

Hi Shane,

Thank you for the hint. The shortcode looks promising – but doesn't help :-S

I have wrapped the whole Content Template code with [wpv-noautop][/wpv-noautop] and cleared/switched off all caches – but the <p>'s are still in the code…

Do you have any other idea?
Thank you, Claudius

#1289721

Shane
Supporter

Languages: English (English )

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

Hi Claudius,

Would you mind allowing me to have admin access to the site so that I can have a look at this for you ?

The private fields will be enabled for your next response.

Thanks,
Shane

#1290013

Shane
Supporter

Languages: English (English )

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

Hi Claudius,

Thank I was able to log in but i'm struggling to find the template that you are having the issue with.

Could you send me a link to the template on the backend ?

Thanks,
Shane

#1290089

Sure, sorry i forgot to indicate.
It is the Embedded Opening for Newsletter template
hidden link
Embedded in the Upcoming Openings Dynamic by ArtRegion for Newsletter view hidden link

#1290603

Shane
Supporter

Languages: English (English )

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

Hi Claudius,

Thank you, I checked this for you and on the frontend. There isn't any auto paragraphs being added.

Even so I suspect that this is a case where your view is made much more complex than it needs to be. I'm not sure why you are calling a post body template on a view that is not attached to the view at all.

Then in that template again you are calling the same post body with a completely different content template. I would suggest doing some cleanup of your code to ensure that it is streamline.

Thanks,
Shane

#1290645
Bildschirmfoto 2019-07-12 um 19.00.39.png

Hi Shane

Thank you for the cleanup hints – in fact, I've used content templates instead of putting the code directly in the view because I intended to reuse the content template "snippet". But I'll have a look at it for sure.

Regarding the <p> inserted, whether it's called "auto" or some differently, I cannot help myself: When I call the source code of the page hidden link I still have the <p>'s in there that override my formatting for the "exhibition_opening_info" field. And my question remains, how can I get rid of them resp. format the text differently than <p> style?

Thank you,
Claudius

#1290731

Shane
Supporter

Languages: English (English )

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

Hi Claudius,

Instead of wrapping the entire section in the wpv-noautop shortcode. Just wrap this section only where you are having the issue.

So it should be <span>[wpv-noautop][types field='my-field'][/types][/wpv-noautop]</span>

Thanks,
Shane

#1292331

Hi Shane

Also at the recommended position, the [wpv-noautop] didn't help, the <p> was still there.

But I found the solution: adding output="raw" to the [types field='my-field'] shortcode eliminated the wrapping <p>!

Thank you for your ideas and inputs anyway!
Claudius