Saltar navegación

[Resuelto] Taxonomy term fields on Custom Searches

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

Problem:
The user would like to have a search, with term fields, in a taxonomy view.

Solution:
Custom search is not possible for taxonomy views and user views. It is only possible for post views. We have an existing feature request for custom taxonomy searches and I have added your voice to the request.

You may also confirm it in our feature request form https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

However, I believe that a workaround can be implemented using custom code. At the end, taxonomy views are just a wrapper around a WP_Term_Query instance. And we do offer a hook to modify the arguments that would be passed to it:

Relevant Documentation:

This support ticket is created 4 years, 11 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

Zona horaria del colaborador: Africa/Casablanca (GMT+01:00)

Etiquetado: ,

Este tema contiene 2 respuestas, tiene 2 mensajes.

Última actualización por Rodrigo Lopes 4 years, 11 months ago.

Asistido por: Jamal.

Autor
Mensajes
#2100173
Image1.jpg

Hi.

Tell us what you are trying to do?
I created a taxonomy view to insert a term taxonomy in the template front end. It worked OK. As expected, I can see a flag icon (term) and the respective nation (taxonomy). Then, I created the main page featuring a View Search. Unfortunately, the view is not available in the 'insert custom search filter' when I add a new search field.

Is there any documentation that you are following?
According to Toolset documentation, "you can display term fields on a View listing terms and on a term archive page". Does it mean that I cannot use it in a search? Is there any way to do it?

Is there a similar example that we can see?
I wanted to see flag icon + nation when I click on 'All Nations'.

What is the link to your site?
enlace oculto

Thank you very much

#2100505

Hello and thank you for contacting Toolset support.

I am afraid, custom search is not possible for taxonomy views and user views. It is only possible for post views. We have an existing feature request for custom taxonomy searches and I have added your voice to the request.
You may also confirm it in our feature request form https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
I have no other influence on how the developers prioritize features and I am unable to predict when they might add such a feature, but adding your request helps show that there is a demand for it.

However, I believe that a workaround can be implemented using custom code. At the end, taxonomy views are just a wrapper around a WP_Term_Query instance. And we do offer a hook to modify the arguments that would be passed to it:
- https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_taxonomy_query
- https://developer.wordpress.org/reference/functions/get_terms/
- https://developer.wordpress.org/reference/classes/wp_term_query/

I hope this helps. Let me know if you have any questions.

#2101277

I hope they add that feature soon. Thank you!