sort_by on fetch

Author Message

Jean-Luc Nguyen

Tuesday 23 September 2008 8:50:24 am

Hello,

I have a very simple fetch, and I sort by priority :

{foreach fetch( 'content', 'list', hash('parent_node_id', 2,
   'class_filter_type', 'include',
   'class_filter_array', array( 'frontpage' ) ),
   'sort_by', array( 'priority', true() ) ) as $frontpage}
   {$frontpage.name|wash()}
{/foreach}

But when displaying, it won't sort by priority, but by creation date, I really don't understand...
Some help woold be great, thanks!

http://www.acidre.com

André R.

Tuesday 23 September 2008 11:43:13 am

Might be because you seem to have a parser error in your code, you're missing one ')' after the fetch code.

Edit: move the extra ')' after 'class_filter_array' to after sort parameter.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jean-Luc Nguyen

Wednesday 24 September 2008 2:34:37 am

Great, sometimes you need another eye to see a "bug" that won't display on the debug... Thanks a lot!

http://www.acidre.com

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.