sortby

sortby
Type
string (field name)
Path
$GLOBALS['TCA'][$table]['ctrl']
Scope
Proc. / Display

Field name, which is used to manage the order of the records when displayed.

The field contains an integer value which positions it at the correct position between other records from the same table on the current page. It should not be made editable by the user since the DataHandler will manage the content automatically.

This feature is used by e.g. the "pages" table and "tt_content" table (Content Elements) in order to output the pages or the content elements in the order expected by the editors. Extensions are expected to respect this field.

Typically the field name sorting is dedicated to this feature.

EXT:my_extension/Configuration/TCA/tx_myextension_domain_model_something.php
<?php

return [
    'ctrl' => [
        'sortby' => 'sorting',
    ],
];
Copied!