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/

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 20:57:03
Script start
Timing: Jan 18 2025 20:57:03
Module start 'layout'
Timing: Jan 18 2025 20:57:03
Module start 'content'
Timing: Jan 18 2025 20:57:04
Module end 'content'
Timing: Jan 18 2025 20:57:04
Script end

Main resources:

Total runtime0.9987 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 589.0703152.6250
Module start 'layout' 0.00480.0033 741.695339.4453
Module start 'content' 0.00810.9891 781.1406603.0625
Module end 'content' 0.99710.0015 1,384.203116.1563
Script end 0.9986  1,400.3594 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3232160.0002
Check MTime0.00150.1535160.0001
Mysql Total
Database connection0.00060.063310.0006
Mysqli_queries0.939994.1128650.0145
Looping result0.00060.0610630.0000
Template Total0.962796.420.4813
Template load0.00220.218820.0011
Template processing0.960596.179220.4802
Template load and register function0.00020.020610.0002
states
state_id_array0.00090.093910.0009
state_identifier_array0.00090.085620.0004
Override
Cache load0.00190.1916380.0001
Sytem overhead
Fetch class attribute can translate value0.00060.056630.0002
Fetch class attribute name0.00120.118370.0002
XML
Image XML parsing0.00120.117930.0004
class_abstraction
Instantiating content class attribute0.00000.004780.0000
General
dbfile0.00090.0926220.0000
String conversion0.00000.000840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs