node_id is empty

Author Message

Stephan Brezinsky

Thursday 25 March 2004 9:17:40 am

In my pagelayout.tpl I have added a simple {$node.node_id} to echo out the current node being viewed. Strangely enough, as you click around my site, sometimes the node number will display, and sometimes it won't.

For example, I can click on my 'products' link and get node id 45 returned to me on the page. Then I can click on the 'links' link and get a blank node number. Then if I return to the 'products' link, the node is now blank as well.

I know the node_id cannot be blank, because all objects are nodes and have node ids. How is this even possible?

Stephan Brezinsky

Thursday 25 March 2004 11:19:20 am

I have solved the problem by removing my

IndexPage=/content/view/full/62

setting in my settings/mysitedesign/site.ini.append.

This is obviously not an ideal solution, since I want to be able to specify my default content page for the index.

Alex Jones

Thursday 25 March 2004 11:52:39 am

It appears to be a caching issue. $node is not available when ViewCaching is enabled. Try using <i>$DesignKeys:used.node</i> instead.

More info/options: http://ez.no/ez_publish/documentation/customization/custom_design/template_variables_set_by_ezpublish

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Stephan Brezinsky

Thursday 25 March 2004 12:17:12 pm

Ah well that makes sense. I've read those docs before but never would have guessed that's what it meant. Thanks =]

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

Main resources:

Total runtime0.0176 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.0070 588.0313151.1953
Module start 'layout' 0.00700.0026 739.226636.6172
Module start 'content' 0.00960.0063 775.843890.0313
Module end 'content' 0.01590.0017 865.875033.9922
Script end 0.0175  899.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002715.1345140.0002
Check MTime0.00126.5860140.0001
Mysql Total
Database connection0.00158.806210.0015
Mysqli_queries0.002615.069430.0009
Looping result0.00000.080010.0000
Template Total0.00126.910.0012
Template load0.00095.244710.0009
Template processing0.00021.364410.0002
Override
Cache load0.00063.590010.0006
General
dbfile0.002111.851080.0003
String conversion0.00000.050240.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