Forums / Developer / Cache-block problem / Comment48137

Author Topic

Nabil Alimi

Thursday 03 May 2007 9:26:30 am

Comment48137

Salvatore,

I meant that you need to fetch the node with something similar to the piece of code I pasted up there. Try this :

{cache-block keys=$uri_string}

{def  $node=fetch( 'content' , 'node' , hash( node_id , $module_result.node_id ) ) 
       $section=fetch( 'section', 'object', hash( 'section_id', $node.object.section_id ) )}
   <div id="topcontent-{$section.name|wash}">
...
  </div>
{/cache-block}

In case you need to access the $node somewhere else in your template, you should put the node fetch outside of the cache-block.

:)

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr