Forums / General / Problem cache for a variable

Problem cache for a variable

Author Message

Jean-François Sénéchal

Thursday 30 November 2006 3:29:21 am

Hello,

I have in my pagelayout.tpl include a template like this :

{include uri='design:actions.tpl' node_id=$node.node_id}

The code of actions.tpl :

<a href="/layout/set/print/content/view/full/{$node.node_id}"><img src="/design/plain_site/images/print.gif" alt="Imprimer" title="Imprimer"></a> 
<a href="page"><img src="/design/plain_site/images/mail.gif" alt="Nous contactez" title="Nous contactez"></a> 
<a href="/content/tipafriend/{$node.node_id}"><img src="/design/plain_site/images/sendto.gif" alt="Envoyez &agrave; un ami" title="Envoyez &agrave; un ami"></a> 
<a href="/content/pdf/{$node.node_id}"><img src="/design/plain_site/images/pdf.gif" alt="Version Pdf" title="Version Pdf"></a> 

The value of $node.node_id is always the same value on all the pages
(The value is, the first $node.node_id generated by the template)

And the value of {$node_id}, is too always the same value

How can I set off the cache for this ?

Or what's wrong ?

Thanks

L'informaticien est comme un petit canard:
il est calme en surface mais en dessous il brasse beaucoup d'eau pour
avancer ...!

Jacobo Quiles

Friday 01 December 2006 4:26:14 am

Hi, you can't access the $node variable that way from outside the content.
Try this:

{include uri='design:actions.tpl' node_id=$module_result.node_id}

Aside, you can also make sure that the included file is not inside a missconfigured cache-block tag.

Hope it helps.

Microblau SL
http://www.microblau.net

Jean-François Sénéchal

Friday 01 December 2006 9:12:31 am

Ok I was in a missconfigured cache-block tag.

Now it's ok

L'informaticien est comme un petit canard:
il est calme en surface mais en dessous il brasse beaucoup d'eau pour
avancer ...!