This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » General » Global variable ?????

Global variable ?????

Global variable ?????

Saturday 08 May 2010 10:15:52 pm - 4 replies

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 :


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

Sunday 09 May 2010 2:24:36 pm

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.

Sunday 09 May 2010 11: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

Monday 05 December 2011 3:11:24 pm

I tried all techniques supposed to create global variables, none work.

{set} documentation is really confusing and unclear.

Would be good if such a basic feature is clarified.


Monday 05 December 2011 4:41:12 pm

1. define the var in pagelayout

2. just use it in other templates

This should work fine


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

36 542 Users on board!

Forums menu

Proudly Developed with from