Single Select
The “Single Select” filter rule (package filter_select) outputs a frontend widget
through which visitors can select a single value from a selection list. Items are filtered
by the selected value of an attribute. This filter rule is typically combined with the
Single Select (select) attribute type to make a
1:n relation filterable in the frontend.
Alternatively, the templates mm_filteritem_radiobutton.html5 (radio buttons) and
mm_filteritem_linklist.html5 (link list) are available.
Installation
The filter rule is installed via the Contao Manager or Composer:
composer require metamodels/filter_select
Settings when Creating the Filter Rule
Setting |
Description |
|---|---|
Type |
Selection of the filter rule type — here: “Single Select”. |
Enabled |
Enables or disables this filter rule. |
Comment |
Free text field for describing the purpose of this filter rule. |
Attribute |
The attribute by whose value items should be filtered. |
Label attribute |
Optional attribute whose value is used as the display text for the options in the widget (e.g. a name or title attribute). |
Settings for the Frontend Widget
Setting |
Description |
|---|---|
URL parameter |
The key of the URL parameter for passing the filter value. Without input,
the column name of the attribute is used. With |
URL type for the parameter |
Defines whether the parameter is passed as a slug (friendly URL) or as a GET parameter (from MM 2.4) — see SEO |
Label |
Label of the filter widget. |
Hide label at filter widget |
Suppresses the output of the label. |
Use the label as empty option |
The label is used as the first empty option (instead of an empty row). |
Template |
Template for the widget output. Default: |
Sorting |
Sorting of the selection options in the widget (ascending or descending). |
Default |
Pre-selected value in the frontend widget. |
Allow empty selection |
Adds an empty option (“All”) to the selection list. |
Only assigned values |
Shows only values in the widget that are actually assigned in at least one item of the MetaModel. |
Only remaining values |
Shows only values for which results still exist after applying the other active filters (dynamic filter options). |
Ignore this filter for remaining values |
This filter does not return its own options as a restriction when calculating remaining values. |
CSS ID/class |
Sets a CSS ID or class on the widget element. |
Matching Attributes
The “Single Select” filter rule is particularly suitable for:
Special Functions
Radio buttons and link lists
Via the template selection, the widget can be output as a radio button list
(mm_filteritem_radiobutton) or as a link list (mm_filteritem_linklist).
Link lists are particularly suitable for SEO-optimized navigation without form
submission.