core-bundle icon indicating copy to clipboard operation
core-bundle copied to clipboard

Sortierrichtung als Auswahlelement im "panelLayout"

Open zonky2 opened this issue 9 years ago • 4 comments

Per DCA kann eine Sortierung inkl. Sortierrichtung mit dem Parameter "flag" vorgegeben werden https://docs.contao.org/books/api/dca/reference.html#fields

es gibt aber im Backend keine Möglichkeit, mit einfachen Mitteln die Sortierrichtung umzudrehen ("Workaround" http://www.e-spin.de/dcaconfig-editor.html - siehe "Sortierung Auf-/Absteigend umstellen")

Mein Vorschlag wäre ein neuer Knoten in dem DCA z.B.

...
sortingdir => true,
...

welches bei "true" ein Selectfeld oder zwei Radiobuttons ausgibt, mit denen die Sortierrichtung umgestellt werden kann - ggf. auch per Icon mit Pfeil hoch/runter und Toggle-Funktion

zonky2 avatar May 30 '16 06:05 zonky2

A more simple solution would be to add two options for each field in the sorting dropdown, one for ASC and one for DESC

aschempp avatar May 30 '16 12:05 aschempp

may be, we can add a array as flag value like

...
flag => array(5,6),
...

with the result of two entries

  • my sorting attribute (asc)
  • my sorting attribute (desc)

zonky2 avatar May 30 '16 13:05 zonky2

nice idea, that would mean we can add options to sort a date by month or by day etc.

aschempp avatar May 30 '16 14:05 aschempp

flag => 5,

has one entry

  • sort my date

and

flag => array(5,6),

has two entries (with the same name and different "sort-appendix")

  • sort my date (asc)
  • sort my date (desc)

the first num is the default direction - so we can use

flag => array(6,5),

with

  • sort my date (desc)
  • sort my date (asc)

zonky2 avatar May 30 '16 14:05 zonky2

See https://github.com/contao/contao/pull/5425

leofeyer avatar Sep 01 '23 09:09 leofeyer