Setting root namespace variable inside a section???

Author Message

Zoltan Szappanos

Friday 04 April 2003 6:21:34 am

Hi,

I have a simple question. I would like to summarize a root variable inside a section, but it works only outside the section:

{let sum_count=0}
{set sum_count=sum(1,$#sum_count)}
{$#sum_count}
{/let}

It works fine, but if i put it inside a section:

{let sum_count=0}
{section name=Folder loop=fetch(content,list_count,...}
{set sum_count=sum(1,$#sum_count)}
{$#sum_count}
{/section}
{/let}

It doesn't work. How can i setting root namespace variable?

Jan Borsodi

Friday 04 April 2003 6:35:53 am

Setting variables in other namespaces than the current is not supported yet.

You can however move the namespace from the section to the let to achieve the same effect.

{let name=Folder sum_count=0}
{section loop=fetch(content,list_count,...}
{set sum_count=sum(1,$#sum_count)}
{$#sum_count}
{/section}
{/let}

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Zoltan Szappanos

Monday 07 April 2003 5:54:04 am

Thanks, It worked (however i had to change $#sum_count to $:sum_count).

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 16:06:37
Script start
Timing: Jan 18 2025 16:06:37
Module start 'layout'
Timing: Jan 18 2025 16:06:37
Module start 'content'
Timing: Jan 18 2025 16:06:38
Module end 'content'
Timing: Jan 18 2025 16:06:38
Script end

Main resources:

Total runtime0.7266 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.1797152.6406
Module start 'layout' 0.00560.0027 741.820339.4766
Module start 'content' 0.00830.7169 781.2969532.2578
Module end 'content' 0.72520.0014 1,313.55478.1250
Script end 0.7266  1,321.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4272160.0002
Check MTime0.00140.1858160.0001
Mysql Total
Database connection0.00050.072910.0005
Mysqli_queries0.676493.0897570.0119
Looping result0.00070.0943550.0000
Template Total0.698696.120.3493
Template load0.00210.288720.0010
Template processing0.696595.854320.3482
Template load and register function0.00020.030710.0002
states
state_id_array0.00090.119910.0009
state_identifier_array0.00080.112120.0004
Override
Cache load0.00180.2456290.0001
Sytem overhead
Fetch class attribute can translate value0.00060.076320.0003
Fetch class attribute name0.00140.190640.0003
XML
Image XML parsing0.00070.098920.0004
class_abstraction
Instantiating content class attribute0.00000.001840.0000
General
dbfile0.00080.1069170.0000
String conversion0.00000.001240.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/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: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs