coveo facet value caption
Hello - we are currently trying to use the valueCaption for facets and couldnt get it to work. This is the script we are running and not sure whats wrong.
We tried different names from the facets and not seems to work. Can you provide a complete example value caption? Where can we get the Facet id for the caption?
By default, Coveo for Sitecore doesn't generate the id attribute for the standard facet component. It is however generated for the slider and range facets.
You can easily add it by adding this attribute in the
id="<%= Model.UniqueId %>"
Or this attribute in the
Be warned that any upgrade of the Coveo for Sitecore product will replace those files and you will lose your changes. It is recommended to modify a copy of those files and create new layouts/renderings in Sitecore that uses your modified files.
For your example code, I see that you don't use the
CoveoForSitecore.componentsOptions variable while initializing your JS UI. It is very important to use it as it contains all the initialization parameters configured inside Sitecore. You should follow the instructions to set custom initialization options: https://developers.coveo.com/display/SC201502/Setting+Custom+Initialization+Options
You also initialize your search page with the 'coveo' jQuery plugin function instead of the
coveoForSitecore jQuery plugin function. You should use the
coveoForSitecore function inside Sitecore.
You should also always use
Coveo.$ to use jQuery in a Coveo for Sitecore layout/view as
$ can conflict with the prototypeJS library used by Sitecore themselves.
Your code should look like this to set the valueCaption for all the facets on your search page: