heimrichhannot/contao-no-ui-slider-bundle

Extension for heimrichhannot/contao-filter-bundle that extends choice field with range appearance

0.2.0 2020-11-06 08:41 UTC

This package is auto-updated.

Last update: 2021-01-06 08:56:52 UTC


README

This bundle offers support for the JavaScript library noUiSlider for the Contao CMS.

Setup

  1. Install via composer: composer require heimrichhannot/contao-no-ui-slider-bundle.
  2. Update Database.

Configuration

Activate NoUiSlider for a "choice filter"

  1. Create a choice field as usual in heimrichhannot/contao-filter-bundle.
  2. Activate the option "Add noUiSlider support".

Activate NoUiSlider for a "multiple range filter"

  1. Create 2 text filter elements which represent the two borders of the filter interval. It's important that the filter element type is text.
  2. Create a multiple range filter element and link the text filters created in the step before.
  3. Activate the option "Add noUiSlider support".

Developers

When you change the set value of the slider it matches the current value to the corresponding input field. To set the slider to its min value means that all input fields are unchecked. In that case no change or click event is triggered. Therefore the custom event filterAsyncSubmit ist dispatched in this situation. Use this event to initiate the async submit.

Assets

Bundle assets are provided as yarn package. Sources and JavaScript documentation can be found in src/Resources/npm-package.