Wednesday 17 January 2007 3:50:18 am
$node is still available in node templates, but from 3.9 and higher it is removed from pagelayout and related templates. This is with good reason since $node is not set in pagelayout when viewcache is turned on and you are viewing a cached node page, and it's never set in pagelayout on pages that are not content related. So if you need to use current node in your pagelayout, do something like this:
{def $current_node_id = first_set($module_result.node_id, 0)}
{if $current_node_id}
{def $current_node = fetch( content, node, hash( node_id, $current_node_id ) )}
{/if}
If you absolutely need $node present in your pagelatout:
{if and( is_set($module_result.node_id), is_unset($node) )}
{def $node = fetch( content, node, hash( node_id, $module_result.node_id ) )}
{/if}
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
|