Find depth in tree

Author Message

Felix Laate

Monday 12 January 2004 6:22:50 am

Hi all!

Is there a way to fin de maximal detph in the tree-structure, either from the top or from any given node!

I need this for creating a tree-menu of a depth that covers it all.

Greetings
felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Albert Berenguer

Friday 16 January 2004 11:16:51 am

for creating the menu you can take a look at:

http://www.ez.no/developer/ez_publish_3/documentation/customization/tips_tricks/creating_tree_menus

Every node has an attribute which indicates its depth (for example $myloop:item.depth).
If you have an array with all the nodes, you should look for the maximum depth of all the nodes, that will be the depth of the tree.

i hope that was what you needed, bye!

-berto-

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 31 2025 01:23:38
Script start
Timing: Jan 31 2025 01:23:38
Module start 'layout'
Timing: Jan 31 2025 01:23:38
Module start 'content'
Timing: Jan 31 2025 01:23:38
Module end 'content'
Timing: Jan 31 2025 01:23:38
Script end

Main resources:

Total runtime0.0226 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 588.1094151.1953
Module start 'layout' 0.00520.0040 739.3047220.6563
Module start 'content' 0.00920.0119 959.9609997.7734
Module end 'content' 0.02110.0014 1,957.734429.9922
Script end 0.0225  1,987.7266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002611.5008140.0002
Check MTime0.00114.8664140.0001
Mysql Total
Database connection0.00073.022410.0007
Mysqli_queries0.002510.961930.0008
Looping result0.00000.058110.0000
Template Total0.00104.310.0010
Template load0.00083.359510.0008
Template processing0.00020.908810.0002
Override
Cache load0.00052.327010.0005
General
dbfile0.00031.342180.0000
String conversion0.00000.034940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs