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?
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?
Hallo,
Per hook erweitern
Lg Georg
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?
Hier findet man schonmal sinnvolle Informationen:
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?
lass dir doch mal das $conf aufrufen, aber der hook scheint schon richtig zu sein
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.)
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]
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