Skip Navigation

[Résolu] Specify Content Template in Post URL

This support ticket is created Il y a 3 années et 11 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/Karachi (GMT+05:00)

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

Dernière mise à jour par aaronM-9 Il y a 3 années et 11 mois.

Assisté par: Waqar.

Auteur
Publications
#1886227

Apologies in advance - I can't seem to find my way to this answer even though I know it exists. I would like to create a link inside of a view loop that links to the post in the loop but specifies the content template to use.

Specifically, I have a custom post type called "contacts". Normally the default content template for "contacts" would be used to display the post, but if a user clicks on "e-mail this contact" I want it to display the contact using a different content template called "Template for E-Mailing Contacts." This content template contains a form.

Thanks in advance for the help.

- Aaron

#1886479

Hi Aaron,

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

You can override the assigned content template, through the ID of the different content template in the URL parameter "content-template-id".

For example, suppose that your post's URL is:

yourwebsite.com/test-post/

To see it with a different content template (whose ID is 1234), the URL would be:

yourwebsite.com/test-post/?content-template-id=1234

In your view's loop, you can generate this link, like this:


<a href="[wpv-post-url]?content-template-id=1234">[wpv-post-title]</a>

Please replace "1234" with the actual ID of the content template "Template for E-Mailing Contacts".

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#1888157

My issue is resolved now. Thank you!