Coveo Search Resources

Coveo for Sitecore Specific Rendering This rendering adds JavaScript and CSS references required to use the Coveo JavaScript Search Framework renderings and the Coveo for Sitecore-specific renderings.

This rendering generates a <div class="CoveoForSitecoreContext"> tag whose attribute values serve primarily to add Sitecore context information (e.g., current language, current database) to search queries and result templates.

Usage Notes

Coveo Search Resources is a mandatory rendering in any Coveo for Sitecore search interface, whether for a complete search page or in a content item layout header simply containing a Coveo Global Searchbox.

Insertion Location

The Coveo Search Resources rendering is an Allowed Control in the following placeholder(s): UI Resources

Example insertion sequence for the Coveo Search Resources rendering.

Coveo for Sitecore SXA rendering insertion locations are not limited by placeholder Allowed Controls. The Coveo Search Resources rendering may therefore be inserted throughout the partial design, whether in Coveo for Sitecore or Sitecore placeholders.

Example insertion sequence for the Coveo Search Resources rendering.

Data Source Options

Option name Description
Use local files for Coveo JavaScript Search Framework When selected, Coveo for Sitecore uses the Coveo JavaScript Search Framework files included in the downloaded package. When not selected, Coveo for Sitecore references the Coveo JavaScript Search Framework CDN files (see Understanding How Coveo for Sitecore Loads the Coveo JavaScript Files (CDN)).
CDN Version Used to select a specific version of the Coveo JavaScript Search Framework CDN files to use, overriding the default version of the Coveo JavaScript Search Framework the Coveo for Sitecore package was set to use. The CDN version must be in the major.minor format (e.g., 2.5549). Important : Coveo can’t guarantee your Coveo for Sitecore package works with a version of the Coveo JavaScript Search Framework that's different than the one your Coveo for Sitecore version was coded for and tested with.
Resources local path The path to the Coveo for Sitecore css, image, templates, init and Coveo JavaScript Search Framework local files js folders.
Coveo REST endpoint The path to the Coveo REST endpoint proxy.
Additional Dictionaries The additional dictionary folders in which Coveo for Sitecore clients have saved custom Dictionary entry items. Important : Do not store custom Dictionary entry items in the /sitecore/system/Dictionary/Coveo Hive folder as this folder is overwritten when upgrading Coveo for Sitecore (see Create a Dictionary for Your Custom Labels).
DOM unique Id Randomly generated HTML element id
Additional data attributes Allows use of component options not directly available in the data source (see Passing Non-Fronted JavaScript Framework Properties to Hive Components)

Sample Generated HTML

<link rel="stylesheet" href="https://static.cloud.coveo.com/searchui/v2.7968/css/CoveoFullSearch.css">
<link rel="stylesheet" href="/Coveo/Hive/css/CoveoForSitecore.css">
<script class="coveo-script" type="text/javascript" 
src="https://static.cloud.coveo.com/searchui/v2.7968/js/CoveoJsSearch.Lazy.min.js"></script>
<script class="coveo-for-sitecore-script" type="text/javascript" src="/Coveo/Hive/js/CoveoForSitecore.Lazy.min.js"></script>
<script type="text/javascript" src="/Coveo/Hive/js/cultures/en.js"></script>
...
<div id="coveo3a949f41" class="CoveoForSitecoreContext" data-sc-should-have-analytics-component="true" 
data-sc-analytics-enabled="true" data-sc-current-language="en" data-prebind-sc-language-field-name="fieldTranslator"
data-sc-language-field-name="z95xlanguage" data-sc-labels="{"Created" : "Created" , "Created by" : "Created by" ,
"Creation time." : "Creation time." , "Language" : "Language" , "Last time modified." : "Last time modified." , 
"Template" : "Template" , "Uniform resource identifier" : "URI" , "Updated by" : "Updated by" , 
"If the problem persists contact the administrator." : "If the problem persists contact the administrator." , 
"Search is currently unavailable" : "Oops! Something went wrong on the server."}" 
data-sc-maximum-age="900000" data-sc-page-name="Search-DistanceResource-DistanceRange-HTTPS" 
data-sc-page-name-full-path="/sitecore/content/Site4/Search-DistanceResource-DistanceRange-HTTPS"
data-sc-index-source-name="Coveo_web_index - mdes827aMar2020" data-sc-is-in-experience-editor="false" 
data-sc-is-user-anonymous="true" data-sc-item-uri="sitecore://web/{444B1C8C-0348-4440-8089-AD7C1C902D4F}?lang=en&amp;ver=2"
data-sc-item-id="444b1c8c-0348-4440-8089-ad7c1c902d4f" data-prebind-sc-latest-version-field-name="fieldTranslator"
data-sc-latest-version-field-name="z95xlatestversion" data-sc-rest-endpoint-uri="/coveo/rest" data-sc-site-name="website"
data-sc-field-prefix="f" data-sc-field-suffix="51395" data-sc-prefer-source-specific-fields="false" 
data-sc-external-fields="[{"fieldName":"permanentid","shouldEscape":false}]" 
data-sc-source-specific-fields="[{"fieldName":"attachmentparentid"},{"fieldName":"author"},
{"fieldName":"clickableuri"},{"fieldName":"collection"},{"fieldName":"concepts"},{"fieldName":"date"},
{"fieldName":"filetype"},{"fieldName":"indexeddate"},{"fieldName":"isattachment"},{"fieldName":"language"},
{"fieldName":"printableuri"},{"fieldName":"rowid"},{"fieldName":"size"},{"fieldName":"title"},
{"fieldName":"topparent"},{"fieldName":"topparentid"},{"fieldName":"transactionid"},{"fieldName":"uri"},
{"fieldName":"urihash"}]" 
data-applied-prebind="true">
</div>
Recommended Articles