Fog Creek Software
Fog Creek Software

CityDesk 2.0-Documentation
Fancy Loops

Ordinary loops simply repeat their body once for each article that matches the condition. For special effects, you can create loops with special behavior:

The complete syntax is:

{$ forEach n var in (condition) sort-order $}
.... text which appears for each item ....
{$ between $}
.... text which appears between each two items ....
{$ odd $}
.... text which appears for every other item, including the first ....
{$ even $}
.... text which appears for every other item, starting with the second ....
{$ else $}
.... text which appears if there are no items matching condition ....
{$ before $}
.... text which appears before the loop, only if there are items matching condition ....
{$ after $}
.... text which appears after the loop, only if there are items matching condition ....
{$ next $}

Each of these sections is optional.

CityDesk Documentation -  Home


©Copyright 2001-2003 Fog Creek Software, Inc. All Rights Reserved.