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/

eZ debug

Timing: Jan 18 2025 18:41:36
Script start
Timing: Jan 18 2025 18:41:36
Module start 'content'
Timing: Jan 18 2025 18:41:36
Module end 'content'
Timing: Jan 18 2025 18:41:37
Script end

Main resources:

Total runtime0.8020 sec
Peak memory usage4,096.0000 KB
Database Queries202

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0120 587.7344180.8281
Module start 'content' 0.01200.6756 768.5625608.1406
Module end 'content' 0.68760.1143 1,376.7031337.3672
Script end 0.8019  1,714.0703 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.5523210.0002
Check MTime0.00170.2063210.0001
Mysql Total
Database connection0.00090.112110.0009
Mysqli_queries0.722690.09982020.0036
Looping result0.00190.23582000.0000
Template Total0.757194.420.3785
Template load0.00230.286420.0011
Template processing0.754794.113020.3774
Template load and register function0.00010.016210.0001
states
state_id_array0.00160.197610.0016
state_identifier_array0.00210.257020.0010
Override
Cache load0.00200.2443380.0001
Sytem overhead
Fetch class attribute can translate value0.00120.144240.0003
Fetch class attribute name0.00110.140770.0002
XML
Image XML parsing0.00120.149540.0003
class_abstraction
Instantiating content class attribute0.00000.002080.0000
General
dbfile0.00190.2414330.0001
String conversion0.00000.001830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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