Page 1 of 1

How to change the sort criterion of the main page list?

PostPosted: Thu Dec 04, 2008 12:22 pm
by sylvainf
Hi,

I cannot understand how the product list is sorted on the main page. How can I change it to sort, for example by product_id or date?
I suppose that it's possible to introduce sort criterion in the "foreach" loop of public_product_list.html but I don't know how.

Thank you and congratulation for dataface framework and web auction.

Sylvain

PostPosted: Fri Dec 05, 2008 3:38 pm
by shannah
This just uses the query that is specified in the GET parameters (Xataface query style). E.g. if you wanted to sort on the created_date field, you could just add
-sort=created_date

to your GET parameters (i.e. index.php?-sort=created_date)
If you wanted it to sort descending you would do:
index.php?-sort=created_date+desc

And so on...

An easy way to add sorting ability is to just add some links to your pages with the correct sort parameters.

Alternatively it is possible to manipulate the sort parameters inside PHP.
-Steve