atomic-category-facet
atomic-category-facet
This is for:
DeveloperA facet is a list of values for a certain field occurring in the results, ordered using a configurable criteria (e.g., number of occurrences).
An atomic-category-facet
displays a facet of values in a browsable, hierarchical fashion.
Introduction
A facet allows users to drill down inside a result set by filtering the result to certain field values. Category Facets are browsable facets that display values in a hierarchical fashion, narrowing the available options through offering alternative starting points and sub-categories.
The Category Facet is especially useful when making fundamental decisions on a starting point in a search or browsing session. For example, if the starting point was Clothing, available options to choose from might include t-shirts, sweaters, brands, sales, new arrivals, etc. Each one of those options would then offer a new list of surrogate categories.
Best Practices
Usage Notes
-
A Category Facet requires a multi-value field whose values are formatted hierarchically. The facet will determine the filter to apply based on the current selected path of values. This can offer a powerful navigational experience, quickly leading a user to relevant results.
This component uses
;
to separate individual values, and the character that’s defined with thedelimiting-character
attribute to separate hierarchical levels within each value. We recommend setting this attribute to|
instead of using the default, which is;
. The following is an example of the recommended hierarchical formatting:clothing; clothing|sale; clothing|sale|shoes; clothing|sale|shoes|kids; clothing|sale|shoes|kids|sneakers;
-
It’s only possible to select one value at a time in a category facet. This is because they’re meant to ease navigation through their hierarchically organized content, as opposed to applying multiple hierarchical filters.
Guidelines
It’s best practice to have hierarchies at five levels or less in depth.
Use Cases and Examples
On an ecommerce website, a user may want to start browsing by the category Men, and then narrow their results to Bottoms, then further to Pants, etc. Instead of selecting the facet value directly, this allows them to navigate hierarchically and determine the right starting point.
Properties
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
|
|
The base path shared by all values for the facet. Specify the property as an array using a JSON string representation:
|
|
|
|
|
The character that separates values of a multi-value field. Note: If you use the example formatting for the associated multi-value field, you must set this value to |
|
|
|
The required facets and values for this facet to be displayed. Examples:
|
|
|
|
|
|
Specifies a unique identifier for the facet. |
|
|
|
|
The field whose values you want to display in the facet. |
|
|
|
|
Whether to use basePath as a filter for the results. |
|
|
|
|
Whether to exclude the parents of folded results when estimating the result count for each facet value. |
|
|
|
|
The heading level to use for the heading over the facet, from 1 to 6. |
|
|
|
|
The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
Note: A high injectionDepth may negatively impact the facet request performance.
Minimum: |
|
|
|
|
Specifies whether the facet is collapsed. When the facet is the child of an |
|
|
|
|
The non-localized label for the facet.
Used in the |
|
|
|
|
The number of values to request for this facet. Also determines the number of additional values to request each time more values are shown. |
|
|
|
|
The sort criterion to apply to the returned facet values. Possible values are 'alphanumeric' and 'occurrences'. For this criterion to apply to the top-layer facet values, disable facet value ordering in your Dynamic Navigation Experience configuration. |
|
|
|
|
The tabs on which this facet must not be displayed. This property should not be used at the same time as Set this property as a stringified JSON array, e.g.,
If you don’t set this property, the facet can be displayed on any tab. Otherwise, the facet won’t be displayed on any of the specified tabs. |
|
|
|
|
The tabs on which the facet can be displayed. This property should not be used at the same time as Set this property as a stringified JSON array, e.g.,
If you don’t set this property, the facet can be displayed on any tab. Otherwise, the facet can only be displayed on the specified tabs. |
|
|
|
|
Whether this facet should contain a search box. |
|
|
Shadow Parts
Part | Description |
---|---|
|
The clickable active parent displayed first within the last sub-parents. |
|
The "View all" button displayed first within the parents. |
|
The back arrow displayed before the clickable parents. |
|
The wrapper for the entire facet. |
|
The button that displays the label and allows to expand/collapse the facet. |
|
The label button icon. |
|
A facet value with no child value. |
|
The highlighted query inside the matches labels. |
|
The label indicating there are more matches for the current facet search query. |
|
The label indicating there are no matches for the current facet search query. |
|
A facet value with child values. |
|
The clickable parent button displayed first within sub-parents. |
|
The container surrounding the whole hierarchy of values. |
|
The placeholder shown before the first search is executed. |
|
The button to clear the search box of input. |
|
The highlighted query inside the facet values. |
|
The search box submit button. |
|
The search box input. |
|
The search result value. |
|
The search result path. |
|
The search results container. |
|
The search box wrapper. |
|
The show less results button. |
|
The show more results button. |
|
The icons of the show more & show less buttons. |
|
The container surrounding a sub-hierarchy of values. |
|
The facet value count within a value button. |
|
The facet value label within a value button. |
|
The clickable value displayed first within values. |
|
The container surrounding either the children of the active value or the values at the base. |
CSS Custom Content
Name | Description |
---|---|
|
The size of the facet search clear icon. |
|
The size of the facet search icon. |