Root Node

Author Message

Daniel B

Wednesday 16 September 2009 8:43:08 am

Hello Guys

how to get the root node of whatever Site / Node?

I think only with a recursive Loop. I dont no ez have a special global var?

Thx
Dan

Marcel Marnet

Wednesday 16 September 2009 11:24:57 pm

Hello Daniel,

what do you mean with "root node"?
Do you mean the highest node of the content-structure? Or the parent node?

The highest node is node 2.

parent-node for example:

{$node.parent.node_id}

with best regards,

Marcel

Xavier Serna

Thursday 17 September 2009 1:37:19 am

This will always return the actual root node for the site:

{def $root_node=fetch( 'content', 'node', hash( 'node_path', '/') )}

hth!

--
Xavier Serna
eZ Publish Certified Developer
Departament de Software
Microblau S.L. - http://www.microblau.net
+34 937 466 205

Daniel B

Thursday 17 September 2009 6:23:17 am

thx,

thats ok

Daniel

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 11:00:56
Script start
Timing: Jan 18 2025 11:00:56
Module start 'layout'
Timing: Jan 18 2025 11:00:56
Module start 'content'
Timing: Jan 18 2025 11:00:57
Module end 'content'
Timing: Jan 18 2025 11:00:57
Script end

Main resources:

Total runtime1.2218 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 587.7891152.6094
Module start 'layout' 0.00690.0031 740.398439.3984
Module start 'content' 0.00991.2106 779.7969575.7188
Module end 'content' 1.22050.0013 1,355.515612.2031
Script end 1.2218  1,367.7188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.3224160.0002
Check MTime0.00170.1367160.0001
Mysql Total
Database connection0.00070.058610.0007
Mysqli_queries1.169695.7219620.0189
Looping result0.00060.0509600.0000
Template Total1.186397.120.5931
Template load0.00210.168220.0010
Template processing1.184296.920020.5921
Template load and register function0.00010.012110.0001
states
state_id_array0.00200.159710.0020
state_identifier_array0.00330.273920.0017
Override
Cache load0.00170.1423260.0001
Sytem overhead
Fetch class attribute can translate value0.00100.085030.0003
Fetch class attribute name0.00100.082650.0002
XML
Image XML parsing0.00070.057130.0002
class_abstraction
Instantiating content class attribute0.00000.000750.0000
General
dbfile0.00080.0684160.0001
String conversion0.00000.000640.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/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
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: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs