Using facets and the FilterControl
Facets are distinct characteristics of items that you can use for grouping. Items can have multiple facets, but they can only have one distinct value for each facet. Examples of facets are Dimensions (size of an image), File Type, or Language.
You use the FilterControl control to show facets. Users can select and/or clear facets, and the search updates immediately:
You must create the facets you want to present to the users first. Use the Facet item template to create an item for each facet and place these facet items in a child folder under the PageSettings item.
The template has these fields:
|
Field |
Description |
|---|---|
|
FieldName |
Specify the name of a field that Sitecore uses to create facets. Note Do not specify a field where items can have many different values because then Sitecore has to create many facets, which degrades performance. |
|
FacetProviderType |
Specify a .Net class that provides the facet behavior. For example: |
When you have created the facet items, add a FilterControl control to the page. Bind the Facets property of this FilterControl control to the Facets property of the data source.
Set the FacetsRootItemId property of the data source to the item ID of the folder where you have created the facet items, and bind the SelectedFacets property of the data source to the SelectedFacets property of the FilterControl control.
