Skip to main content
The <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 example product, category), a separate <ws-suggest-result> instance is used as a child element of <ws-suggest>.
Attributes

show-all: Simple text replacement

With the other source 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.
Example

hide-with

hide-with is deprecated and is replaced from ws-search-component-1.9.1.js onwards by the visibility attribute. hide-with still works, but should no longer be used in newer projects.
The hide-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.
Example

total-container

The total-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