Forums / Developer / How to exchange parameters between several parts (blocks) on a page ? (persistent variables)

How to exchange parameters between several parts (blocks) on a page ? (persistent variables)

Author Message

Xavier Dutoit

Friday 08 April 2005 1:05:38 am

Hello,

I'd like to be able to set a param from the full view and being able to retrieve it from another part (eg the pagelayout).

I'm able to see some attributes set by ez (eg the id_section) , but can't imagine how to add a new attribute.

I've tried a set-block root, but I can't see it on the module_result, and I'm running out of ideas...

Any suggestion ?

Thanks in advance,

Xavier

http://www.sydesy.com

Paul Borgermans

Friday 08 April 2005 8:43:03 am

Xavier,

It should work: define a variable in the pagelayout and modify it with set-block global (root means in the current file like the view template only)

hth

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Xavier Dutoit

Friday 08 April 2005 9:41:28 am

Paul,

Stupid of me, thanks very much.

It still have a problem: it only works the first time after I clear the cache, not the other times.

My context:
I set-block global on a full template, and I read the result on the pagelayout.tpl

Any idea ?

Xavier

http://www.sydesy.com

Xavier Dutoit

Monday 11 April 2005 6:16:54 am

Hello,

I'm still stuck with the problem. On the template that should receive a param, adding a cache-block works:

{cache-block keys=array('param',$uri_string)}
({$param})
{/cache-block}

However, the part where I need to read the param has to be uncached.

Any idea ?

Xavier

http://www.sydesy.com

Kristian Hole

Thursday 14 April 2005 3:09:12 pm

Xavier,

If you want to disable the cache for a template, check this out:

http://www.ez.no/ez_publish/documentation/incoming/how_to_set_cache_expire_time_or_disable_cache_in_template

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

Xavier Dutoit

Thursday 21 April 2005 9:35:56 am

Hi,

I think I found the way of sorting my problem (persistent variable):
http://www.ez.no/ez_publish/documentation/incoming/persistent_template_variable

However, it doesn't seem to work as expected/described:
http://www.ez.no/community/bugs/two_persistent_variable_problems_in_content_templates

X+

http://www.sydesy.com