Closed xchs closed 10 years ago
Isn't a file tree always sorted alphabetically?
Well, in my operating system's default file manager I have many choices to sort (ascending or descending) the file and folder tree view by different details ("name", "file size", "file extension/type", "date modified", etc.) Indeed, this is actually what I miss in the current file tree widget. For instance, if someone organized files in a date-based folder structure it would be nice to sort the entries in a descending sort order to have the latest entries always on top:
instead of
Implemented (at least ascending/descending) in 71ac3a0a784b0f8c91e39a90ed923ec55c958e09.
Great, thanks a lot! It works perfectly well. Your support is much appreciated.
BTW: The "Apply" button in the Simple Modal Window does not seem to work in Firefox 11.0. However, it works just fine in Chrome.
Does this feature still work in Contao 3.3.3? I just tried to set e.g.
$GLOBALS['TL_DCA']['tl_content']['fields']['singleSRC']['flag'] = 2;
in my local DCA configuration but the file sorting has not changed.
It does not. The feature has been removed in 01acdd20d1911ed3dc64c225b8f911561f34b930, after we have discussed and decided to show the file system and not the DB entries in the file picker. If you re-upload the broken images above, I'll see if the behavior can be accomplished on PHP level.
The feature has been removed in 01acdd2
Oh, I see. Thanks.
If you re-upload the broken images above
Done.
I'll see if the behavior can be accomplished on PHP level.
Many thanks in advance.
Implemented in 9d6686d3e615e327a37e81d6a55e390f8cd7bbd1. However, I had to move the flag to the eval
section, so now the syntax is:
$GLOBALS['TL_DCA']['tl_content']['fields']['singleSRC']['eval']['sort'] = 'desc';
I decided to go for a sort
flag, which could be extended with other sorting modes such as "by extension" or "by file size" in the future.
Can’t we use the existing „flag“ attribute?=
Nope, the "flag" attribute is not available as widget attribute. And it does not do the same thing, e.g. it has six different settings for "ascending" and six for "descending", because it also modifies the way the listing is rendered.
You’re right, and we would not want the list sorting to affect the widget sorting.=
It would be nice to have in the FileTree class another DCA evaluation key to sort the file tree (of "singleSRC" or "multiSRC" fields) by certain criteria, e.g. "ascending", "descending", etc. (cf. the existing DCA "flag" evaluation key)
Currently, we have the following (special) evaluation keys to configure the behavior of the file tree widget: "fieldType", "files", "filesOnly", "extensions", "path"