Filtering page list by multiple select page attribute

Permalink
I've added code to the page list controller to filter a page list by a page attribute called 'sector'.

The 'sector' page attribute is set as a select box with the ability for users to select multiple options. Right now, the filter works fine if only one option has been chosen for pages:

// Filter by Sector
$sector = $_GET['sector'];
if($sector != 'none') {
    $pl->filterByAttribute('sector', "\n".$sector."\n");
}


However, if a filter is run, any pages with more than one option set on it's 'sector' attribute won't show up. Even if one of it's values is a match.

Is there anything I can change to $pl->filterByAttriubute() to make this work?

 
MrKDilkington replied on at Permalink Reply
MrKDilkington
I am also interested in how to filter page lists with multiple attributes (including and/or).
zuna replied on at Permalink Reply
I think filterBySelectAttribute can have an array of options
Kurtopsy replied on at Permalink Reply
Kurtopsy
This is the gist of what I used to filter attributes in Page List +. Maybe you can find something useful in there.http://jsfiddle.net/67t2n6qp/1/...