User side sorting

Author Message

Stephen Martin

Thursday 20 March 2008 11:36:52 am

Hi,

I'd like to add some user side sorting features to a site I'm creating in ezp 4.0.

On a page I fetch a list of animals ( http://magnoliacattlecompany.com/Livestock ) and I'd like users to be able to sort this list base on animal attributes such as price, breed, gender etc. (You can see a comp of the sorting here: http://magnoliacattlecompany.com/design/livestock.html )

I've scoured the docs and forum and cannot find a suitable solution. Can someone point me in the right direction to accomplish this?

Thanks!

Stephen

Felix Laate

Wednesday 26 March 2008 6:18:46 am

Hi,

you could use view_parameters. Just add e.g. /(sortby)/price to the url, and then use $view_parameters.sortby in your fetch.

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 21:32:39
Script start
Timing: Jan 30 2025 21:32:39
Module start 'layout'
Timing: Jan 30 2025 21:32:39
Module start 'content'
Timing: Jan 30 2025 21:32:39
Module end 'content'
Timing: Jan 30 2025 21:32:39
Script end

Main resources:

Total runtime0.0246 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 588.0313151.1953
Module start 'layout' 0.00710.0041 739.2266220.6563
Module start 'content' 0.01120.0118 959.8828997.6797
Module end 'content' 0.02310.0015 1,957.562529.9922
Script end 0.0246  1,987.5547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002911.6207140.0002
Check MTime0.00124.8177140.0001
Mysql Total
Database connection0.00124.727710.0012
Mysqli_queries0.003213.184730.0011
Looping result0.00000.053310.0000
Template Total0.00114.410.0011
Template load0.00083.435910.0008
Template processing0.00020.962610.0002
Override
Cache load0.00062.441310.0006
General
dbfile0.00031.316080.0000
String conversion0.00000.028140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs