Forums / Setup & design / Sorting objects with "expandablelist" hack

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