searchit icon indicating copy to clipboard operation
searchit copied to clipboard

Multiple filters

Open Hyra opened this issue 7 years ago • 1 comments

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?

Hyra avatar Nov 23 '18 10:11 Hyra

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.

samhibberd avatar Dec 03 '18 14:12 samhibberd