Forums / Setup & design / node_id is empty

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 =]