Skip Navigation

[Resolved] Issues with Content Templates outside the Loop on Archives

This support ticket is created 4 years, 6 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 2 replies, has 2 voices.

Last updated by alexG-4 4 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1667593

I am finding problems when I use Content Templates outside the loop in Archives.

This video shows how using a content template (which I'm using to implement a modal popup) impacts the Text Search functionality: I get a PHP error when text search finds no results - but it works if I replace the content template with the HTML that it contains.

hidden link

In the above video, I made reference to another problem I'd had with content templates outside the loop. In this case, the content template holds the HTML for the text search functionality.

The following video shows exactly that problem:

hidden link

In summary - there seems to be a problem with using content templates outside the loop in archives.

As I indicated, this is not holding me up because I can simply replace the content templates with the HTML that they contain (I'm using them purely to contain HTML that I use in multiple places).

However, it DOES mean having to replicate and maintain the code in four (or more) places - so if there is a solution to this, that would be great.

Thanks

Alex

#1668129

Hello,

Thanks for the details, it is a known issue, see our erratum:
https://toolset.com/errata/content-template-is-not-rendered-if-added-outside-the-archive-loop-of-a-view/


However, there are two cases where Content Templates will not display:

If you insert Content Templates outside the wpv-loop HTML tags.

And it is in our to-do list, our developers are working on it, but I am not sure when will be fixed, currently, you will need to try as the erratum:
It is also not recommended to insert Content Templates outside the wpv-loop HTML tags on any archive or a View.
Just same as your second video.

#1668165

Thanks, Luo.

It's helpful to know it's a known issue.

My issue is resolved now. Thank you!