Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Feature: Sortierung und Suche von Dateien in Dateiverwaltungsansicht #7196

Closed
tim-bec opened this issue Jul 23, 2014 · 19 comments
Closed

Feature: Sortierung und Suche von Dateien in Dateiverwaltungsansicht #7196

tim-bec opened this issue Jul 23, 2014 · 19 comments
Assignees
Labels
Milestone

Comments

@tim-bec
Copy link

tim-bec commented Jul 23, 2014

As editor it would be great to sort and search in the fielmanger.

Currently the situation is a little bit unsatisfying, editors are familiar with search and sort function on file system - even in windows. And baby, its 2014!

So it would be a minor improvement for the great contao DBFS system if its possible to do some, search, filter and sorting in $future.

Feature

Sorting

  • Alphabetical sorting (as current)
  • Z-A sorting
  • sort by create
  • sort by changed

Filter

  • all
  • Just files
  • Just files of *.x
  • Just folders

Search

  • by filename
  • by foldername
  • by property
    • filesize
    • dimension
    • types *.x
  • In meta-information („where the hell is the 'Lorem ipsum‘ description i liked to replace... ?!")

Ideas

DBFS search

A note is of course necessary, that only files are considered which are in dbfs.

  • we just search in the DBFS
  • …for performance
  • (for some search / filter we need to improve the DBFS meta-informations)

DBFS search + filesystem

  • like above
  • nothing found in DBFS? Lets take a look in the file-system
  • maybe limited to $n levels
@tim-bec
Copy link
Author

tim-bec commented Jul 23, 2014

Related: #5876

@mruettgers
Copy link

+1

@dmolineus
Copy link
Contributor

👍

Da das auslesen von großen Dateimengen lange dauern kann, sollten sich die Suchergebnisse stückweise aufbauen. Z.B. erst die Ergebnisse des DBFS, dann zusätzliche Einträge aus dem aktuellen Ordner (ggf. stückweise, je nach Dateimenge), dann eine Ebene tiefer usw.

Das hat den Vorteil, dass sofort Ergebnisse erscheinen sowie noch nicht erfasste Dateien so auf mit berücksichtigt werden können.

@Samson1964
Copy link

Alphabetische Sortierung (wie jetzt)

Die Standardsortierung von Contao ist nicht alphabetisch. Sortiert wird mit natsort (php.net: "Diese Funktion implementiert einen Sortieralgorithmus, welcher alphanumerische Zeichenketten reiht, wie es auch ein Mensch tun würde.")
Mit dem Zitat kann nicht ich gemeint sein, denn ich sortiere so nicht - zumindest nicht, wenn auch Buchstaben im Spiel sind oder die Zahlen ein Datum.
Natsort sortiert eine Zahlenfolge mit "8, 9, 10, 11, 12" usw.. Sort sortiert "10, 11, 12, 8, 9". Wenn jemand meint, daß Natsort dann aber doch wie ein Mensch sortiert, dann gebe ich ihm Recht. Zumindest was die alphanumerische Sortierung angeht.

Ich habe in meiner Dateiverwaltung viele Dateien mit Spielerbildern nach dieser Syntax:
nachname_vorname_jahr

Beispiel meiner erwarteten Sortierung, wobei ich statt des Jahrs auch gern mal JJJJMM oder JJJJMMTT verwende. Hier sehe ich die Dateinamen in ihrer alphabetischen als auch zeitlichen Reihenfolge aufgelistet:
mustermann_hans_2003
mustermann_hans_20030714
mustermann_hans_2006
mustermann_hans_200603
mustermann_hans_2007

Contao sortiert aber anders, weil natsort ja annimmt, es müßte die Zahlen natürlich einsortieren:
mustermann_hans_2003
mustermann_hans_2006
mustermann_hans_2007
mustermann_hans_200603
mustermann_hans_20030714

Das hat für mich nichts mit alphabetisch mehr zu tun.

Wenn schon alternative Sortierungen als Feature nötig wären, dann bitte doch auch PHP-sort mit dem Flag für Groß- und Kleinschreibung.

@tim-bec
Copy link
Author

tim-bec commented Jul 24, 2014

@Samson1964 danke für den Hinweis - das war mir so nicht bekannt. Ich würde meinen Vorschlag dann einfach so ergänzen, das man alle "sinnvoll" anwendbaren http://php.net/manual/de/array.sorting.php Funktionen nutzen kann.

@tristanlins
Copy link
Contributor

The filesystem search could be realised via ajax, so the tree build itself partially while each directory is scanned in a separate ajax request. This would result in "a lot" ajax requests, but should be realy performant and the user see that the search is running (ajax loader animation).

@aschempp
Copy link
Member

aschempp commented Aug 8, 2014

We've had an ajax load in Isotope 1 and it was definitely NOT performant :D
Obviously it could be done better, but I doubt it will be as snappy as the current solution.

@leofeyer leofeyer added this to the 3.5.0 milestone Nov 18, 2014
@christianromeni
Copy link

+1

@leofeyer leofeyer modified the milestones: 3.5.0, 4.1.0 Apr 30, 2015
@jankout
Copy link

jankout commented Jul 21, 2015

+1

leofeyer added a commit to contao/core-bundle that referenced this issue Oct 13, 2015
@leofeyer leofeyer self-assigned this Oct 13, 2015
@leofeyer
Copy link
Member

Part 1 (searchable file picker) implemented in contao/core-bundle@5f13608.

@leofeyer
Copy link
Member

Part 2 (searchable file manager) implemented in contao/core-bundle@7460493.

@leofeyer
Copy link
Member

Now here are the limitations:

  • Only synchronized folders are included in the search results
  • There are no sorting options, because there is no (performant) way to sort by atime, mtime or ctime
  • There is no reverse sorting, because the file manager uses a tree structure (just like the site structure)
  • There is no filtering besides being able to search for the file name, path or extension
  • There is no way to search for meta information without loading the files model for every (!) search result

@aschempp
Copy link
Member

Wouldn't it be "way easier" to implement a javascript search on the list element names? Or would collapsed nodes be a problem?

@leofeyer
Copy link
Member

Collapsed nodes would be a problem for sure.

@Toflar
Copy link
Member

Toflar commented Oct 26, 2015

I think it's strange that it also searches for folders.

Imagine this situation:

  • layout
    • img
      • image_1.png
      • image_2.png
    • js
      • script_1.js
      • test.js
    • css
      • layout.css

If you search for "layout", what do you expect to be shown? Personally, I expect only layout.css to be shown, however, Contao displays all of the above as I listed them because all of them are in a folder that matches the search input.

@leofeyer
Copy link
Member

I would expect the following:

  • layout
    • css
      • layout.css

But I don't know if the (regex-based) filter can be tuned to be this exact.

@leofeyer
Copy link
Member

We could also develop a separate view, which only shows the following:

  • layout
  • layout.css

However, I doubt that this can be done with the current tree.

@leofeyer
Copy link
Member

Of course, the two posts above only apply to searching for the name. If you search for the file path, it is correct to show layout/img/image_1.png, since its path contains "layout".

@leofeyer
Copy link
Member

Overworked implementation in contao/core-bundle@33002c6.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

10 participants