Header for changin sorting order

Author Message

Marian Svetlik

Monday 04 April 2005 2:09:09 am

In one folder I have a several objects of my custom class - it has several attributes - name, company, att3, ...
At first objects are sorted by name. And I would like to add a function for users to be able to choose by which of the attributes they want to sort the objects.
Has anybody solved this? I believe it is a simple condition, I just can't get it.
Thanks a lot

Arran Price

Tuesday 05 April 2005 4:55:25 pm

Hi Marian,
seeing as how you dont have any other solutions offered yet...
You could just do the fetch again based on a different key. Im not sure how else you could re-sort.

Arran

Marian Svetlik

Tuesday 19 April 2005 7:30:19 am

Thanks for answer - the matter is that i don't know how to do this practically - let's say i use $order as a parameter for sort_by, but how should I add a value to the variable $order?

Eivind Marienborg

Tuesday 19 April 2005 7:44:48 am

You can get input from user with view parameteres, and then use this either directly or via a switch as sort filter :)

Eivind Marienborg

Tuesday 19 April 2005 7:48:04 am

Or have I misread your post? If you want to sort first by name, then by other attribute (when name is the same), then you can use an array in the sort order.

Marian Svetlik

Tuesday 19 April 2005 7:52:48 am

I don't understand only two things - what are "view parameters" and what is the "swith" :-)
I have never been strong in such things, but I have to complete this, so sorry for such questions...

Eivind Marienborg

Tuesday 19 April 2005 8:01:20 am

On view parameters, you might find info here:
http://www.ez.no/community/forum/developer/url_parameters

Switches:
http://www.ez.no/ez_publish/documentation/development/libraries/ez_template/functions/switch

Marian Svetlik

Thursday 21 April 2005 5:10:06 am

Thx a lot, i think the view parameter will work - i'll try it and report the results :-)
Thanks

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 19 2025 03:19:38
Script start
Timing: Jan 19 2025 03:19:38
Module start 'layout'
Timing: Jan 19 2025 03:19:38
Module start 'content'
Timing: Jan 19 2025 03:19:39
Module end 'content'
Timing: Jan 19 2025 03:19:39
Script end

Main resources:

Total runtime1.1568 sec
Peak memory usage4,096.0000 KB
Database Queries74

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 589.1797152.6250
Module start 'layout' 0.00540.0033 741.804739.4453
Module start 'content' 0.00871.1469 781.2500588.4375
Module end 'content' 1.15560.0012 1,369.687516.1563
Script end 1.1568  1,385.8438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2884160.0002
Check MTime0.00130.1159160.0001
Mysql Total
Database connection0.00090.078010.0009
Mysqli_queries1.098794.9766740.0148
Looping result0.00060.0554720.0000
Template Total1.118296.720.5591
Template load0.00250.212820.0012
Template processing1.115896.451020.5579
Template load and register function0.00020.016310.0002
states
state_id_array0.00120.105510.0012
state_identifier_array0.00130.109520.0006
Override
Cache load0.00210.1831320.0001
Sytem overhead
Fetch class attribute can translate value0.00060.053230.0002
Fetch class attribute name0.00120.101890.0001
XML
Image XML parsing0.00160.137430.0005
class_abstraction
Instantiating content class attribute0.00000.0017110.0000
General
dbfile0.00380.3279160.0002
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 28
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs