hi!
I have a view where I have a form that links a 'bono' to a 'comercio'.
I need that search filters of that view to be able to filter by those 'comercios' that have been assigned. How can I do that?
You can see here:
/prueba/
Hello,
I assume we are talking about the page:
hidden link
I can see there is a relationship filter in above search form: Campaña Bonos
It seems to work fine, is this problem resolved?
More help:
Displaying many related items
https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items
Add filters based on post relationships
https://toolset.com/course-lesson/creating-a-custom-search/#add-filters-based-on-post-relationships
Hi Luo,
The problem is not with 'campana-bonos'. What I want is to be able to filter by the 'comercios' assigned to 'bonos'. (It is the Validacion-comercios-bonos relationship)
Are you going to add two post type relationship filters into search form?
If it is, one post view can only add one relationship filter, there isn't such kind of built-in feature within Toolset plugins, you should be able to see the relationship button is gray, see my screenshot relation-filter.JPG
And there are two relationships between the same post types "comercios" and "Bonos":
- Relación Bonos Comercios (many-to-many)
- Validacion-comercios-bonos (one-to-many)
Is there any special reason to setup such kind of complicated relationships?
Hi Luo,
The correct relation is that of
-Validacion-comercios-bonos (one-to-many)
I would need to be able to filter for it.
As I mentioned above, you can add only relationship filter to one post view.
Since you hare already setup one post type relationship filter in the post view "Listado bonos administrador prueba", ID: 10046.
hidden link
section "Filtro de consulta"(If you don't find section "Filtro de consulta", please click "Screen options", and enable the related options.):
Seleccionar entradas con la relación Campañas Bonos Bonosthat are related to the Post with ID set by the URL parameter wpv-relationship-filter.
p. ej., hidden link
If you don't need above relationship filter, you can remove that existed relationship filter, and add the correct one:
Validacion-comercios-bonos (one-to-many)
See the document I mentioned above:
https://toolset.com/course-lesson/creating-a-custom-search/#add-filters-based-on-post-relationships