searchit
searchit copied to clipboard
Multiple filters
Heya,
Is it at all possible to have multiple criteria in the filter?
At the moment i have a Structure called program, which i can then filter with :
{% for program in craft.entries.section('program').level(1).all() %}
{{ ({
filter: {
descendantOf: program.id
},
label: program.title
})|json_encode() }}{{ not loop.last ? ',' }}
{% endfor %}
Which works fine as it shows all children of the Program. But it would be nice if it can show the parent itself as well, so either with an OR or an array of criteria.
Is this an option i can't figure out?
Could you explain what you are trying to achieve in a little more detail, the filter param can achieve anything that you can with a Craft element query for the element type that you are working with. So you can specify multiple criteria, but you can run multiple queries.