Forums / Setup & design / Sorting a list nodes by value of an attribute (integer)

Sorting a list nodes by value of an attribute (integer)

Author Message

laurent le cadet

Tuesday 20 May 2008 12:34:42 am

Hi,

I can't find something to perform a fetch base on a value of an integer attribute.
This attribute is use to store votes of users and I would like to sort the top ten in a subtree.

Any hint?

Best regards.

Laurent

Maxime Thomas

Wednesday 21 May 2008 11:35:29 pm

Hi,

You may have already read :
http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/content/fetch_functions/list

But in example number 6 :

{fetch( 'content', 'list',
        hash( 'parent_node_id', 42,
              'sort_by',        array( 'attribute',
                                      false(),
                                      'person/last_name' ) ) )}

It's maybe what you want to do (not with person and last_name...).

Hope it helps.

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas