Page 1 of 1

Send a param by link

Posted: Wed Sep 13, 2006 11:04 am
by whyggy
Dear All,

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);
That's working, but it's keep on the URL the orlder sortby param....
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
So perhaps can you help me to send a module parameter by link in an other way ?
Thx a lot
W.
(Sorry for the double, I already post this topic yesterday but in the wrong forum...)