Jump to content

Find pages where at least one repeater item has a value


dps123
 Share

Recommended Posts

I have a small issue with my $pages->find query. My pages have a repeater field that is a checkbox. I'm trying to sort the results so that I get pages where at least one of the repeaters has the checkbox field checked.

What I'm doing currently is:

$my_pages = $pages->find("sort=-my_repeater.my_checkbox_field");

So I'm sorting high to low, i.e. checked before not checked. The issue is that it only appears to take into account the checked status of the first repeater item. If the second, third etc is checked, the page is not appearing at the top of the results.

I'm guessing there must be an easy way to check all items in the repeater?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...