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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 19 2025 01:07:56
Script start
Timing: Jan 19 2025 01:07:56
Module start 'layout'
Timing: Jan 19 2025 01:07:56
Module start 'content'
Timing: Jan 19 2025 01:07:56
Module end 'content'
Timing: Jan 19 2025 01:07:56
Script end

Main resources:

Total runtime0.0171 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.0313152.6094
Module start 'layout' 0.00560.0030 741.640639.4063
Module start 'content' 0.00860.0062 781.046989.3906
Module end 'content' 0.01480.0022 870.437530.3047
Script end 0.0171  900.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002615.1451140.0002
Check MTime0.00116.7006140.0001
Mysql Total
Database connection0.00074.277310.0007
Mysqli_queries0.002917.032630.0010
Looping result0.00000.099110.0000
Template Total0.001911.010.0019
Template load0.00095.184210.0009
Template processing0.00105.752010.0010
Override
Cache load0.00063.738810.0006
General
dbfile0.00127.045280.0002
String conversion0.00000.040540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs