Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chaining Filters #17

Open
harrymee123 opened this issue Aug 14, 2019 · 2 comments
Open

Chaining Filters #17

harrymee123 opened this issue Aug 14, 2019 · 2 comments

Comments

@harrymee123
Copy link

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
Copy link

zizther commented Dec 10, 2019

Would be great to have the ability to chain filters

@Mactory
Copy link

Mactory commented May 24, 2022

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants