Hi Noman
I referred to these 2 posts:
https://toolset.com/forums/topic/parametric-search-filtering-by-parent-types-field/
https://toolset.com/documentation/toolset-training-course/part-9-many-to-many-relationships-in-
toolset/
Here are the steps I taken:
Create Post Type College with Country as a custom field - Added some posts
Create Post Type Consultant with Country as a custom field - Added some posts
Create Post Type Common -- is a child of College & Consultants -- Created some relationship post
with colleges and consultants. I am able to display colleges using the Country custom field dropdown in college post and also consultant using the Country custom field dropdown in consultant post. I am also able to display all consultants for particular college and all colleges for particular consultant but wanted to filter by country dropdown.
I have created 2 views:
Child View -
Display all results
Content Selection - Common
Query Filter: Select posts that are children of the Post where this View is shown.
Loop Output Editor:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-post-link id="$consultant"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]
Filter and Loop Output Integration Editor:
[wpv-filter-meta-html]
[wpv-layout-meta-html]
2nd View Location-Parent:
Display the results using a custom search
Content Selection - Consultants
Custom Search Settings : AJAX results update when visitors change any filter values
Filter Editor:
[wpv-filter-start hide="false"]
[wpv-filter-controls]
<div class="form-group">
<label>[wpml-string context="wpv-views"]Country[/wpml-string]</label>
[wpv-control-postmeta field="wpcf-country" url_param="wpv-wpcf-country" type="select"
auto_fill="wpcf-country"]
</div>
[/wpv-filter-controls]
[wpv-filter-end]
Loop Output Editor : Here's I am using the child view
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-view name="child"]
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
[wpml-string context="wpv-views"]No items found[/wpml-string]
[/wpv-no-items-found]
[wpv-layout-end]
Filter and Loop Output Integration Editor
[wpv-filter-meta-html]
[wpv-layout-meta-html]
I got the filter to display but its not working because it shows all the consultants regardless the
country you select. In this particular example :
hidden link
This college has 2 consultants each from UK & USA. Its display both the results regardless the selection. I would like to display only UK consultants when selected UK & USA Consultants only when selecting USA and no items when selecting India.