$node no more accessable in 3.4? (am I dreaming?)

Author Message

Stefano Guandalini

Thursday 05 August 2004 7:49:41 am

After upgrading from 3.3-5 to 3.4-1, I can no more use $node variable in pagelayout.tpl and in included tpls. I can access it only in overrided templates.

{$node.name}

does not produce any output and

{$node|attribute( '', 2 )

is empty!!!
Am I dreaming?

Thanks.

Bye

Stefano Guandalini
http://www.nizan.net

Paul Borgermans

Thursday 05 August 2004 8:25:22 am

Stefano,

$node is only available in content view templates, not pagelayout templates and its includes except when called the first time with view caching on or all the time with view caching off in the 3.3 series and before.

With 3.4 the caching has changed a bit

I suggest to create your own $currentnode variable based on $module_result.node_id

{let currentnode=fetch(content,node,hash(node_id,$module_result.node_id}
.....
{/let}

hth

-paul

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

Zoltan Szabo

Wednesday 11 August 2004 11:12:40 am

I had the same experience: "Am I dreaming?"
A lot of documentation page speaks about this $node thing...

A have a lot of problems with strange and un-decodeable variables in eZp, mainly in xml parts. How could I obtain some parts of the xml text without using the builtin "content" possibilities?

Paul Borgermans

Wednesday 11 August 2004 11:31:22 am

There is no possibility out of the box to access xml parts of xml text fields.

However, you may achieve something by either

- use the xslt operator from the contributions to transform/select part of the xml content
- fetch the raw xml content and use javascript DOM on it

-paul

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

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 31 2025 01:31:35
Script start
Timing: Jan 31 2025 01:31:35
Module start 'layout'
Timing: Jan 31 2025 01:31:35
Module start 'content'
Timing: Jan 31 2025 01:31:36
Module end 'content'
Timing: Jan 31 2025 01:31:36
Script end

Main resources:

Total runtime1.0083 sec
Peak memory usage8,192.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.2656151.2266
Module start 'layout' 0.00480.0039 739.4922220.7188
Module start 'content' 0.00870.9988 960.21094,501.9063
Module end 'content' 1.00750.0007 5,462.117211.8125
Script end 1.0082  5,473.9297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.3568160.0002
Check MTime0.00130.1250160.0001
Mysql Total
Database connection0.00070.074410.0007
Mysqli_queries0.907489.9926620.0146
Looping result0.00070.0704600.0000
Template Total0.949394.220.4746
Template load0.00250.247720.0012
Template processing0.946893.902620.4734
Template load and register function0.00140.138510.0014
states
state_id_array0.00240.234610.0024
state_identifier_array0.00250.246120.0012
Override
Cache load0.00220.2140320.0001
Sytem overhead
Fetch class attribute can translate value0.00230.223630.0008
Fetch class attribute name0.00290.285960.0005
XML
Image XML parsing0.00250.247930.0008
class_abstraction
Instantiating content class attribute0.00000.002070.0000
General
dbfile0.00310.3114230.0001
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 23
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs