Is $node.node_id cleared on browser refresh?

Author Message

Barney Gumble

Thursday 15 January 2004 9:24:04 am

For one page on my site I want to add extra items to <HEAD> and also use a <BODY ONLOAD...>. I'm trying to do this in pagelayout.tpl as follows (I've taken out stylesheet calls etc.):

<html>
<head>
{section show=eq( $node.node_id, 44 ) )}
{* include call to javascript here *}
{/section}
</head>

{section show=eq( $node.node_id, 44 ) )}
<body onLoad=...>
{section-else}
<body>
{/section}
.
.
.

This works fine the first time, i.e. the extra script is used in the <HEAD>, and the <BODY ONLOAD...> is being used. However when I refresh the page in IE6 neither of these things are happening. In fact I can even see a normal <BODY> has been used. $node.node_id also appears to be blank, where it should be 44.

I'm using eZ publish 3.2.4. Any suggestions would be very welcome!

Paul Borgermans

Thursday 15 January 2004 10:10:51 am

In pagelayout.tpl files and their overrides you should use $module_result.node_id instead of $node.node_id. The latter is only available the first time you call the page with this node id.

In view templates for classes and their objects it is entirely safe to use $node.whatever

hth

-paul

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

Barney Gumble

Thursday 15 January 2004 10:18:12 am

That's great, thanks Paul!

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 18 2025 16:12:37
Script start
Timing: Jan 18 2025 16:12:37
Module start 'layout'
Timing: Jan 18 2025 16:12:37
Module start 'content'
Timing: Jan 18 2025 16:12:39
Module end 'content'
Timing: Jan 18 2025 16:12:39
Script end

Main resources:

Total runtime1.4343 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 588.0469152.6406
Module start 'layout' 0.00660.0036 740.687539.4766
Module start 'content' 0.01031.4209 780.1641534.6016
Module end 'content' 1.43120.0031 1,314.765612.1250
Script end 1.4343  1,326.8906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.2158160.0002
Check MTime0.00130.0891160.0001
Mysql Total
Database connection0.00070.045810.0007
Mysqli_queries1.377896.0577570.0242
Looping result0.00060.0405550.0000
Template Total1.397897.520.6989
Template load0.00260.179720.0013
Template processing1.395297.269320.6976
Template load and register function0.00020.011210.0002
states
state_id_array0.00130.087610.0013
state_identifier_array0.00150.107420.0008
Override
Cache load0.00170.1218280.0001
Sytem overhead
Fetch class attribute can translate value0.00110.078120.0006
Fetch class attribute name0.00190.131140.0005
XML
Image XML parsing0.00080.054520.0004
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00080.0527170.0000
String conversion0.00000.000740.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs