This support ticket is created 5 years, 10 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.
I would like to be sure about searchs.
I have 2 CPT in a relationship ONETOMANY
Exemple : House and room
If i had to search on these 2 CPT. That i have understood is :
- I create a relationship on the field id house or name (example)
- When i search i cannot create search on the 2 CPT on the same time, so i if wanted to search all rooms that are biger than 20 meters and belong to house that is Newyork city, i'd have to make the field city available on room CPT and fill it for each room.
After that, i could search.
Right ?
It is very strange, if we had to do that, it would be really not clean and not appropriate if we have lot of relationships.
The way WordPress queries the database to retrieve posts, you can only refine the query by specifying properties of the thing you are querying for.
So if you are searching for Room posts, you can only filter the search with properties of Rooms (e.g. size), not with properties of something else (e.g. the "has garage" property of a house).
The user experience expects that, but the underlying database queries are not set up for it.
It is, of course, possible when you start customising the queries (joining database tables or chaining queries), but at the moment the Views queries are built on top of the underlying WordPress queries.
We have a couple of unfinished tickets to complete the many-to-many relationships project, and filter posts by fields of related posts is one of them.