Gravatar for slangevin@coveo.com

Question by Simon, Aug 13, 2018 5:32 PM

Modify the no result message using Coveo for Sitecore Hive

Curious if there is an easy way to modify the no results message using Coveo for Sitecore Hive.

If possible without affecting the out of the box components.

1 Reply
Gravatar for amoreau@coveo.com

Answer by amoreau, Aug 13, 2018 5:46 PM

It depends on what you mean by easy, but it is possible to use the `coveo-show-if-no-results` CSS class to show specific messages only when there are no returned results: https://docs.coveo.com/en/1387/javascript-search-framework/displaying-components-only-when-there-are-no-results

You can then disable the QuerySummary component to remove the default no result message (see https://coveo.github.io/search-ui/components/querysummary.html ).

Know that we are currently working on simplifying this process, which should be in an upcoming release of the Coveo JavaScript Search Framework ( https://github.com/coveo/search-ui/commit/500b24de0b28e1e8536fd944a8a4c8e60a8605a4 ).

Hope this helps!

-Alex

Gravatar for slangevin@coveo.com

Comment by Simon, Aug 13, 2018 6:11 PM

So just to add a bit of details for Hive. The QuerySummary component is available in Hive but the default result message is not available in the properties. Hence the current way to change the no result message would be to use the dataset attribute of the component such as explained in this post : https://answers.coveo.com/questions/16663/coveo-init-calls-for-facets-or-other-components-in.html

Ask a question