Exclude first instance in section

Author Message

Luc Chase

Thursday 28 April 2005 3:03:46 pm

How would I exclude the first instance in this inner section?

{section name=Path loop=$array}
{section show=eq(1,$Path:item.value)}
<p>"Should show only from second time. eq(1,$myValue) is True". i.e. Skip first time true.</p>
{/section}
{/section}
{section name=Path loop=$array offset=1}

is NOT what I need here.

The Web Application Service Provider

Luc Chase

Thursday 28 April 2005 6:08:54 pm

solved:

{let ii=0}
{section name=Path loop=$array}
 {section show=eq(1,$Path:item.value)}
  {set ii=$:ii|inc}
    {section show=$:ii|gt(1)}
      <p>"Should show only from second time. eq  (1,$myValue) is True". i.e. Skip first time true.</p>
     {/section}
    {/section}
 {/section}
{/let}

The Web Application Service Provider

Craig Hirsch

Monday 09 May 2005 6:38:19 am

You might also make use of the $:index and $:number values that are set and incremented automatically inside each section that's looping (they're the same except that $:index starts at 0 and $:number starts with 1).

--
chirsch{AT}gmail{d.t}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 31 2025 06:21:56
Script start
Timing: Jan 31 2025 06:21:56
Module start 'layout'
Timing: Jan 31 2025 06:21:56
Module start 'content'
Timing: Jan 31 2025 06:21:57
Module end 'content'
Timing: Jan 31 2025 06:21:57
Script end

Main resources:

Total runtime0.8085 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.0051 588.1406151.2109
Module start 'layout' 0.00510.0029 739.351636.6641
Module start 'content' 0.00800.7997 776.0156924.6641
Module end 'content' 0.80770.0007 1,700.67977.8438
Script end 0.8085  1,708.5234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3837160.0002
Check MTime0.00130.1618160.0001
Mysql Total
Database connection0.00060.075110.0006
Mysqli_queries0.758493.8044570.0133
Looping result0.00050.0667550.0000
Template Total0.781196.620.3906
Template load0.00200.252320.0010
Template processing0.779196.359820.3895
Template load and register function0.00130.163510.0013
states
state_id_array0.00090.109810.0009
state_identifier_array0.00080.094420.0004
Override
Cache load0.00170.2105130.0001
Sytem overhead
Fetch class attribute can translate value0.00050.065820.0003
Fetch class attribute name0.00290.360940.0007
XML
Image XML parsing0.00170.213920.0009
class_abstraction
Instantiating content class attribute0.00000.001740.0000
General
dbfile0.00170.2138160.0001
String conversion0.00000.000740.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
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.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: 12
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs