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 separately, for example search suggestions, products and categories. 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 a separate <ws-suggest-result> instance is used as a child element of <ws-suggest>, for example for product and category.
Attributes

Multiple content sources

The separated display of individual content sources requires websale_search_webcomponents v1.7.0. In the backend, elasticsearch_manager v1.15.0 and websale_search v1.18.0 are additionally required.
If several content sources are configured in the search module, you can output their suggestions separately. The name after the underscore corresponds to the name of the source in the configuration.
For a source to deliver suggestions, it must additionally be enabled in the suggest_config of the search module. Sources without an entry only appear in the search results, not in the suggest list.
The previous usage with source="content" for a single content configuration continues to work unchanged.

show-all: Simple text replacement

With the other source types such as query or product, Mustache is used. This is 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, namely 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>. Typical use cases are 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
With multiple content sources, the value follows the same pattern and contains the name of the source, for example hide-with="ws-search-result-content_blog".

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