Forums / General / Global variable ?????

Global variable ?????

Author Message

patrice brun

Saturday 08 May 2010 1:15:52 pm

Hello,
I would like to pass a variable in the pagelayout
I tried with the following code:

in my template :

{def $total_items=0}
{set scope='global' $total_items=0}

In my pagelayout :

{$#total_items}

but this does not work, have you any idea?
Thank you

Gaetano Giunta

Sunday 09 May 2010 5:24:36 am

If you are doing this inside a node view template, you should use the persistent_variable mechanism instead, as it will work even when you activate the view cache.

Principal Consultant International Business
Member of the Community Project Board

patrice brun

Sunday 09 May 2010 2:05:08 pm

Thank you Gaetano
but precisely because I am not inside a template node that I would use a global variable.Have you an idea that I can pass the variable of my template to my pagelayout.
Thank you