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

[Panel] using query with filterBy() doesn't work with array #1479

Closed
texnixe opened this issue Feb 12, 2019 · 4 comments
Closed

[Panel] using query with filterBy() doesn't work with array #1479

texnixe opened this issue Feb 12, 2019 · 4 comments
Assignees
Labels
type: enhancement ✨ Suggests an enhancement; improves Kirby
Milestone

Comments

@texnixe
Copy link
Member

texnixe commented Feb 12, 2019

Describe the bug

I'd expect a query in a pages field like this to work:

    fields:
      references:
        label: References
        type: pages
        multiple: true
        query: site.index.filterBy('template', 'in', ['note', 'album'])

But this throws the error

"in_array() expects parameter 2 to be array, string given"

Tested with Kirby 3.0.1

@bastianallgeier
Copy link
Member

bastianallgeier commented Feb 18, 2019

Our query language does not support arrays yet. I think it would be good to convert this to an idea ticket to implement arrays. I'm not sure how complex this would end up though.

@bastianallgeier bastianallgeier added the needs: discussion 🗣 Requires further discussion to proceed label Feb 18, 2019
@distantnative
Copy link
Member

@bastianallgeier I actually would leave it here. For us this seems like a feature idea. But I think most developers/users won't directly understand why this should not be possible right now - so rather see it as a bug.

@distantnative distantnative added this to the 3.2.0 milestone Mar 17, 2019
@neildaniels
Copy link
Contributor

I would love array support in the query language, in particular for the case of filtering by templates. Either as the way described above with filterBy() or with the template() function.

@distantnative distantnative self-assigned this Apr 16, 2019
@distantnative distantnative added status: in progress 🔁 type: enhancement ✨ Suggests an enhancement; improves Kirby and removed needs: discussion 🗣 Requires further discussion to proceed labels Apr 16, 2019
@bastianallgeier
Copy link
Member

Our regex wizard @distantnative made it possible 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement ✨ Suggests an enhancement; improves Kirby
Projects
None yet
Development

No branches or pull requests

4 participants