Share » Forums » Setup & design » Section missing through caching

Section missing through caching

Section missing through caching

Friday 08 December 2006 1:33:20 am - 3 replies

Author Message

André R.

Friday 08 December 2006 4:59:07 am

I kind of guess this is in the pagelayout or related templates -> You are not supposed to use $node in other templates then node templates. This is because the variable is only there (in pagelayout and included templates) when view caching is disabled or if the page you are viewing is not cached yet (no view cache for that node generated yet).

Edit: This is a long standing misunderstanding introduced at the time view cache was introduced to 3.x, this is fixed in 3.9 by removing the $node variable from pagelayout completely.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jon Staines

Friday 08 December 2006 5:21:17 am

Thanks for the answer.

Would it be better to have something like this in the pagelayout:

{let $current_node=fetch(content,node,hash(node_id,$module_result.node_id))}
{section show=$current_node.data_map.show_copyright.content}

or

add some kind of section look up to some code in each of the node templates (article, folder, etc)?

Jon Staines

Tuesday 12 December 2006 1:22:51 am

The first option seems to have fixed the problem.

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu