Is it a bug in ez?

Author Message

SathishKumar Subramanian

Friday 21 November 2003 9:53:13 pm

Hi,

I can get the $i increment in the following code

{let name=lang i=1}
{section loop=10}
{set i=sum($i,1)}
{$i}
{/section}
{/let}

But I am not getting the $i increment in

{let name=lang i=0}
{let language_list=fetch( content, tree, hash( parent_node_id, 44,
limit, $langCount,
sort_by, array( "priority", true() ),
class_filter_type, include,
class_filter_array, array(1) ) ) }
{section loop=$language_list} {* language list *}
{set i=sum($i,1)}
{$i}
{/section}
{/let}
{/let}

Pls help. :(

Sathizh

Marco Zinn

Tuesday 25 November 2003 7:10:48 am

You have a problem with namespaces.
The "$i", that you use inside the section is not the same as you define in the first line.

See http://www.ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/basics/namespaces_

and note http://www.ez.no/developer/ez_publish_3/documentation/development/libraries/ez_template/functions/section
If you just want a counter for the loop, you may use "index" or "number"

Marco
http://www.hyperroad-design.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 22:18:24
Script start
Timing: Jan 18 2025 22:18:24
Module start 'layout'
Timing: Jan 18 2025 22:18:24
Module start 'content'
Timing: Jan 18 2025 22:18:24
Module end 'content'
Timing: Jan 18 2025 22:18:24
Script end

Main resources:

Total runtime0.0152 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 589.2422152.6094
Module start 'layout' 0.00470.0036 741.851639.4141
Module start 'content' 0.00830.0049 781.265689.3047
Module end 'content' 0.01320.0019 870.570330.3047
Script end 0.0152  900.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002516.5561140.0002
Check MTime0.00106.8608140.0001
Mysql Total
Database connection0.00064.109210.0006
Mysqli_queries0.002818.672730.0009
Looping result0.00000.183410.0000
Template Total0.001510.110.0015
Template load0.00085.307110.0008
Template processing0.00074.755210.0007
Override
Cache load0.00053.602810.0005
General
dbfile0.00021.625880.0000
String conversion0.00000.061140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs