Share » Forums » Developer » How to get the id for the main parent...

How to get the id for the main parent node ?

How to get the id for the main parent node ?

Wednesday 11 August 2004 6:19:53 am - 4 replies

Author Message

Paul Forsyth

Wednesday 11 August 2004 7:00:13 am

That should be:

{$node.parent.node_id}

paul

--
http://www.visionwt.com

Selmah Maxim

Wednesday 11 August 2004 7:49:09 am

Thanks, but you misunderstande me !

{$node.parent.node_id} will give the parent in the upper, I mean Folder 3 parent is folder 2, but i need to get the 1st parent "Jon Folder" node id from the last childe folder .

Paul Borgermans

Wednesday 11 August 2004 8:07:02 am

Hi

You could use the $node.path_string which looks like '/1/2/881/1005/1142/' which you can explode to an array

Here jon folder node id would correspond to the third position ('881')

Alternatively, you can use $node.path_array

$node.path_array.0 is always 1
$node.path_array.1 is always the content root node, mostly 2
$node.path_array.2 and higher indices are the node id 's leading to your folder (node) hierarchy

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Selmah Maxim

Wednesday 11 August 2004 8:59:28 am

Thx .. I thinks this is it !, i`ll try it now !

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu