Sorting objects with "expandablelist" hack

Author Message

Pascal France

Wednesday 26 April 2006 3:22:52 am

Hi,

I would like to use this hack:
http://ez.no/community/contribs/hacks/expandablelist

but I face a problem I can't solve: I would like to sort the objects that are not sorted by default (in fact, they seem to be sorted by published date).
So, I use the sort_by function in this line:

{def $items=fetch( 'content', 'tree', hash( 'parent_node_id', $expandable_rootnode_id, 'sort_by', array(array(priority))))}

in the extension/expandablelist/design/standard/templates/expandablelist.tpl tamplate.
But each time I use this function either I get nothing or something like that:
http://www.linuxorable.net/ez_publish/index.php/linuxorable

Is there someone who could explain me why this fucntion doesn't works ?

I tried several other syntaxes, but nothing works.

Regards

Pascal

PS: when I use the "class_filter_type', 'exclude'" function, it works fine.

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Łukasz Serwatka

Wednesday 26 April 2006 11:15:25 pm

The first element of the array must be the desired sorting method. The second element of the array must be the sorting direction, it can be either true() or false() - ascending or descending.

Try with:

{def $items=fetch( 'content', 'tree', hash( 'parent_node_id', $expandable_rootnode_id, 'sort_by', array( array( 'priority', false() ) ) ) )}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Pascal France

Thursday 27 April 2006 12:18:29 am

Hi Lukasz,

It's the first syntaxe I tried according with the offcial doc, but it doesn't work too.
The output is the same as yopu can see:

http://www.linuxorable.net/ez_publish/index.php/linuxorable

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

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 21 2025 20:32:07
Script start
Timing: Jan 21 2025 20:32:07
Module start 'layout'
Timing: Jan 21 2025 20:32:07
Module start 'content'
Timing: Jan 21 2025 20:32:08
Module end 'content'
Timing: Jan 21 2025 20:32:08
Script end

Main resources:

Total runtime1.1996 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 588.0469151.2266
Module start 'layout' 0.00660.0040 739.273436.6797
Module start 'content' 0.01061.1879 775.9531564.8203
Module end 'content' 1.19850.0011 1,340.773411.8125
Script end 1.1996  1,352.5859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2769160.0002
Check MTime0.00130.1072160.0001
Mysql Total
Database connection0.00080.070610.0008
Mysqli_queries1.148095.6962570.0201
Looping result0.00070.0607550.0000
Template Total1.161196.820.5805
Template load0.00220.182620.0011
Template processing1.158996.600420.5794
Template load and register function0.00020.015410.0002
states
state_id_array0.00120.099910.0012
state_identifier_array0.00180.149020.0009
Override
Cache load0.00180.1461280.0001
Sytem overhead
Fetch class attribute can translate value0.00080.062720.0004
Fetch class attribute name0.00150.126640.0004
XML
Image XML parsing0.00140.115220.0007
class_abstraction
Instantiating content class attribute0.00000.000940.0000
General
dbfile0.00130.1091180.0001
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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/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: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs