unknown syntax $#...using variables

Author Message

Ludovico muratori

Saturday 08 December 2007 6:08:46 am

I'm overriding some templates, based on those ones in ezwebin (v 3.10). I found this chunk of code (imege.tpl for a a line view):

<div class="attribute-image"{if is_set($#image_style)} style="{$#image_style}"{/if}>
<p>{attribute_view_gui attribute=$node.data_map.image image_class=gallerythumbnail
href=$node.url_alias|ezurl}</p>
</div>

Is there anyone who can explain how does it work $#[var] syntax (as it is in if is_set($#...) above? Is there a part of the on line documentation or inside the ez books (I own them) where such a syntax is explained? I'm not really able to find it.

Sorry for any possible annoyance.

Ludvic

André R.

Saturday 08 December 2007 6:40:44 am

The word you are looking for is scope, and you can read more about it here:
http://ez.no/doc/ez_publish/technical_manual/3_10/reference/template_functions/variables/set

$# is for reading variables in the global scope

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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 19 2025 05:19:45
Script start
Timing: Jan 19 2025 05:19:45
Module start 'layout'
Timing: Jan 19 2025 05:19:45
Module start 'content'
Timing: Jan 19 2025 05:19:46
Module end 'content'
Timing: Jan 19 2025 05:19:46
Script end

Main resources:

Total runtime1.0078 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 589.1484152.6250
Module start 'layout' 0.00490.0033 741.773439.4453
Module start 'content' 0.00830.9982 781.2188524.7656
Module end 'content' 1.00650.0013 1,305.98448.1563
Script end 1.0078  1,314.1406 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.2983160.0002
Check MTime0.00130.1257160.0001
Mysql Total
Database connection0.00070.069910.0007
Mysqli_queries0.964395.6891540.0179
Looping result0.00050.0469520.0000
Template Total0.978297.120.4891
Template load0.00190.184720.0009
Template processing0.976396.879220.4882
Template load and register function0.00020.019310.0002
states
state_id_array0.00090.086110.0009
state_identifier_array0.00110.106620.0005
Override
Cache load0.00150.1500160.0001
Sytem overhead
Fetch class attribute can translate value0.00050.053820.0003
Fetch class attribute name0.00100.103930.0003
XML
Image XML parsing0.00070.073420.0004
class_abstraction
Instantiating content class attribute0.00000.000730.0000
General
dbfile0.00090.0854170.0001
String conversion0.00000.001040.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs