Forums / Developer / Exclude first instance in section

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