Search component written in HTL.
The Search component uses the com.adobe.cq.wcm.core.components.models.Search
Sling model as its Use-object.
When the user is scrolling down the results, if the hidden results below are less than the visible results, more results are fetched.
The following configuration properties are used:
./searchRoot
- the root page from which to search. It can be a blueprint master, language master or regular page../resultsSize
- the maximal number of results fetched by a search request./searchTermMinimumLength
- the minimum required length of the search term before results are fetched
The following properties are written to JCR for the Search component and are expected to be available as Resource
properties:
./searchRoot
- the root page from which to search. It can be a blueprint master, language master or regular page../id
- defines the component HTML ID attribute.
The component provides a core.wcm.components.search.v1
client library category that contains a recommended base
CSS styling and JavaScript component. It should be added to a relevant site client library using the embed
property.
BLOCK cmp-search
ELEMENT cmp-search__form
ELEMENT cmp-search__field
ELEMENT cmp-search__icon
ELEMENT cmp-search__input
ELEMENT cmp-search__loading-indicator
ELEMENT cmp-search__clear
ELEMENT cmp-search__clear-icon
ELEMENT cmp-search__results
ELEMENT cmp-search__item
ELEMENT cmp-search__item-mark
ELEMENT cmp-search__item-title
MOD cmp-search__item--is-focused
Apply a data-cmp-is="search"
attribute to the wrapper block to enable initialization of the JavaScript component.
The following attributes can be added to the same element to provide options:
data-cmp-min-length
- populated withsearchTermMinimumLength
from the component's policy configurationdata-cmp-results-size
- populated withresultsSize
from the component's policy configuration
A hook attribute from the following should be added to the corresponding element so that the JavaScript is able to target it:
data-cmp-hook-search="form"
data-cmp-hook-search="icon"
data-cmp-hook-search="loadingIndicator"
data-cmp-hook-search="input"
data-cmp-hook-search="clear"
data-cmp-hook-search="results"
data-cmp-hook-search="itemTemplate"
data-cmp-hook-search="item"
data-cmp-hook-search="itemTitle"
- Vendor: Adobe
- Version: v1
- Compatibility: AEM 6.3
- Status: production-ready
- Documentation: https://www.adobe.com/go/aem_cmp_search_v1