Monday 08 March 2010 5:48:29 am
Hi Duffy, Indeed the inability to retrieve a variable set in the pagelayout from an included template is due to the execution order: first the view template, then the pagelayout. To answer your last question : you can use the following operators to access any get, post or session variable from a template :
- ezhttp: http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_operators/data_and_information_extraction/ezhttp
- ezhttp_hasvariable http://ez.no/doc/ez_publish/technical_manual/4_x/reference/template_operators/data_and_information_extraction/ezhttp_hasvariable (for testing the presence of a GPS variable)
Bear in mind though, that when using this from a node template ( the ones loaded when requesting URLs of the form /content/view/<view_mode>/<node_id> ), view caching is used, increasing performances, but reducing flexibility in some cases. Two solutions, from the top of my head:
- use the view parameters : .../(my_variable)/value, available through the $view_parameters variables in node templates
- disable view caching, and add properly keyed cache blocks. This last solution presents the risk of decreasing performances, and should be manipulated with care and proper testing.
Hope it helps,
Let us know how things go, Cheers !
--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board
eZ Publish Community on twitter: http://twitter.com/ezcommunity
t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye
|