THIS IS ARCHIVED DOCUMENTATION

Prebinding Helpers List Reference

In this article

This page contains an extensive list of the prebinding methods used in Coveo for Sitecore Hive Framework.

fieldTranslator

Translates the given field according to the current context.

Example

The following line:

<div data-field="@myfield" data-prebind-field="fieldTranslator"></div>

Gives the following result:

<div data-field="@fmyfield2053" data-prebind-field="fieldTranslator"></div>

analyticsEnabled

Outputs true or false whether the analytics are enabled or not.

Example

The following line:

<div data-prebind-send-analytics="analyticsEnabled"></div>

Gives the following result:

<div data-send-analytics="true" data-prebind-send-analytics="analyticsEnabled"></div>

coveoForSitecoreAnalyticsEndpoint

If the value isn’t defined, assigns it a default endpoint value extracted from the context.

Important

An existing value won’t be overridden by this prebinding method.

Example

The following line:

<div data-prebind-endpoint="coveoForSitecoreAnalyticsEndpoint"></div>

Gives the following result:

<div data-endpoint="mysite/coveo/rest/analytics" data-prebind-endpoint="coveoForSitecoreAnalyticsEndpoint"></div>

currentPageName

If the value isn’t defined, assigns it the current page name value extracted from the context.

Important

An existing value won’t be overridden by this prebinding method.

Example

The following line:

<div data-prebind-page-name="currentPageName"></div>

Gives the following result:

<div data-page-name="mypage" data-prebind-page-name="currentPageName"></div>

isAnonymous

Outputs true or false whether the user is logged in or not.

Example

The following line:

<div data-prebind-anonymous="isAnonymous"></div>

Gives the following result:

<div data-anonymous="true" data-prebind-anonymous="isAnonymous"></div>

sortCriteria

Takes a JSON object representing a sort criteria and outputs the translated criteria.

Example

The following line:

<div data-sort='{ "type": "field", "direction": "ascending", "field": "myfield" }' data-prebind-sort="sortCriteria"></div>

Gives the following result:

<div data-sort='@fmyfield2053 ascending' data-prebind-sort="sortCriteria"></div>

You can add the sc-enable-direction-toggle="true" attribute to add a toggle for the sort criteria.

Example

The following line:

<div data-sort='{ "type": "field", "direction": "ascending", "field": "myfield" }' data-sc-enable-direction-toggle="true" data-prebind-sort="sortCriteria"></div>

Gives the following result:

<div data-sort='@fmyfield2053 ascending, @fmyfield2053 descending' data-prebind-sort="sortCriteria"></div>

unfoldDictionaryToAttributes

Takes a JSON dictionary as its original value and assigns an attribute for each of them with their value.

Example

The following line:

<div data-dictionary='{ "attribute": "value" }' data-prebind-dictionary="unfoldDictionaryToAttributes"></div>

Gives the following result:

<div data-attribute="value" data-dictionary='{ "attribute": "value" }' data-prebind-dictionary="unfoldDictionaryToAttributes"></div>