Skip Navigation

[Closed] Filter by Relationship Category

This support ticket is created 3 years, 7 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.

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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by Christian Cox 3 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#2042965

Tell us what you are trying to do?

E.g. I have 2 CPT Countries and Cities which are connected via relationship. Cities are assigned to Categories e.g. Cat1, Cat2, Cat3.....

I would like to be able to filter ->e.g. all Countries that have a (or multiple) city that are in Cat 1. or Cat2 or whatever...

#2043235

Hello, it depends on whether you mean you want to allow front-end filtering like a custom search, or whether you mean you want to predefine the filters in the backend View configurations. Normally you can filter a View of posts only by the fields, taxonomies, and standard post criteria of that specific post type, not related posts. Depending on your answers to the following questions, there may or may not be a workaround available in Views.
- What other filters, if any, do you intend to include here - custom field filters, taxonomy filters, or filters based on other standard post criteria?
- Are these fields, taxonomies, or standard post criteria associated with the Country post type or the City post type?
- Will these other filters be front-end filters for a custom search, or predefined back-end filters?
- Is the post relationship one-to-many or many-to-many?
- Do you plan to include paginated results, or display all the results on a single page?

#2047275

Hi Christian!

To give you the whole picture:

Post Types from Toolset

Collaborators, Companies, Resources, Tools, Services

(Countries and Cities post type I got the same issue but is easier to explain with these.)

Relationships:

Companies <many to many> Resources
Companies <many to many> Tools
Companies <many to many> Services

Collaborators < many to many > Resources
Collaborators < many to many > Tools
Collaborators < many to many > Services

Resources, Tool, Services have categories (Taxonomy) assigned.

I would like for the user to filter on the frontend A) Companies or Collaborators B) Services, Resources, Tools C) Categories

So the out put would be e.g. All Companies that have Services in Real Estate ; or All Companies and Collaborators that have Tools and Resources in Financing and Investing.

If necessary to achieve above the relationship type could be changed to one to many.

No pagination if it makes thing more complicated.

I hope you have all you need.

Thanks!

Michael

#2049411

Okay there are a few limitations in Views that will prevent you from achieving exactly what you've described here.
1. There is no way to set up a front-end filter for post types. This means you could not set up a front-end filter that allows Users to choose between Companies and Collaborators in the same View. You could set up one View to search for Companies and another View to search for Collaborators, but you would not be able to combine those searches in one View with a filter based on post type.
2. You can add one post relationship filter, but not multiple post relationship filters. So in a View searching for Companies, you could add a post relationship filter to choose a related Service or a related Resource, but not both. Only one post relationship front-end filter is currently supported.
3. You can add front-end filters to choose taxonomy terms or custom fields associated with the search post type, but it is not possible to filter based on terms associated with a related post type. So if the Category taxonomy is associated with the Company post type, you could filter based on Category, but if the Category term is associated with the related Service or Resource post, that type of filtering is not possible in the current search system.

The topic ‘[Closed] Filter by Relationship Category’ is closed to new replies.