Skip Navigation

[Resolved] Add a checkbox filter to a view – when checked only show posts in a relationship

This support ticket is created 5 years 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Chris 5 years ago.

Assisted by: Shane.

Author
Posts
#1374061

Tell us what you are trying to do?
I've set up a one-to-many relationship for Housing Developments -> Voids. I have a view that displays Housing Developments, and in the filter for this view I have a checkbox with the label, "Available now", which matches Housing Developments against a custom field called "properties-available". At the moment, the user has to manually update this custom field to indicate whether the Housing Development has a Void or not. What I would like to do is to make this an automated process. So, if the "Available now" checkbox has been checked, only display Housing Developments which have a corresponding Void.

What is the link to your site?
hidden link

#1374261

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Chris,

Thank you for getting in touch.

Is it that a void can only be attached to one housing development ? Or is it that One development can have many voids?

We might be able to achieve this by just using a nested view, or even just a single view listing the voids that are available.

Please let me know.
Thanks,
Shane

#1374587

Hi Shane,

Thanks for your quick response.

So, a housing development can have many voids but a void can only have one development. Great, looking forward to your suggestions.

Many thanks

#1374647

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2019-11-01 at 10.09.29 AM.png

Hi Chris,

So the issue is that you will need to create a view listing the voids, then add a filter to that view to show only the available voids.

This in turn will allow you to display the parent title from the void view. To do this click the fields and Views button on your output editor then add the post title and then select the "Post Selection" option. See Screenshot.

From here you can select the parent and it will allow you to display the parent information of that void.

The main issue now is that you will have duplicate housing developments in your listing view because the Housing development can have many voids.

Please let me know if this helps.
Thanks
Shane

#1380091

Hi Shane,

Thanks for your message, and apologies for the late reply. So, the above will give me a list of Developments which have Voids, but I want to initially display all Developments, including those without Voids, and then when a user narrows the search, filter this view to show only Developments with Voids. Is it possible to add a filter in the Search and Pagination section which would allow me to, for example, add a checkbox which, when checked, filters the view so that only Developments with Voids are displayed?