<ws-suggest-result> component is a child element of <ws-suggest> and lets you configure and display several result types (for example search suggestions, products, categories) separately. As soon as at least one <ws-suggest-result> is present, Orchestrator Mode is activated automatically in <ws-suggest>.
Component
Results are grouped per type – for each type (for exampleproduct, category), a separate <ws-suggest-result> instance is used as a child element of <ws-suggest>.
show-all: Simple text replacement
With the othersource types (for example query, product), Mustache is used – a template system that replaces placeholders such as {%result.value%} with actual values from the API response and can also process logic such as loops or conditions.
For source="show-all", this is not necessary since there is only one dynamic value: the current search term. Instead, a simple text replacement is used – {%query%} is directly replaced with the entered search term.
Important: The only working placeholder is
{%query%}. Other Mustache placeholders such as {%result.value%} are not evaluated here and appear unchanged in the HTML.hide-with
Thehide-with attribute can be set on any element to hide it depending on a <ws-suggest-result> or <ws-search-result> – for example tab buttons or headings that should only be visible when the associated result area has content.
Syntax: hide-with="ws-search-result-<source>" or hide-with="ws-suggest-result-<source>"
hide-with is currently only available for ws-suggest-result and ws-search-result.total-container
Thetotal-container attribute (or the CSS class of the same name) enables the display of search result metadata in the frontend. There are two usage modes:
Example
sort-order
Overrides the backend sorting for the element on which it is set. Intended primarily for<ws-suggest-result>, to sort displayed suggestions by a field.
Syntax: <field-name>_<direction>
Explanation
Example
