Possible to filterBy selected multiselect options?

Good day everyone,

Wondering if it’s possible to filterBy a multiselect field. I am trying to create a page for each multiselect option and then only show pages which have that option selected, so the page slug in this case would be a sport’s name. Here is my code which I was hoping would work:

$all_pages = page('all_sports')->children()->listed(); 
$filtered_sports = $all_pages->filterBy('multiselect', $page->slug(), ',');

Thank you :slight_smile:

That code should work, but it depends on what is actually stored in your multiselect field. Really only the page slug or the ID?

And is multiselect really the name of the field?

You the real MVP.

The name of the filterBy was the issue, but once corrected it is working correctly. Thanks for your help :slight_smile: