Feature #56213

Sorting Filelists by FAL attributes and provide sorting direction option

Added by Gregor Favre over 5 years ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Start date:
2014-02-22
Due date:
% Done:

100%

PHP Version:
5.4
Tags:
Complexity:
medium
Sprint Focus:

Description

When creating a "File Links" CE and adding a file collection, there is the possibility to sort the files by File Extension, File Name, Size, etc., but sorting by FAL fileobject properties is not possible.

Use Case: To have files in a directory, giving them a speaking title, setting via TS to have the file-title rendered instead of the file-name, and hence wanting to have the list sorted by the title.

With the introduction of FAL attributes like "Title, Description, ...", and the possibility to set the sorting by TS to any arbitrary string/field, it would be useful to have the possibility to sort by specific FAL attributes.

I found out that sorting is possible by any property a file object exposes, but it seems the FAL properties are not attached to the fileobject itself, hence sorting by these (non-existent) properties is of course not possible.

I know this is a big one, but encountered several situations where this would make sense.


Related issues

Related to TYPO3 Core - Bug #59297: sorting.direction in Content Object FILES has no stdWrap Closed 2014-06-02
Duplicated by TYPO3 Core - Bug #63509: filelinks is missing sort by date Closed 2014-12-02
Duplicated by TYPO3 Core - Task #59296: Filelinks Content Element: Implement sorting direction, use FAL fields Closed 2014-06-02
Duplicated by TYPO3 Core - Feature #65403: Filelinks : Allow sort direction Closed 2015-02-27

Associated revisions

Revision fcf92aca (diff)
Added by Susanne Moog 6 months ago

[FEATURE] Allow sorting by file metadata "Title" in CE FileLinks

FAL allows sorting by all metadata properties, the content element
file links had no interface for that until now. The possibility to sort
by the meta data "title" has been introduced. As "title" is provided by
the core, we can be sure that the field exists.

All other fields should be implemented by the integrators by extending
TCA.

Resolves: #56213
Releases: master
Change-Id: I7eb6fb314d52e5bfff96fb5e32d210266edb57e9
Reviewed-on: https://review.typo3.org/c/59897
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Tested-by: Georg Ringer <>
Reviewed-by: Benni Mack <>
Reviewed-by: Georg Ringer <>

History

#1 Updated by Gregor Favre over 5 years ago

  • Target version set to 6.2.0

Better targeted at 6.2.x

#2 Updated by Mathias Schreiber over 4 years ago

  • Target version changed from 6.2.0 to 7.2 (Frontend)

#3 Updated by Gregor Favre over 4 years ago

Update: The sorting on FAL properties is well implemented in FilesContentObject - however it is not documented how one can sort by FAL attributes correctly, and if there is no possibility in the backend (like the existing dropdown), the feature will hardly be ever used.

For documentation purposes:
Sorting filelink lists by FAL properties this way will not work:

tt_content.uploads.20.sorting.field = title
tt_content.uploads.20.sorting.direction = desc

Instead, sorting filelink lists by FAL properties is made with the following TS:

tt_content.uploads.20.sorting >
tt_content.uploads.20.sorting = title
tt_content.uploads.20.sorting.direction = desc

Purging the sorting-Config is needed, since by default stdWrap is used because of the default presence of the sorting.field key. As long as this key is present, sorting on FAL properties will not work, since in the context of stdWrap, the FAL properties are not present (only tt_content properties are present). Instead, the sorting of FAL properties has to be stated directly in the sorting key.

That's quite not obvious to understand for new users, therefore I'd suggest for 7.x implementing for filelinks a GUI dropdown in the backend, so the user can chose on which FAL property he wants to sort - also if ascending or descending.

Regarding me, the issue can be closed, or converted to a feature request.

#4 Updated by Markus Klein over 4 years ago

  • Status changed from New to Accepted
  • Sprint Focus set to Remote Sprint

#5 Updated by Markus Klein over 4 years ago

  • Tracker changed from Feature to Bug
  • Subject changed from Sorting Filelists by FAL attributes to Sorting Filelists by FAL attributes and provide sorting direction option
  • TYPO3 Version set to 6.2
  • Is Regression set to No

#6 Updated by Benni Mack about 4 years ago

  • Target version changed from 7.2 (Frontend) to 7.4 (Backend)

#7 Updated by Susanne Moog about 4 years ago

  • Target version changed from 7.4 (Backend) to 7.5

#8 Updated by Benni Mack almost 4 years ago

  • Target version deleted (7.5)

#9 Updated by Markus Klein about 2 years ago

  • Target version set to Candidate for Major Version
  • Sprint Focus changed from Remote Sprint to On Location Sprint

#10 Updated by Anja Leichsenring almost 2 years ago

  • Sprint Focus deleted (On Location Sprint)

#11 Updated by Martin Eberle almost 2 years ago

Since fluid_styled_content is used, the typoscript for upload list sorting by FAL title has to be:

tt_content.uploads {
dataProcessing {
10 {
sorting >
sorting = title
sorting.direction = desc
}
}
}

But i think, this should better be an option to configure in the backend…

#12 Updated by Susanne Moog 6 months ago

  • Tracker changed from Bug to Feature

#13 Updated by Gerrit Code Review 6 months ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59897

#14 Updated by Gerrit Code Review 6 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59897

#15 Updated by Anonymous 6 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#16 Updated by Benni Mack 4 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF