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

A place to discuss and receive support for the Web Auction application.

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

Postby sylvainf » Thu Dec 04, 2008 12:22 pm

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
sylvainf
 
Posts: 1
Joined: Thu Dec 04, 2008 12:10 pm

Postby shannah » Fri Dec 05, 2008 3:38 pm

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 17 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved