jacksleight / statamic-distill
Filter, fetch or index the values, sets and relations in your entries, however deeply they're nested.
Fund package maintenance!
Requires
- statamic/cms: ^5.0|^6.0
Requires (Dev)
- laravel/pint: ^1.21
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^10.0
- pestphp/pest: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-02 10:21:42 UTC
README
Distill
This Statamic addon allows you to filter, fetch or index the individual values, sets and relations within your entries, from both root and deeply nested fields. It's useful for things like:
- Extracting the text from every Bard field within a replicator
- Finding every asset in the page, or just the first image
- Filtering, sorting and paginating a Grid field or raw array just like a collection
- Adding individual sections of a page to a search index
- Refactoring nested data and sets
Examples
Here are a few examples of what's possible. For more information and more examples check the documentation.
Find every image in the page
{{ distill:page type="asset:*" is_image:is="true" unique="true" }}
<img src="{{ url }}" alt="{{ alt }}">
{{ /distill:page }}
Extract all Bard text from a page builder
{{ { distill:bard from="builder" } | bard_text }}
Filter, sort and paginate a Grid field
{{ distill:parts_list depth="1" paginate="10" :category:is="get:category" :sort="get:sort" }}
{{ items }}
{{ name }} {{ price }}
{{ /items }}
{{ paginate }}
<a href="{{ prev_page }}">←</a>
<a href="{{ next_page }}">→</a>
{{ /paginate }}
{{ /distill:parts_list }}
Find every video set in an entry
use JackSleight\StatamicDistill\Facades\Distill; $videos = Distill::query($entry) ->type('set:video') ->where('url', 'like', '%youtube.com%') ->get();
Documentation
Statamic Distill Documentation
Sponsoring
This addon is completely free to use. However fixing bugs, adding features and helping users takes time and effort. If you find this addon useful and would like to support its development any contribution would be greatly appreciated. Thanks! 🙂