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

Add support for entries fields #27

Open
afonic opened this issue Apr 19, 2024 · 4 comments
Open

Add support for entries fields #27

afonic opened this issue Apr 19, 2024 · 4 comments

Comments

@afonic
Copy link
Contributor

afonic commented Apr 19, 2024

Right now if you want to filter a collection by an entries field, there are no filter options loaded.

You can populate the options manually like so:

{{ collection:pillows as="items" }}
{{? $pillows = $items->flatMap(fn ($item) => [$item->id() => $item->title])->all(); ?}}
{{ /collection:pillows }}
{{ livewire:lf-select-filter
    blueprint="rooms.rooms"
    condition="query_scope"
    modifier="multiselect"
    field="pillows"
    options="{{ $pillows }}"
}}

To close this:

  • Load all the entries of any Collections that are assigned to the field if present.
  • Handle Collections that have no title field.
@afonic afonic converted this from a draft issue Apr 19, 2024
@afonic afonic changed the title Add support for entries"fields Add support for entries fields Apr 19, 2024
@afonic afonic closed this as completed Apr 20, 2024
@github-project-automation github-project-automation bot moved this from In progress to Done in Statamic Livewire Filters Roadmap Apr 20, 2024
@afonic afonic reopened this Apr 20, 2024
@j3ll3yfi5h
Copy link

Please add support for the entries fieldtype 🙏

@afonic
Copy link
Contributor Author

afonic commented Jun 3, 2024

It's coming soon!

@afonic
Copy link
Contributor Author

afonic commented Jun 3, 2024

@j3ll3yfi5h I also added the code example above in case you need it asap.

@j3ll3yfi5h
Copy link

@afonic thank you 🙇🏼

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

No branches or pull requests

2 participants