Skip Navigation

[Resolved] View template within Layout being stripped of content

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

Problem:

Add a view to a layout in order to have a dynamic banner section to pull content from a custom post type, located just under the tabbed Product Specs section.

Only the post body content pulls through, event custom html within the template for the view is stripped. Only the post body shortcode is not removed.

Solution:

There is other plugin/theme adding filters to content template, you can suppress those filter by adding attribute suppress_filters="true" to content template shortcode [wpv-post-body], for example:

[wpv-post-body view_template="Loop item in Product Banner" suppress_filters="true"]

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body

This support ticket is created 6 years, 2 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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by Luo Yang 6 years, 1 month ago.

Assisted by: Luo Yang.

Author
Posts
#1107765
expected-banner.png
broken-banner.png
banner-view-layout.png

I am trying to:
Add a view to a layout in order to have a dynamic banner section to pull content from a custom post type, located just under the tabbed Product Specs section.

Link to a page where the issue can be seen: hidden link

I expected to see:
In the dark banner, the post title, post body, and feature image should be pulled in.

Instead, I got:
Only the post body content pulls through, event custom html within the template for the view is stripped. Only the post body shortcode is not removed.

Additional info:
If the view is placed above all other content it will display as I would expect. Only after placing it below anything, even an empty row, will the layout break.

#1108137

Hello,

Please check these:
1) In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2017, and test again

2) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL and view URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1110174

Thanks for the details, there is some other plugin/theme adding filters to the output of content template, you can suppress those filter by adding attribute suppress_filters="true" to content template shortcode, I have done below modification in your website:
Edit the view "Product Banner"
hidden link

in section "Loop Editor", change the codes from:

[wpv-post-body view_template="Loop item in Product Banner"]

To:

[wpv-post-body view_template="Loop item in Product Banner" suppress_filters="true"]

Please test again, check if it is fixed.

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-post-body
suppress_filters (opt):
'true' | 'false' (default)
If suppress_filters=’true’, all third party (non WordPress) filters hooked into the_content filter will be removed

#1110788

Thank you, that has solved the issue.

#1110873

You are welcome