Skip Navigation

[Resolved] Loading content template for a Divi post not working

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

Problem: When I update the search filters in my View, the updated results are formatted incorrectly.

Solution: Add suppress_filters="true" to the loop template shortcode.

[wpv-post-body view_template="loop-item-in-course-search-toolset-test" suppress_filters="true"]
This support ticket is created 5 years, 11 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 5 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#1181467

Hi Support Team

I'm not sure if anyone else has reported this problem yet, and I'm also not sure how this relates to Toolset or Divi in terms of where the problem lies.

I've set up a basic view that shows the problem here:
hidden link

This view has a loop as follows:

	<wpv-loop>
      <div class="loop-item">
        <h4 class="course_title">Inline: [wpv-post-title]</h2>
		[wpv-post-body view_template="loop-item-in-course-search-toolset-test"]
      </div>
	</wpv-loop>

The content template has this in it:

<h4 class="course_title">Template: [wpv-post-title]</h4>

So you would expect the output of this loop to be:

      <div class="loop-item">
        <h4 class="course_title">Inline: [wpv-post-title]</h2>
	<h4 class="course_title">Template: [wpv-post-title]</h4>
      </div>

When I first load the page that is what's displayed. But if you change the filter to "TEFL Specialization" 3 items are displayed in the output, but the 1st and third don't display the output from the content template, just the inline content.

And if you have a look at the code inspector you see that the following is displayed:

<div class="loop-item">
        <h4 class="course_title">Inline: TEFL Graduate 40 Hour Grammar Course</h4>
	<div id="et-fb-app" class="et-fb-page-preloading"></div>
        <div class="et_fb_fallback_content" style="display: none">
          <h4 class="course_title">Template: TEFL Graduate 40 Hour Grammar Course</h4>
        </div>
</div>

For some reason the item in the content template is not displaying as it should. Either Toolset or Divi is wrapping it in a div that doesn't allow it to be displayed.

I've done some testing and this only happens if the Divi builder is activated on the post.

Have you got any idea how I can prevent this happening? The only workaround I have a the moment is to place all of the loop content inline into the view and not use a content template.

Thanks
Tim

#1181615

I've seen a couple of similar issues recently with Divi integration in a View. Try adding the suppress_filters attribute to the template shortcode, like this:

[wpv-post-body view_template="loop-item-in-course-search-toolset-test" suppress_filters="true"]

In some cases, that's enough to solve the problem. In other more complex cases it's not sufficient, and we have an internal ticket in place to investigate solutions. Let me know what you find out and we can go from there.

#1182158

Hi Christian

Thanks for that. It seems to have fixed the problem. Can I ask, is there any reason that suppress_filters="true" is not default behaviour? I'm not exactly sure what else it might affect, but would it be sensible for me to add it to all of my views when using Toolset with Divi?

Thanks
Tim

#1183072

The suppress_filters attribute overrides and blocks filters applied by other 3rd-party plugins and themes. I think the default is "false" because it has the potential to break features applied by other 3rd-party systems. I think you should only add this setting if there is an obvious problem with AJAX pagination or updates in the View.