default_sortby

default_sortby
Path

$GLOBALS['TCA'][$table]['ctrl']

type

string

Scope

Display

If a field name for sortby is defined, then this is ignored.

Otherwise this is used as the 'ORDER BY' statement to sort the records in the table when listed in the TYPO3 backend. It is possible to have multiple field names in here, and each can have an ASC or DESC keyword. Note that the value should not be prefixed with 'ORDER BY' in itself.

Examples

Sort by title:

'ctrl' => [
   'default_sortby' => 'title',
   ...
],
Copied!

Sort by title and then by creation date:

'ctrl' => [
   'default_sortby' => 'title ASC, crdate DESC',
   ...
],
Copied!