presseddigital / searchit

Configure powerful custom filters for an enhanced search experience in the Craft CMS control panel.
Other
28 stars 9 forks source link

Chaining Filters #17

Open harrymee123 opened 5 years ago

harrymee123 commented 5 years ago

Hi There,

Is it possible to chain the search string filters?

I have three filters:

{% for entry in craft.entries.section('entries').all() %}
    {{ ({
        filter: {
            relatedTo: {
                element: entry.id,
                field: 'entries'
            }
        },
        label: entry.title
    })|json_encode() }}{{ not loop.last ? ',' }}
{% endfor %}
{% for category in craft.categories.group('categories').all() %}
    {{ ({
        filter: {
            relatedTo: {
                element: category.id,
                field: 'categories'
            }
        },
        label: category.title
    })|json_encode() }}{{ not loop.last ? ',' }}
{% endfor %}
{ "filter":"term1", "label":"Term 1" },
{ "filter":"term2", "label":"Term 2" },

Independently, they all work great. However, I get errors when using the first two filters together. The first one does seem to work with the third one. I tried swapping out the category one for another search term filter. When applying all three, only the first two seem to work.

Is it possible?

zizther commented 4 years ago

Would be great to have the ability to chain filters

Mactory commented 2 years ago

+1