Skip Navigation

[Resuelto] Taxonomy Term Specific Content Template

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

The issue here is that the customer wanted to use a different content template for each of his Taxonomy Terms.

Solution:

The solution to this is by using the has_term function and our [wpv-conditional] shortcode.

For example.

[wpv-conditional if="( has_term('Chinese', 'foreign-language', null) eq '1' )" ]
  
Content template 1 
[/wpv-conditional]
 
[wpv-conditional if="( has_term('Japanese', 'foreign-language', null) eq '1' )" ]
  
Content template 2
[/wpv-conditional]
 
[wpv-conditional if="( has_term('French', 'foreign-language', null) eq '1' )" ]
  
Content template 3
[/wpv-conditional]

This way for each of the taxonomy terms you are able to use a different content template to depict how they are displayed.

Relevant Documentation:

For more information on this please take a look at the link below.
https://toolset.com/documentation/user-guides/conditional-html-output-in-views/displaying-taxonomies-conditionally/

This support ticket is created hace 8 años, 1 mes. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Etiquetado: 

This topic contains 18 respuestas, has 2 mensajes.

Last updated by DavidAlexander hace 8 años.

Assisted by: Shane.

Autor
Mensajes
#379332
Capturexx.PNG

Sorry if you see this copy it is a bit clearer.

So the template single product template is loading the general template, but it just outputs the shortcode, if I include the title shortcode that one works but not the template shortcode (I used the views GUI to add this in by the way so I know its the right slug) but not sure what setting could be wrong on one or both templates to make it just print the shortcode as it appears on the back end.

#379385

Okay I solved this, it seems with the GUI there are two ways to add this in? Using the General Product Template shortcode in the GUI (which doesn't work)

or

Going to add the wpv post body shortcode and THEN selecting the template there. Not sure why they differ as they both insert the same shortcode. Any ideas?

[wpv-post-body view_template="general-product-template"]

[wpv-post-body view_template='general-product-template']

The first adds it with " and the second adds it with '

Though I tried switching " to ' the first time around and that didn't seem to fix it.

#379567

Shane
Supporter

Languages: Inglés (English )

Timezone: America/Jamaica (GMT-05:00)

Hi David,

Do you still need assistance with this?

Sorry for the late response as your messages came in when my shift ended.

If you still need assistance please open a new ticket and we can work on it there.

Thanks,
Shane

#379592

This is resolved now. Thanks

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.