Skip Navigation

[Résolu] Issues with Content Templates outside the Loop on Archives

This support ticket is created Il y a 4 années et 1 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Marqué : 

Ce sujet contient 2 réponses, a 2 voix.

Dernière mise à jour par alexG-4 Il y a 4 années et 1 mois.

Assisté par: Luo Yang.

Auteur
Publications
#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.

lien caché

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:

lien caché

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!

Ce ticket est maintenant fermé. Si vous êtes un client de Toolset et que vous avez besoin d'aide, veuillez ouvrir un nouveau ticket d'assistance