Forums / Setup & design / Help sorting menuitems

"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".

Help sorting menuitems

Author Message

akiL Mussa

Monday 04 April 2005 8:28:10 am

Hi,

I'm trying to use the top_menu sorted by priority using the following code:

    {let root_node=fetch( content, node, hash( node_id, 2 ) )
         menuitems=fetch( 'content', 'list', hash( 'parent_node_id', 2,
                                                   'sort_by', array('priority',true()) ) )}

I am getting the folders returned from my fetch, but not in priority order.

The root node (node_id 2) is ordered by priority. I'm using ezp 3.4.0. I just cleared all caches many times

Is there anything wrong?

Łukasz Serwatka

Monday 11 April 2005 5:32:40 am

Hi,

Try replace sort array with $node.sort_array and use admin interface to sort content.

{let root_node=fetch( content, node, hash( node_id, 2 ) )
         menuitems=fetch( 'content', 'list', hash( 'parent_node_id', $root_node.node_id,
                                                   'sort_by', $root_node.sort_array )}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog