Facets Range Input

Facets Range Input adds a Range Input widget and processor to the Facets module. Instead of a list of facet links, visitors get a small form with a minimum and a maximum field, so they can filter search results on a numeric range, for example a price, a rating, a year or a size.

Features

  • A minimum and maximum field with an Apply button, for any numeric field (integer or decimal) in a Search API index.
  • Decimal and negative values, for example a rating from 7 to 8.5.
  • The range is added to the URL like other facets, for example ?f[0]=price:(min:10,max:50), so filtered pages can be shared and bookmarked.
  • The range is checked in the browser before the page changes. Without JavaScript, the form validates and redirects on the server.
  • Works with AJAX views on Facets 2.x: the view refreshes without a page reload.
  • The active range shows once in the Facets summary, for example "7 - 8.5", with a link that removes it. Facet breadcrumbs show it the same way.
  • Configurable labels and placeholders for both fields, and support for the "Show title of facet" setting.

Requirements

  • Drupal 10.1 or higher, or Drupal 11.
  • Facets 2.x or 3.x.
  • A facet on a numeric field of a Search API index.

Getting started

  1. Install the module like any other contributed module.
  2. Create a facet for a numeric field, or edit an existing one.
  3. Select the Range Input widget, and enable the Range Input processor under "Facet settings". The widget does not work without the processor.
  4. Save the facet and place its block.

See the README for more details. It is also shown on the module's help page in your site.

Known limitations

  • Facets 3 views exposed filters are not supported, only facet blocks. For exposed filters, use the "Exposed range slider" processor of Facets Exposed Filters, which is part of Facets 3.
  • Drupal 12 support depends on Facets: its widget and processor plugins need PHP attribute support first.

Similar modules

  • Facets Range Widget (part of Facets) provides "Range slider" and "Slider" widgets. Use those if you prefer a slider over typing exact values.
  • Facets Exposed Filters (part of Facets 3) has an "Exposed range slider" for views exposed filters.

Issues and contributions

Bug reports, feature requests and merge requests are welcome in the issue queue.

Supporting organizations: 
Module improvements & maintenance
Module improvements & maintenance
Used in main D8 Site.
Maintenance

Project information

Releases