Forums / Setup & design / Double attribute sorting

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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