Forums / General / module and nodes

module and nodes

Author Message

Philippe VINCENT-ROYOL

Tuesday 15 January 2008 3:12:20 am

Hello,

I've create a specific module in order to list some city object.
I've a full list of city but i've a problem. When i try to show the node id, i dont have value. I ve try with

{$node.node_id} 
and 
{$node.path_array.2}

It is possible to link a template to a node?

Thanks

Certified Developer (4.1): http://auth.ez.no/certification/verify/272607
Certified Developer (4.4): http://auth.ez.no/certification/verify/377321

G+ : http://plus.tl/dspe
Twitter : http://twitter.com/dspe

Ɓukasz Serwatka

Saturday 26 January 2008 1:23:28 pm

Hi Philippe,

Most likely $node variable is not defined. In your PHP code for module view definition you will need to add something like:

$node = eZContentObjectTreeNode::fetch( <node_id>);
$tpl->setVariable( 'node', $node );

then in tpl you can access $node.node_id and other node attributes if needed. You can also of course pass node_id as view parameter.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog