This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » Developer » Fetch path_array directly in PHP

Fetch path_array directly in PHP

Fetch path_array directly in PHP

Tuesday 19 January 2010 11:45:17 am - 2 replies

Hi there,

I would like to know how to fetch the path_array of a node from PHP.

I tried something like this :

$object = eZContentObject::fetchByNodeID($node_id);
$url = $object->attribute("path_array");


$path = new eZPathElement(array("id" => $node_id));
$path_array = $path->getPathArray();

But I still not able to get the path_array for a defined node_id.

Could someone help me ?



Modified on Wednesday 24 March 2010 9:18:53 am by Damien MARTIN

Tuesday 19 January 2010 2:31:40 pm

You should fetch a node - not an object.

Try this:

$mynode = eZContentObjectTreeNode::fetch( $node_id );
$my_path_array = $mynode->attribute( 'path_array' );

Please notice that you will get an array in $my_path_array - not URL.

Kind regards


Modified on Tuesday 19 January 2010 2:36:57 pm by Jarosław-- Heba

Tuesday 19 January 2010 2:38:28 pm

Thank you very much Jarosław,

It works very well.


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

36 542 Users on board!

Forums menu

Proudly Developed with from