Thanks, Mathew, for the response.  That looks easy enough.  Now, what if I have two nested tmpl_loops and I want to only apply the break tag on the first set of nested template loop date? 

For example:

<tmpl_loop albums>
<tmpl_loop pictures>
    <img src="<tmpl_var src>" alt="" />
   <tmpl_if expr="(__counter__ % 3) == 0 && PARENT_LOOP_COUNTER < 1"><br /></tmpl_if>


Can I "see" the counter for the parent loop inside the child loop?



----- Original Message ----
From: Mathew Robertson <>
To: Michael Greenish <>
Sent: Monday, April 30, 2007 7:31:07 PM
Subject: Re: [htmltmpl] loop counting

sure thing - but it does require using H::T::Expr.  I use the following snippet as-is to a gallery of photo's.  Notice the use of modulo (%).


<table width=100% border=0 cellpadding=1 cellspacing=1>
<TMPL_LOOP gallery>
<TMPL_IF EXPR="(__counter__ % 3) == 1">
<tr valign=top>
<td width=33% align=center valign=top class=text>
<a href="<TMPL_VAR>/<TMPL_VAR NAME=filename ESCAPE=URL>" title="Click to enlarge"><img alt="" src="<TMPL_VAR paths.thumbnail>/<TMPL_VAR NAME=filename ESCAPE=URL>" width=180 height=200 border=0></a><br>
<<TMPL_VAR spacer> width=10 height=6><br>
<TMPL_IF EXPR="(__counter__ % 3) == 0">
<td colspan=3>
<<TMPL_VAR spacer> height=18 width=100%>

Michael Greenish wrote:

I have a series of images that I would like to output but I want to limit it to only 4 images per row. I would like to put a br tag to force the 5th, 9th, etc... image to go to the next row. Can I do this completely int the template using an iterator or resettable counter?



Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around

This email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now. _______________________________________________ Html-template-users mailing list

Ahhh...imagining that irresistible "new car" smell?
Check out new cars at Yahoo! Autos.