heimrichhannot/contao-no-ui-slider-bundle

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

1.0.2 2024-05-21 14:47 UTC

This package is auto-updated.

Last update: 2024-10-21 15:45:41 UTC


README

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

Features

  • Filter Bundle support
  • Encore Contracts support

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 is dispatched in this situation. Use this event to initiate the async submit.