Coveo Results Preferences

Warning
Legacy feature

This article pertains to the Coveo Hive framework which is now in maintenance mode.

Choose one of Coveo’s more modern, lightweight, and responsive libraries for any future search interface development. See the search interface Implementation guide for more details.

Implements the Coveo JavaScript Search Framework ResultsPreferences component which allows website visitors to specify search result related preferences when selecting the Preferences option in the Settings popup menu (see Coveo Preferences Panel).

Usage notes

  • Result preferences are saved in the browser local storage.

Insertion location

Coveo Hive

The Coveo Results Preferences rendering is an Allowed Control in the following placeholder(s): Preferences Panel

Example insertion sequence for the Coveo Results Preferences rendering.

Coveo Hive SXA

When you add the Coveo Preferences Panel SXA rendering, this adds a Preferences Panel placeholder, accessible by selecting the Preferences option in the Settings popup menu. Insert your Coveo Results Preferences rendering in this Preferences Panel placeholder.

Example insertion sequence for the Coveo Results Preferences rendering.

Data source options

Option name Description

Enable the 'Open in New Window' option

See the enableOpenInNewWindow component option.

Enable the 'Open in Outlook' option

See the enableOpenInOutlook component option.

Additional data attributes

Allows use of the Coveo JavaScript Search Framework ResultsPreferences component options that aren’t directly available in the data source.

Sample Generated HTML and Corresponding Behavior

Generated HTML:

<div class="CoveoResultsPreferences">
  <fieldset class="coveo-form-group">
    <span class="coveo-form-group-label">Result links</span>
    <label class="coveo-checkbox-label">
      <input type="checkbox" class="coveo-checkbox" value="Always open results in new window"
      aria-label="Always open results in new window" aria-hidden="true">
      <button type="button" class="coveo-checkbox-button"
      aria-label="Always open results in new window"></button>
      <span class="coveo-checkbox-span-label">Always open results in new window</span>
    </label>
  </fieldset>
</div>

When website visitors change their Always open results in new window preference in the modal, the new value for this preference is stored in the browser local storage.

Results Preferences Sample | Coveo for Sitecore 5