Double attribute sorting

Author Message

Pascal France

Tuesday 06 October 2009 12:46:53 am

Hi,

I would like to sort my items by 2 attributes: first by "code postal" (zip code) and then by "ville" (town).

According to the examples of the "fetch list" doc, I've tried many syntaxes but nothing works.

I thought that this one should work:

{def $list_societes=fetch( content, list, hash( parent_node_id, $node.node_id,
                       sort_by, array(array('attribute', true(),'societe/codepostal'),
                                            array('attribute', true(),'societe/ville'))))}

...but it doesn't :(

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

Pascal France

Tuesday 06 October 2009 3:16:12 am

In the comments of the "list" fetch function, this example is done:

{set list_items=fetch_alias( children,hash( 'parent_node_id', $node.node_id,
                         'offset', $view_parameters.offset,
                         'sort_by', array( array( 'attribute', false(), 'news/sticky' ), array(  'attribute', false(), 'news/date')),
                         'limit', $page_limit ) ) }

wich is exactly the same code I wrote in my first post. But even using "fetch_alias" only the first sort (news/sticky) is taken into account.

Any idea ?

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

Pascal France

Tuesday 06 October 2009 9:42:57 am

All works perfectly.
It was I who was making a mistake thinking :-(

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 31 2025 04:29:08
Script start
Timing: Jan 31 2025 04:29:08
Module start 'layout'
Timing: Jan 31 2025 04:29:08
Module start 'content'
Timing: Jan 31 2025 04:29:08
Module end 'content'
Timing: Jan 31 2025 04:29:08
Script end

Main resources:

Total runtime0.0153 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 588.1328151.2109
Module start 'layout' 0.00470.0029 739.343836.6484
Module start 'content' 0.00760.0060 775.992290.1563
Module end 'content' 0.01370.0016 866.148433.9922
Script end 0.0153  900.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002415.5400140.0002
Check MTime0.00117.0168140.0001
Mysql Total
Database connection0.00074.248410.0007
Mysqli_queries0.002516.303430.0008
Looping result0.00000.090410.0000
Template Total0.00127.710.0012
Template load0.00095.659810.0009
Template processing0.00032.012810.0003
Override
Cache load0.00063.966410.0006
General
dbfile0.00138.246080.0002
String conversion0.00000.051440.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