It would be nice to have a default sort option for the module (filename, filesize or description).

Comments

macko’s picture

Anders Östberg’s picture

Or maybe an initial sort order as a setting for the node.

I think there may be a potential problem here though since Filebrowser uses column names in the URL; for multi-language sites where you can switch languages on the fly it might be better to use column number instead of column name since the name is translated when changing languages.

jbarns’s picture

can't seem to find the answer on how to sort a column by default (want to sort by modified date), was this feature added in rc10?

macko’s picture

On this page

(URL no longer available)

we use the following .htaccess file to sort by "last modified" date and remove the default footer that displays the number of files and their total size:

IndexIgnore .. .htaccess readme.html foot.html
IndexOptions FancyIndexing DescriptionWidth=* NameWidth=* SuppressHTMLPreamble
IndexOrderDefault Descending Date
HeaderName  readme.html
ReadmeName  footer.html
...
greywolfsspirit’s picture

Has anything been ported yet so we can set the default sort from mime type or modification date to say, filename? Otherwise, please clarify which .htaccess file we need to modify? I have one in my wamp/www/sites directory, one in my wamp/www/sites/default/files directory as well

I also have dowload directories in external directories as well, but no .htaccess files in any of those.

Thanks

Yoran’s picture

Status: Active » Fixed

No, there is no .htaccess support for now but there is sort options in -dev, If you can test it.

greywolfsspirit’s picture

i see the sort options, and I see when it comes up on the website that you can change sort views from the page, but how do you get it to default to use the filename first? I looked at the code, but, not being familiar with web programming (but am familiar with C++), I looked for a familiar type format where it does a if initaldisplay, sort by mimetype
else on chosen_sort_method do {
choice_1: sortby_name
choice_2: sortby_date
etc....

did I miss this in the filebrowser.module code somewhere?

Yoran’s picture

I'm not sure I understand "to use the filename first". Drupal table can only be sorted by one signle criteria. The "default sort" combobox allows you to select which column is used as a sort criteria, and the "default sort order" allows you to select sorting order (asc/desc). This is your 'initial display' and you can choose 'mime type' here. After, when user select order on an other column, the default sort order is lost in the lifetime of the page.

greywolfsspirit’s picture

apparently I had a dev copy prior to the current one, that didnt show the combo box. Just redownloaded the dev that is current and now it shows up with a selectable default sort option. So, I apologize if I caused any confusion. But great job on the update! Looks and works great!

Yoran’s picture

Status: Fixed » Closed (fixed)

ok, perfect so :) I can close this :)