THIS IS ARCHIVED DOCUMENTATION

Coveo for Sitecore Legacy Search UI Framework - Overview of Coveo Sort Components Code

Coveo for Sitecore 4.1 (November 2018)

CoveoDateSort.ascx, CoveoFieldSort.ascx, and CoveoRelevancySort.ascx are sublayout files that represent sort components. Their default location is c:\inetpub\wwwroot\SitecoreInstanceName\Website\layouts\Coveo\.

Digging into Their Code

  • There’s a different Inherits attribute value for each of them.
  • There’s a single div element with a class attribute equal to CoveoSort, which is automatically rendered as a Sort component.
  • A set of options are passed as custom attributes to the component, such as data-title='<%= Model.Title %>':
    • These options customize the behavior as well as the look and feel of the component.
    • Model refers to a property of the user control, which wraps the different properties associated with the Sort component.

CoveoDateSort.ascx

<%@ Control Language="c#" AutoEventWireup="true" Inherits="Coveo.UI.CoveoDateSort" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<%@ Register TagPrefix="coveoui" Namespace="Coveo.UI.Controls" Assembly="Coveo.UIBase" %>

<!-- When customizing this component, ensure to use "Coveo.$" instead of the regular jQuery "$" to
     avoid any conflicts with Sitecore's Page Editor/Experience Editor.  -->

<coveoui:ErrorSummary runat="server" />
<coveoui:WhenConfigured runat="server">
    <span id="<%= Model.SortId %>" class="CoveoSort" data-sort-criteria="<%= Model.Criteria %>"><%= Model.Title %></span>
</coveoui:WhenConfigured>

CoveoFieldSort.ascx

<%@ Control Language="c#" AutoEventWireup="true" Inherits="Coveo.UI.CoveoFieldSort" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<%@ Register TagPrefix="coveoui" Namespace="Coveo.UI.Controls" Assembly="Coveo.UIBase" %>

<!-- When customizing this component, ensure to use "Coveo.$" instead of the regular jQuery "$" to
     avoid any conflicts with Sitecore's Page Editor/Experience Editor.  -->

<coveoui:ErrorSummary runat="server" />
<coveoui:WhenConfigured runat="server">
    <span id="<%= Model.SortId %>" class="CoveoSort" data-sort-criteria="<%= Model.Criteria %>"><%= Model.Title %></span>
</coveoui:WhenConfigured>

CoveoRelevancySort.ascx

<%@ Control Language="c#" AutoEventWireup="true" Inherits="Coveo.UI.CoveoRelevancySort" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
<%@ Register TagPrefix="coveoui" Namespace="Coveo.UI.Controls" Assembly="Coveo.UIBase" %>

<!-- When customizing this component, ensure to use "Coveo.$" instead of the regular jQuery "$" to
     avoid any conflicts with Sitecore's Page Editor/Experience Editor.  -->

<coveoui:ErrorSummary runat="server" />
<coveoui:WhenConfigured runat="server">
    <span id="<%= Model.SortId %>" class="CoveoSort" data-sort-criteria="<%= Model.Criteria %>"><%= Model.Title %><span class="relevancy-sort-fix"></span></span>
</coveoui:WhenConfigured>