Skip Navigation

[Resolved] I have an empty p tag in first two loops

This support ticket is created 3 years, 1 month 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 TorstenR3514 3 years, 1 month ago.

Assisted by: Waqar.

Author
Posts
#2220551

I have a strange empty <p> tag that only shows up in the first two loops of a view when working with a content template block in the loop content.
hidden link

Tried all sorts of things (like rebuilding the content template from scratch) but the only thing that worked was placing the content directly rather than through a loop template. If I put the blocks right inside the loop, the <p> tag is gone!
hidden link

I work with "Container as Link", but disabling this function does not affect the p-tag
The problem is not related to the theme, also under "Twenty Twenty-One"

Maybe I have a similar problem with another page that only shows the first two images in the English translation. Also, working with templates in the loop content but placing the loop content directly instead of a content template block did not fix the problem.
hidden link
They are ok in the German version (original language)
hidden link

hidden link
has a directory protection toolset:support66 <- please delete!!

#2221187

Hi,

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

Whenever, post body or loop's content is shown using a content template, certain formatting filters are applied to it. When the same content is passed through those filters repeatedly (through the nesting of templates into one another), it increases the risk of over-processing. This is why it is better to avoid the nesting of templates, whenever possible.

For example, the page "Leitungsteam (with template in view)" has the view "rd-view-mitarbeiter-leitung-with-template" in the body content. In this view, the loop's item is being shown using the content template "view-container-zustaendiger-mitarbeiter".

If it is absolutely necessary to show the loop item's content using a content template, you can replace the "content template" block with a "Fields and Text" block and load the same content template using the shortcode:
( ref: https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body )


[wpv-post-body view_template="view-container-zustaendiger-mitarbeiter" suppress_filters="true"]

The use of suppress_filters="true" attribute reduces the content filters applied to the template's output.
( screenshot: hidden link )

You'll note that this approach has fixed the extra P tags added on the page "Leitungsteam (with template in view)".

I hope this helps and you can use the same strategy on other pages with similar issues, as well.

regards,
Waqar

#2221469

Hello Waqar,

Thx for the info and the fix.

Over the past year I have really tried to meet my needs with the block editor, but kept running into one problem after another, so I decided to go back to the legacy editor on this project.

Thx for your help,

Torsten