Skip Navigation

[Resuelto] Specify Content Template in Post URL

This support ticket is created hace 3 años, 11 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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)

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por aaronM-9 hace 3 años, 11 meses.

Asistido por: Waqar.

Autor
Mensajes
#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!