Sorting Component

Overview

The Sorting component is used to select the logic for ordering search results.

Selector

The selector for this component is <hawksearch-sorting>.

Data Model

The Sorting data model is exposed to the Handlebars template. For more information, see Search Models.

Event Binding Attributes

Attribute Name

Attribute Value

Attribute Name

Attribute Value

hawksearch-sort

 

When a select element with this attribute changes in value, the search will be updated to use that value as the new sort order.

Default Template

<div class="sorting"> <select hawksearch-sort> {{#each options}} {{#if selected}} <option value="{{value}}" selected>{{title}}</option> {{else}} <option value="{{value}}">{{title}}</option> {{/if}} {{/each}} </select> </div>