Zum Inhalt springen

tt_news LIST per get-Parameter sortieren

Erstellt am 1. März 2009 · 8 Antworten · letzte Antwort am 7. Mai 2009

Tags: tt_news, Frage

linajoy ·

Ich würde meinen tt_news LISt View gerne per GET Parameter sortieren, also in etwa so:

plugin.tt_news.listOrderBy.data = GPvar : tx_ttnews|sorting

Dummerweise hat jedoch listOrderBy keine stdWrap Eigenschaften. Kennt jemand eine Lösung?

linajoy ·

Ich habe zwar schon hooks für zusätzliche marker in tt_news geschrieben, aber wie schreibe ich einen hook um dem feld stdeigenschaften zu geben?

linajoy ·

folgender Code scheint wirkungslos zu sein, obwohl er sich im erzeugten SQL Befehl zeigt:

  function processSelectConfHook(&$pObj,$conf) {
    $this->cObj = t3lib_div::makeInstance('tslib_cObj'); // local cObj.     
    $this->pObj = &$pObj;
    $this->realConf = $pObj;
    $conf['orderBy'] .= 'title asc';
    return $conf;
  }

weiß jemand, ob die sortierung vielleicht erst nach dem absetzen des SQL Befehls vorgenommen wird?

linajoy ·

ja das ist eben das komische. Das config zeigt alle Einstellungen zum Filtern an: pid in list, where usw je nach auswahl. Aber eben nichts zur sortierung egal welche sortiereinstellungen man im Plugin oder im TS gewählt hat.

Setze ich nun über $conf['orderBy'] .= 'title asc'; eine Sortierung und erzeuge in der whereklausel einen Fehler um mir den SQL Befehl anzeigen zu lassen. Dann enthält der Output tatsächlich ORDER BY title asc. ABER diese Sortierung kommt nicht im Frontend an. Im Frontend sind die News wiederum nach Datum sortiert (Standart wenn nichts anderes eingestellt ist.)

linajoy ·

Also wie es scheint kann man momentan über Hooks nicht sortieren, aber die Sortierung hat auch keinen stdWrap.

Also blieb nur die Brute-Froce Methode: Conditions... *grummel*

[globalString  = GP:tx_ttnews|sorting = title] && [globalString  = GP:tx_ttnews|direction = asc]
  plugin.tt_news.listOrderBy =  title asc
[global]
[globalString  = GP:tx_ttnews|sorting = title] && [globalString  = GP:tx_ttnews|direction = desc]
  plugin.tt_news.listOrderBy =  title desc
[global]


[globalString  = GP:tx_ttnews|sorting = tx_lonewsadress_zip] && [globalString  = GP:tx_ttnews|direction = asc]
  plugin.tt_news.listOrderBy =  tx_lonewsadress_zip asc
[global]
[globalString  = GP:tx_ttnews|sorting = tx_lonewsadress_zip] && [globalString  = GP:tx_ttnews|direction = desc]
  plugin.tt_news.listOrderBy =  tx_lonewsadress_zip desc
[global]
ArminB ·

Hallo,

ich habe einen etwas anderen Lösungsansatz gewählt.

plugin.tt_news.listOrderBy =  title
[globalString  = GP:tx_ttnews|sorting = crdate]
  plugin.tt_news.listOrderBy =  crdate
[globalString  = GP:tx_ttnews|sorting = rating]
  plugin.tt_news.listOrderBy =  rating
[end]


[globalString  = GP:tx_ttnews|direction = desc]
  plugin.tt_news.listOrderBy :=  appendString( desc)
[else]
  plugin.tt_news.listOrderBy :=  appendString( asc)
[end]

Armin