I’m not sure if this is possible with Toolset. From what I’ve seen, there are similar questions but no simple example that I can find of how to do this. I will attempt to describe my setup and the goal of the search function on my site:
SETUP:
I have a custom parent type called New Construction Home.
It has child post types called Models.
The parent post type displays all of the models on the parent content template page. Everything looks and works great there.
I am trying to create a parametric search that would allow users to search for details that are only found in the custom fields of the child posts (models) but will display a list of the parent post types as the search results (loop output).
From the support threads I’ve found, the only way to do this is to use the loop output to display the parent fields for each child that meets the criteria, which would result in many, many duplicate listings in the search results in our case. Is there a way to set up a parametric search that uses custom fields from the child post type even when the "Content Selection" is the parent post type?
Thanks,
Marcus
Dear Marcus,
There isn't such a feature within Views plugin.
Since Views is using wordpress class WP_Query to query to posts, so all custom fields and custom taxonomies should be setup in the post type you are going to display:
http://codex.wordpress.org/Class_Reference/WP_Query
And one parent post can have multiple child posts, so the problem occurs as you mentioned:
which would result in many, many duplicate listings in the search results.
In your case, you can try add your custom filters with Views filter hook:
https://toolset.com/documentation/user-guides/views-filters/
wpv_filter_query
Filters the main Query in a View displaying Posts
But it needs some custom PHP codes, you can check out our certified partners for it:
https://toolset.com/consultant/