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

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 19 2025 00:54:40
Script start
Timing: Jan 19 2025 00:54:40
Module start 'layout'
Timing: Jan 19 2025 00:54:40
Module start 'content'
Timing: Jan 19 2025 00:54:41
Module end 'content'
Timing: Jan 19 2025 00:54:41
Script end

Main resources:

Total runtime0.9003 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.1484152.6250
Module start 'layout' 0.00600.0043 741.773439.4453
Module start 'content' 0.01030.8885 781.2188526.0781
Module end 'content' 0.89880.0014 1,307.29698.1719
Script end 0.9002  1,315.4688 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.3766160.0002
Check MTime0.00140.1575160.0001
Mysql Total
Database connection0.00150.172110.0015
Mysqli_queries0.847394.1178540.0157
Looping result0.00060.0696520.0000
Template Total0.865596.120.4328
Template load0.00240.270220.0012
Template processing0.863195.872520.4315
Template load and register function0.00030.030810.0003
states
state_id_array0.00090.095510.0009
state_identifier_array0.00100.113620.0005
Override
Cache load0.00200.2244140.0001
Sytem overhead
Fetch class attribute can translate value0.00100.115620.0005
Fetch class attribute name0.00200.220830.0007
XML
Image XML parsing0.00560.626220.0028
class_abstraction
Instantiating content class attribute0.00000.001130.0000
General
dbfile0.00740.8197180.0004
String conversion0.00000.001440.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs