Forums / Developer / Root Node

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