Tree sorting

Author Message

Tobias Persson

Thursday 16 September 2004 5:58:58 am

Hi,

I have a javascript tree menu for navigation on my site. But I have a small problem. When I fetch the nodes for the menu, I would like to use the same sorting as the admin for all folders and subfolders. (like the sort_by, $node.sort_array, but here I would like $node to change so I get the correct sorting for all subnodes)

Something like this (if I had choosen alphabethic sorting)

I would like:

Anode
-- Asubnode
-- Bsubnode
-- RSubnode
Bnode
-- Asubnode2
-- Bsubnode2
-- Rsubnode2

Right now I think i get the result like this:

Anode
Asubnode
Asubnode2
Bnode
Bsubnode
Bsubnode2
RSubnode
Rsubnode2

Anyone understand what I mean? And maybe even have a solution :-) Thanks

 

Bård Farstad

Friday 17 September 2004 12:58:36 am

eZ publish cannot sort the subtree result within the tree structure. The sorting will discard the tree information. If you want to have it sorted you need to fetch one level at the time. Mabye you can use the treemenu() template operator, this will do that for you.

--bård

Documentation: http://ez.no/doc

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 18 2025 19:27:57
Script start
Timing: Jan 18 2025 19:27:57
Module start 'layout'
Timing: Jan 18 2025 19:27:57
Module start 'content'
Timing: Jan 18 2025 19:27:58
Module end 'content'
Timing: Jan 18 2025 19:27:58
Script end

Main resources:

Total runtime0.8295 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.0058 588.9219152.6094
Module start 'layout' 0.00580.0027 741.531339.4141
Module start 'content' 0.00850.8197 780.9453531.4688
Module end 'content' 0.82820.0012 1,312.41418.1953
Script end 0.8295  1,320.6094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4204160.0002
Check MTime0.00150.1803160.0001
Mysql Total
Database connection0.00080.097310.0008
Mysqli_queries0.778493.8448540.0144
Looping result0.00050.0633520.0000
Template Total0.798096.220.3990
Template load0.00230.272020.0011
Template processing0.795895.934520.3979
Template load and register function0.00010.014210.0001
states
state_id_array0.00140.173610.0014
state_identifier_array0.00090.105620.0004
Override
Cache load0.00190.2290310.0001
Sytem overhead
Fetch class attribute can translate value0.00060.069820.0003
Fetch class attribute name0.00160.189240.0004
XML
Image XML parsing0.00100.118420.0005
class_abstraction
Instantiating content class attribute0.00000.000940.0000
General
dbfile0.00090.1063230.0000
String conversion0.00000.001040.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs