Create a Facet
A facet allows to filter, load, sort or reset content. A facet is always attached to a grid (or template) because a page/post can contains several grids (or templates).
In this guide, we will show you the main steps to create a facet filter.
At first you need to select which kind of action your facet will apply on your grid:
- Filter content from Taxonomy terms, WordPress fields or custom fields
- Load content with a pagination or load more button
- Sort content from WordPress fields or custom fields
- Reset content depending of facets if needed
Facet settings – Facet action
If you set filter as facet action, you need to set the data source of your filter. It means that you need to set which kind of data from WordPress will be used to filter your grid content. You can filter by:
- Taxonomy terms
- WordPress field
- Custom field
Facet settings – Data source
You will also be able to set the number of choices diplayed in your facet thanks to Choices Number settings. Depending of the filter type, you will be able to limit the number of choices displayed on load thanks to Limit Choices Number option. If Limit Choices Number is inferior to the Choices Number then a toggle button will be displayed at the bottom of the facet to show more choices on click.
Facet settings – Choices number
All other facet settings have descriptions in the admin interface and are self explanatory. Each facet action and filter has its own settings.
In order to efficiently filter content, each facet are indexed in an custom index table. It means, that everytime you create a facet, the plugin automatically queries and stores all facet values according to your facet settings. This process is called indexing and simply allows to “prefetch” results and to store them in a simple and indexed table.
Sometime, you may need to manually re-index your facets. You can re-index each facet independently in facet settings page or in facets overview page:
Facet settings – Re-index
Facets overview – Re-index