/
Sort mode

Sort mode

Design

sort.png

How it works

Sort modes are displayed on the search page (and on my boards page).

Each cursor menu can have its sort mode.

Default is :

  • Most recent

  • Recently updated

Sort modes should be standard database sort modes (numerical / alpha, ascending / descending)

Advanced Configuration

Introduction

The sorting modes of the Home (Dam objects search) and Boards pages are configured according to the same syntax but in two different places to allow a more precise customization :

  • The Home sorting modes must be described inside JSON files located in the dam/explore/sort subdirectory. Sorting modes can be configured by cursor, the one used by default for all cursors can be found in the default-cursor-config.json file

  • The Boards sorting modes must be described in the sort.json file located in the board/boards-view subdirectory.

The preceding sorting modes are described as an Array<Sort> with the following default settings :

Config Path

Default value

Description

Config Path

Default value

Description

$.dam.explore.sort.defaultCursorConfig or $.board.boardsView.sort

[ { "value": "created desc", "i18n": "dam.sort.created.desc", "default": true }, { "value": "modified desc", "i18n": "dam.sort.modified.desc" } ]

 

 

By default, displays the most recently created DAM objects

 

Sorts the DAM objects by putting the last modified ones first

 

Each Sort object has the following structure :

Property

Type

Mandatory

Default

Description

Property

Type

Mandatory

Default

Description

value

string

true

undefined

Its value respects the SQL ORDER BY syntax:

  • an existing property on the dam object

  • ascending or descending order.

i18n

string

false

undefined

I18n key displayed in as a drop-down list entry label

default

boolean

false

false

True to use by default and displayed as such in the drop-down list


Adding a sort mode

You just have to add a new Sort object in an array inside the correct configuration file (see introduction). The sorting method must be done on an existing property, possibly with adding a i18n key (to customize the display of the property).

This following example sorts on the descending object Ids:

[ ... { "value": "id desc", "i18n": "dam.sort.id.desc" } ]

Deleting a sort mode

Simply remove the Sort object from the array inside the correct configuration file (see introduction).

Others configuration options

To complete : List what is possible, but no documentation for now