Skip to content

Facets ​

Search Web Components provides four facet widgets. Each widget has a component of the same name, placed as a block, a Canvas component, or from Twig.

The Widget list on a facet's edit form with the four Search Web Components widgets, Checkbox selected

WidgetElementWhat the visitor sees
Search Web Components: Buttonfacet-buttonOne button per option.
Search Web Components: Checkboxfacet-checkboxOne checkbox per option, or radios with Use radio inputs (useRadios).
Search Web Components: Dropdownfacet-dropdownThe browser's own select element, one option at a time.
Search Web Components: Dropdown HTMLfacet-dropdown-htmlA dropdown built from HTML that a theme can style, one option at a time, or several with Allow selecting multiple values (multipleSelect).

Hierarchy ​

With Use hierarchy on the facet, the Search Web Components: Checkbox and Search Web Components: Button widgets show child options under their parent.

  • With Always expand hierarchy on, the children show from the start.
  • With Always expand hierarchy off, a parent's children show once the parent or one of its children is applied.

One option at a time ​

Check Ensure that only one result can be displayed (showOnlyOneResult) on the facet to limit a visitor to one option at a time. Applying an option replaces the one already applied. Applying it again removes it. In a hierarchy, the option's parents and children stay applied.

URL alias ​

A facet's URL alias is its name in the page URL, e.g., category in f[category]=Desserts.

Where a setting comes from ​

The facet's settings travel with each response, and the component applies them. The component's own attributes apply only where the facet has no setting. With preferAttributes on, the component applies its attributes and ignores the facet's settings.

preferAttributes is:

  • Prefer attributes on the Canvas component.
  • Prefer attribute values configured here over facet configuration on a facet block with Remote/Other as its endpoint. With a site endpoint, the block has no attribute settings and the facet decides everything.
  • preferAttributes from Twig.

The facet settings, and the attribute each one wins over unless preferAttributes is on:

Facet settingAttribute
Show title of facetshowLabel
Ensure that only one result can be displayedshowOnlyOneResult
Show the amount of resultsshowCount
Show reset button in facetshowReset
Reset textresetText
Collapsiblecollapsible
Close collapsible facet by defaultclosed
Show applied options count in collapsible facet labelshowCountInCollapseLabel
Soft limit settings: Limit, Show less label, Show more labelsoftLimit, softLimitLessLabel, softLimitMoreLabel
Use radio inputsuseRadios
Select labelselectLabel on facet-dropdown, htmlSelectLabel on facet-dropdown-html
Requiredrequired
Allow selecting multiple valuesmultipleSelect

For what the response holds, see The response.