SUMMER SALE 2020!

30% OFF with coupon SUM30

Create a Facet

IntroductionIntroduction

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.

Set up facet actionSet up facet action

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
Set up a facet action
Facet settings – Facet action

Set up filter facet Set up filter facet

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
Set up facet data source
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.

Set up number of choices
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.

Index facetIndex facet

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:

Re-index a facet
Facet settings – Re-index
Re-index all facets
Facets overview – Re-index

At any time, you can also stop the indexer or clear the index table in order to start re-indexing your facets if any issue occured. You will find, in Global Settings > General, buttons to stop the indexer and to clear the inde table:

Global settings - Indexer
Global settings – Indexer