Livewire filters for Statamic collections.
OTHER License
Bot releases are hidden (Show)
LfTags
Livewire component so that it ignores parameters that don't contain the :
character and are probably not filter conditions.LfTags
component now ignores completely fields not in the fields
property. This approach is better as before it would display filtering you might have been doing using the tag but do not offer to the user to adjust.Published by afonic 6 months ago
IMPORTANT The URL for the documentation and examples is now https://livewirefilters.com
LfTags
component that allows you to display a "tags" or "pills" section of available tags. Read more.{{ pagination_total }}
variable that allows you to show the total number of entries when using pagination. Read more.'value' => 'label'
arrays is fixed. This feature is still undocumented.Published by afonic 6 months ago
Collection
tag to perform an action into the Entries
data. This version adds a hook called livewire-fetched-entries
for Livewire Filters.How to use
In your AppServiceProvider
you can register a hook like so:
\Reach\StatamicLivewireFilters\Http\Livewire\LivewireCollection::hook('livewire-fetched-entries',
function ($entries, $next) {
// The parameters of the component if you need them
$params = $this->params;
$entries->each(function ($entry) {
// Do something with the data here
});
return $next($entries);
}
);
For example you might call an API and attach extra data to the entries, or you might want to display some data only if a specific filter is active. The sky is the limit!
You need to be at least on Statamic v.4.50.0 to use this release, if you cannot upgrade at the moment you can stay at v1.6.0 of this addon.
Published by afonic 8 months ago
Please add this to your config file if you are upgrading from a previous version and wish to enable this feature.
// The addon will calculate the number of entries for each filter value (can be slow for a large number of entries)
'enable_filter_values_count' => true,
NEW allowed_filters parameter. You can now specify which filters are permissible, you can set a parameter that defines the allowed conditions. This is achieved by passing a pipe-separated list of permissible filters.
More info: https://slf.reach.gr/docs/v1/livewire-collection-tag#content-parameters
REMOVED The only_allow_active_filters
setting has been removed. Someone could just sniff the payload between the main LivewireCollection component and the filters and send the appropriate filiter-mounted event before sending the filter it wasn't offering that much protection anyway. If you were using it you need to migrate to the allowed_filters
parameter above.
Published by afonic 8 months ago
Please copy over your config again if you are upgrading from a previous version
This release adds new config options for the features that were added:
// If enabled the addon will preset the term parameters in any taxonomy term routes
'enable_term_routes' => false,
Published by afonic 9 months ago
any
modifier as it doesn't work with only_allow_active_filters.Published by afonic 9 months ago
step
option to the LfRangeFilterany
modifier usage in order to better adhere with Statamic's convention.Published by afonic 9 months ago
Please copy over your config again if you are upgrading from a previous version:
php artisan vendor:publish --tag statamic-livewire-filters-config
This release adds new config options for the features that were added previously:
only_allow_active_filters
: when enabled, the addon only allows filtering by filters and conditions that are loaded at the page. This improves data security as without it a user could perform any Statamic condition, whether you wanted to allow it or not. Defaults to true
. You might want to disable it if you are generating your filters dynamically or if you are lazy loading the filters and the active filters do not get registered.
validate_filter_values
: when using fields that have predefined options the addon would validate that the value the user wants to filter by, actually exists in the options array. Defaults to true
.
Published by afonic 9 months ago
LivewireCollection
component now registers the fields and conditions of the filters in the page and only allows filtering by them. This was added to prevent passing conditions that would reveal information you might not want, like Entries
that are unpublished.Published by afonic 9 months ago
Select
and Checkboxes
filters now validate that the option is in the available options array or fail.Published by afonic 9 months ago
entries-updated
event.Published by afonic 9 months ago
Published by afonic 9 months ago
Published by afonic 9 months ago
First release