Ich möchte die Ergebnisliste nach einer Suche nach mehreren Parametern sortieren.
Wie stelle ich das geschickt an?
Wie stelle ich das geschickt an?
?orderby_101=alias%5Basc%5D&orderby_133=select_db%5Basc%5D
[COLOR=#333333][SIZE=11px] [COLOR=#0045aa]if[/COLOR][COLOR=#000000]([/COLOR] \Contao\Input[COLOR=#000000]::[/COLOR][COLOR=#3f6e7d]get[/COLOR]([COLOR=#dd2400]'meineSuche'[/COLOR]) [COLOR=#000000]!=[/COLOR] [COLOR=#dd2400]''[/COLOR] [COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR][/SIZE][/COLOR] [COLOR=#333333][SIZE=11px]\Contao\Input[COLOR=#000000]::[/COLOR][COLOR=#3f6e7d]setGet[/COLOR]([COLOR=#dd2400]'orderby_101'[/COLOR],[COLOR=#dd2400]'alias%5Basc%5D'[/COLOR]); \Contao\Input[COLOR=#000000]::[/COLOR][COLOR=#3f6e7d]setGet[/COLOR]([COLOR=#dd2400]'orderby_133'[/COLOR],[COLOR=#dd2400]'elect_db%5Basc%5D'[/COLOR]);[/SIZE][/COLOR] [COLOR=#333333][SIZE=11px][COLOR=#000000]}[/COLOR] [/SIZE][/COLOR]
<?php if( \Contao\Input::get('produktsuche') != ' ' ) { \Contao\Input::set('orderby_163','prio%5Basc%5D'); \Contao\Input::set('orderby_162','highlight%5Bdesc%5D'); \Contao\Input::set('orderby_164','name%5Basc%5D'); }
?produktsuche=&orderby_163=prio%5Basc%5D&orderby_162=highlight%5Bdesc%5D&orderby_164=name%5Basc%5D
if( \Contao\Input::get('produktsuche') != ' ' ) { \Contao\Input::setGet('orderby_163','prio%5Basc%5D '); \Contao\Input::setGet('orderby_162','highlight%5Bd esc%5D'); \Contao\Input::setGet('orderby_164','name%5Basc%5D '); }
'&orderby_165=highlight%5Bdesc%5D&orderby_157=prio%5Basc%5D&orderby_158=name%5Basc%5D'
// immer aktiv, ohne abhängigkeit
\Contao\Input::setGet('orderby_163','prio%5Basc%5D ');
\Contao\Input::setGet('orderby_162','highlight%5Bd esc%5D');
\Contao\Input::setGet('orderby_164','name%5Basc%5D ');
// aktiv, in abhängigkeit zu produktsuche if( \Contao\Input::get('produktsuche') != ' ' ) {
\Contao\Input::setGet('orderby_163','prio%5Basc%5D ');
\Contao\Input::setGet('orderby_162','highlight%5Bd esc%5D');
\Contao\Input::setGet('orderby_164','name%5Basc%5D ');
}
Kommentar