diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-63509-FileLinksSortingByDateAndSortingDirection.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-63509-FileLinksSortingByDateAndSortingDirection.rst new file mode 100644 index 0000000000000000000000000000000000000000..c4e82e71dad4746cc2f31ff04340f0048cfd0438 --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/master/Feature-63509-FileLinksSortingByDateAndSortingDirection.rst @@ -0,0 +1,24 @@ +.. include:: ../../Includes.txt + +====================================================================== +Feature: #65403 - Add file links sorting by date and sorting direction +====================================================================== + +See :issue:`63509` +See :issue:`65403` + +Description +=========== + +Adds "Sort by creation date" and "Sort by modification date" options +and a new option to set a sorting direction in the file links +content element. + + +Impact +====== + +New options in the "Sort by" dropdown and a new dropdown +to set a sorting direction. + +.. index:: Backend diff --git a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Uploads.txt b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Uploads.txt index 78d84e8fef2d47e214ac4c2c09fc93a0107bd832..262a1752d8c8d29035ff81f256331a4f7028e63d 100644 --- a/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Uploads.txt +++ b/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Uploads.txt @@ -12,6 +12,7 @@ tt_content.uploads { references.fieldName = media collections.field = file_collections sorting.field = filelink_sorting + sorting.direction.field = filelink_sorting_direction } } stdWrap { diff --git a/typo3/sysext/frontend/Configuration/TCA/tt_content.php b/typo3/sysext/frontend/Configuration/TCA/tt_content.php index 369642f437ff6040c2afaabfb03904ec92c6b94f..b9763e81be01c6d2017310c00ec5b29d3aea0d37 100644 --- a/typo3/sysext/frontend/Configuration/TCA/tt_content.php +++ b/typo3/sysext/frontend/Configuration/TCA/tt_content.php @@ -996,7 +996,21 @@ return [ ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.extension', 'extension'], ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.name', 'name'], ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.type', 'type'], - ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.size', 'size'] + ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.size', 'size'], + ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.creation_date', 'creation_date'], + ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting.modification_date', 'modification_date'] + ] + ] + ], + 'filelink_sorting_direction' => [ + 'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting_direction', + 'config' => [ + 'type' => 'select', + 'renderType' => 'selectSingle', + 'items' => [ + ['', ''], + ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting_direction.ascending', 'asc'], + ['LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:filelink_sorting_direction.descending', 'desc'], ] ] ], @@ -1903,6 +1917,7 @@ return [ file_collections;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:file_collections.ALT.uploads_formlabel, --linebreak--, filelink_sorting, + filelink_sorting_direction, target ', ], diff --git a/typo3/sysext/frontend/Resources/Private/Language/locallang_ttc.xlf b/typo3/sysext/frontend/Resources/Private/Language/locallang_ttc.xlf index 74567d93fe534d61379194d580e6af165025cef8..77691243b5761561517890629aba17a727baf9c2 100644 --- a/typo3/sysext/frontend/Resources/Private/Language/locallang_ttc.xlf +++ b/typo3/sysext/frontend/Resources/Private/Language/locallang_ttc.xlf @@ -451,22 +451,37 @@ <source>Show File Size:</source> </trans-unit> <trans-unit id="filelink_sorting"> - <source>Sort Filelist:</source> + <source>Sort file list:</source> </trans-unit> <trans-unit id="filelink_sorting.none"> - <source>none</source> + <source>no sorting</source> </trans-unit> <trans-unit id="filelink_sorting.extension"> - <source>by Fileextension</source> + <source>by file extension</source> </trans-unit> <trans-unit id="filelink_sorting.name"> - <source>by Filename</source> + <source>by filename</source> </trans-unit> <trans-unit id="filelink_sorting.type"> - <source>by Filetype</source> + <source>by file type</source> </trans-unit> <trans-unit id="filelink_sorting.size"> - <source>by Filesize</source> + <source>by file size</source> + </trans-unit> + <trans-unit id="filelink_sorting.creation_date"> + <source>by file creation date</source> + </trans-unit> + <trans-unit id="filelink_sorting.modification_date"> + <source>by file modification date</source> + </trans-unit> + <trans-unit id="filelink_sorting_direction"> + <source>Sorting direction:</source> + </trans-unit> + <trans-unit id="filelink_sorting_direction.ascending"> + <source>Ascending (default)</source> + </trans-unit> + <trans-unit id="filelink_sorting_direction.descending"> + <source>Descending</source> </trans-unit> <trans-unit id="filelink_size_formlabel"> <source>Display File Size Information</source> diff --git a/typo3/sysext/frontend/ext_tables.sql b/typo3/sysext/frontend/ext_tables.sql index 36cfa88ee7c443fbde09002b72b45720960786c1..1178baeb7236d0f634c8678f584309eb5a97d5c6 100644 --- a/typo3/sysext/frontend/ext_tables.sql +++ b/typo3/sysext/frontend/ext_tables.sql @@ -276,7 +276,8 @@ CREATE TABLE tt_content ( linkToTop tinyint(3) unsigned DEFAULT '0' NOT NULL, file_collections text, filelink_size tinyint(3) unsigned DEFAULT '0' NOT NULL, - filelink_sorting varchar(10) DEFAULT '' NOT NULL, + filelink_sorting varchar(17) DEFAULT '' NOT NULL, + filelink_sorting_direction varchar(4) DEFAULT '' NOT NULL, target varchar(30) DEFAULT '' NOT NULL, date int(10) unsigned DEFAULT '0' NOT NULL, recursive tinyint(3) unsigned DEFAULT '0' NOT NULL,