I know that we can sort the news items with the param sortby.
But if I want to let the user choose for his best sort (like date, price, ....)
I need to have a new link which keep the old URL and change the sort param !
So I tried to do an user tag
Code: Select all
global $gCms;
$sortby = ($_REQUEST['sortby']) ? $_REQUEST['sortby'] : $params['sortby'];
$sortby_price = 'index.php?'.$_SERVER['QUERY_STRING'].'&sortby=price';
$sortby_date = 'index.php?'.$_SERVER['QUERY_STRING'].'&sortby=date';
$smarty->assign('news_sortby_date', $sortby_date);
$smarty->assign('news_sortby_price', $sortby_price);
So at the end, my URL looks like that :
Code: Select all
/index.php?page=result&sortby=date&sortby=price&sortby=date&sortby=price&sortby=date&sortby=price
Thx a lot
W.
(Sorry for the double, I already post this topic yesterday but in the wrong forum...)