Skip Navigation

[Resolved] Filter in view

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

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 4 years ago.

Assisted by: Luo Yang.

Author
Posts
#1909733

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/

#1910235

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

#1910281

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)

#1910391
relation-filter.JPG

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?

#1910499

Hi Luo,

The correct relation is that of
-Validacion-comercios-bonos (one-to-many)

I would need to be able to filter for it.

#1911483

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