Sort Criteria - AFS

AFS Integration Guide

Product
AFS
AFS_Version
7.7
Category
Reference Guide

Sort Criteria are mainly used by the Sort Widget. Nevertheless, those informations are used by some other widgets (like Context) that requires the definition be made in the main Configuration.

The sort property from the Configuration has the following available parameters.


Parameter Name


Card.


Type


Default


Description

defaultCriterionName

Optional

String

"Relevance"

Name of the default sort defined in afsDefaults

criteria

Optional

Array

[]

Definition list of all criterion. A criterion is an object with a name and a value

The following lines show an example of a JavaScript-based configuration:

var AFSWidgetConfiguration = {
sort: {
criteria: [
{
name: 'Relevance',
value: 'afs:relevance,DESC'
},
{
name: 'Newest',
value: 'modified,DESC'
}
]
}
};

Defining sort criteria overrides the default sort. The defaultCriterionName has no effect if used with the criteria property.