Skip Navigation

[Resolved] Filter by ancestors: parents and grandparents great grandparents not working

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

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/Karachi (GMT+05:00)

This topic contains 2 replies, has 2 voices.

Last updated by Waqar 3 years, 5 months ago.

Assisted by: Waqar.

Author
Posts
#2127207

I'd like to search/filter on curriculum posts by parents and grandparents.

I tried setting "always show all values for inputs" - that shows the parent and grandparent values but does not filter the results or adhere to the selected type for the filter.

Is there any documentation that you are following? Can't find any recent documentation

What is the link to your site? hidden link

#2127629

Hi,

Thank you for contacting us and I'd be happy to assist.

To troubleshoot this, I'll need to see how this view and the post relationships are set up in the admin area.

Can you please share temporary admin login details, in reply to this message?

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#2128943

Thank you for sharing these details.

During troubleshooting, I noticed that in the view "Instructional Materials Search", two instances of the "wpv-control-post-relationship" shortcodes were added in the "Search and Pagination" section:


[wpv-control-post-relationship ancestors="cesa@cesa-district.parent>district@district-school.parent>school@school-curricula.parent" url_param="wpv-relationship-filter"]
<div class="form-group">
	<label for="wpv-relationship-filter-cesa">[wpml-string context="wpv-views"]CESA[/wpml-string]</label>
	[wpv-control-post-ancestor type="select" ancestor_type="cesa@cesa-district.parent"]
</div><div class="form-group">
	<label for="wpv-relationship-filter-district">[wpml-string context="wpv-views"]Districts[/wpml-string]</label>
	[wpv-control-post-ancestor type="select" ancestor_type="district@district-school.parent"]
</div><div class="form-group">
	<label for="wpv-relationship-filter">[wpml-string context="wpv-views"]Schools[/wpml-string]</label>
	[wpv-control-post-ancestor type="select" ancestor_type="school@school-curricula.parent"]
</div>
[/wpv-control-post-relationship]

  
[wpv-control-post-relationship ancestors="school@school-curricula.parent" url_param="wpv-relationship-filter"]
<div class="form-group">
	<label for="wpv-relationship-filter">[wpml-string context="wpv-views"]Schools[/wpml-string]</label>
	[wpv-control-post-ancestor type="multi-select" ancestor_type="school@school-curricula.parent"]
</div>
[/wpv-control-post-relationship]

As only a single instance of this shortcode can exist in a view, I've removed the incorrectly added second instance and the relationship filter is working correctly now.