Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

node

Summary

Fetches a node (identified by either an ID number or a path).

Usage

fetch( 'content', 'node', hash( [ 'node_id',   node_id,  ]
                                [ 'node_path', node_path ] ) )

Parameters

NameTypeDescriptionRequired
node_id integer The ID number of the node that should be fetched. No.
node_path string The path of the node that should be fetched. No.

Returns

An ezcontentobjecttreenode object of FALSE.

Description

This function fetches a single node and returns it as a ezcontentobjecttreenode. The target node must be specified using either the "node_id" or the "node_path" parameter. If no node can be found, or if an error occurs, the function will return FALSE.

Examples

Example 1

{def $my_node=fetch( 'content', 'node', hash( 'node_id', 96 ) )}
{$my_node.name|wash}

Fetches node number 96 and outputs the name of the object that is encapsulated by that node.

Example 2

{def $my_node=fetch( 'content', 'node', hash( 'node_path', 'news/article_test' ) )}
{$my_node.name|wash}

Fetches the node by the specified path and outputs the name of the object that is encapsulated by that node.

Balazs Halasy (06/02/2004 12:08 pm)

Balazs Halasy (29/04/2005 8:42 am)


Comments

  • Fetch by 'node_id' does not work

    Fetch by 'node_id' does not work. Never works. Can someone explain to me why?
    • Re: Fetch by 'node_id' does not work

      Mea culpa. Was doing something wrong