Download the PHP package fruitstudios/searchit without Composer
On this page you can find all versions of the php package fruitstudios/searchit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fruitstudios/searchit
More information about fruitstudios/searchit
Files in fruitstudios/searchit
Package searchit
Short Description Configure powerful custom filters for an enhanced search experience in the Craft CMS control panel.
License proprietary
Informations about the package searchit
Searchit plugin for Craft CMS 3
Configure powerful custom filters for an enhanced search experience in the Craft CMS control panel. Harness the power of twig and element queries to create endless filtering options. Keep your clients happy!
See it in action...
Requirements
This plugin requires Craft CMS 3.1.2 or later.
Installation
Plugin Store
Log into your control panel, hit up the 'Plugin Store', search for this plugin and install.
Composer
Open terminal, go to your Craft project folder and use composer to load this plugin. Once loaded you can install via the Craft Control Panel, go to Settings → Plugins, locate the plugin and hit “Install”.
Creating a filter
Filters can be produced manually or dynamically and are made up of a JSON array containing rows with a label key (string)
and a filter key (string or valid JSON)
. If the filter contains a string
then it will pass that value to the search
parameter on the element search. If you pass JSON to the filter than you can create multiple query parameters.
Creating a filter
Ordering and preview
You have two ways to setup filters. Manually or dynamically.
Using Twig (Recommended)
You can use the power of twig templating to create your filters. For example, if you want a filter entries by authors, then you can use the following...
This essentially creates an element query like so...
Using JSON
Create a valid JSON array to build a filter
As the filter value is passing a string, this is essentially creating an element query like so...
As an include
If you prefer to keep your code in your templates/repo, then you can link directly to templates.
Example usage
Here are a few examples of different filters for different elements. The possibilities are endless!
Entries
Create filters for authors, date, categories, etc..
Example: Filter by author...
How to get this filter...
Categories
Create filters to narrow down categories by heirarchy.
Example: Filter by top level category...
How to get this filter...
Assets
Create filters for file types, extensions etc.
Example: Filter file type and extensions...
How to get these filters...
Kind filter
Extension filter
Roadmap
Support for Commerce coming very soon
Useful Resources
Craft CMS Search Documentation Docs
As with the regular Craft Search, if you suspect that your search indexes don’t have the latest and greatest data, you can have Craft rebuild them with the Rebuild Search Indexes tool in Settings. Docs
Brought to you by FRUIT