Forums / Developer / How to use Match[persistent_variable]

How to use Match[persistent_variable]

Author Message

Luc Chase

Thursday 05 July 2007 7:18:26 pm

How is this override.ini condition used??

The Web Application Service Provider

Bruce Morrison

Thursday 05 July 2007 9:28:53 pm

Hi Luc

From: doc/changelogs/3.5/CHANGELOG-3.4.4-to-3.5.0
- Added support for the template variable 'persistent_variable', which can be
used to communicate between content templates and other templates, even
though content caching is on. It can be set for example with
{set scope=global persistent_variable=42} and fetched with
{$module_result.content_info.persistent_variable}

http://ez.no/doc/ez_publish/technical_manual/3_9/reference/template_override_conditions
says it can be used in the override of the node/view/*.tpl

So I assume that you can site it in a template then have an override that display a different template dependant on the value. E.G.

[magic_pockets_meaningoflife]                
Source=node/view/full.tpl      
MatchFile=magic_pocket_meaningoflife.tpl     
Subdir=templates               
Match[class_identifier]=pocket 
Match[section]=34   
Match[persistent_variable]=42

[magic_pockets]                
Source=node/view/full.tpl      
MatchFile=magic_pocket.tpl     
Subdir=templates               
Match[class_identifier]=pocket 
Match[section]=34   

HTH

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Luc Chase

Friday 06 July 2007 4:10:22 am

Looks promising! I think I'm nearly there.
I need to set the varialble from another template.
But so far this does not work...

{node_view_gui view=line  content_node=$child  persistent_variable=42}

The Web Application Service Provider

Bruce Morrison

Friday 06 July 2007 4:18:52 pm

Hi Luc

You are setting the variable incorrectly. You'll need something like:

{set scope=global persistent_variable=42}
{node_view_gui view=line content_node=$child}

I haven't tested this just going on the docs.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Björn Dieding@xrow.de

Wednesday 18 July 2007 3:24:27 pm

http://issues.ez.no/IssueView.php?Id=11145&

this is the solution!

plus I fixed bug 11144

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/