Coveo for Sitecore Legacy Search UI Framework - Overview of Coveo Sort Components Code
Coveo for Sitecore Legacy Search UI Framework - Overview of Coveo Sort Components Code
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
Inheritsattribute value for each of them. -
There’s a single
divelement with aclassattribute equal toCoveoSort, 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.
-
Modelrefers 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 %>"><span class="relevancy-sort-fix"><%= Model.Title %></span></span>
</coveoui:WhenConfigured>