[ZPT] table loop

Georges J Baladi Jr Georges J Baladi Jr" <georges@madisoncomunicacao.com.br
Wed, 15 Aug 2001 15:36:59 -0300


This is a multi-part message in MIME format.

------=_NextPart_000_027A_01C125A0.1F8109F0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

I have the follow situation:

a folder with 19 images
a page template that display the images inside a table. I want to put 5 =
images in a row.

I try this:

<table width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0">
  <tr tal:repeat=3D"thumb python:here.conteudo.objectValues('Image')" =
tal:omit-tag=3D"python:path('repeat/thumb/index')%5!=3D0">
      <td><img src=3D"/images/papel/campeonato.jpg" width=3D"100" =
height=3D"75" tal:replace=3D"structure thumb"></td>=20
   </tr>
 </table>

but omit-tag remove the start AND the end tr when the condition is true =
and my page display 4 rows (one with 1 image, 1 with 4 images, 1 with 1 =
image and 1 with 4 images). I tried with tal:condition to, but I can=B4t =
do what I want. Can I control the start OR the end tag?

I think Zope and ZPT are the best solution for web publishing. It=B4s an =
excellent software.

thanks,

Georges Baladi


------=_NextPart_000_027A_01C125A0.1F8109F0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I have the follow =
situation:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>a folder with&nbsp;19 =
images</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>a page template that display the images =
inside a=20
table. I want to put 5 images in a row.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I try this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;table width=3D"100%" border=3D"0" =
cellspacing=3D"0"=20
cellpadding=3D"0"&gt;<BR>&nbsp;&nbsp;&lt;tr&nbsp;tal:repeat=3D"thumb=20
python:here.conteudo.objectValues('Image')"&nbsp;tal:omit-tag=3D"python:p=
ath('repeat/thumb/index')%5!=3D0"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;td&gt;&lt;img&nbsp;src=3D"/images/papel/campeonato.jpg"&nbsp;width=3D=
"100"=20
height=3D"75" tal:replace=3D"structure thumb"&gt;&lt;/td&gt; =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; &lt;/tr&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&lt;/table&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>but omit-tag&nbsp;remove the =
start&nbsp;AND the end=20
tr when the condition is true and my page display 4 rows (one with 1 =
image, 1=20
with 4 images, 1 with 1 image and 1 with 4 images). I tried with =
tal:condition=20
to, but I can=B4t do what I want. Can I control the start&nbsp;OR the =
end=20
tag?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I think Zope and ZPT are the best =
solution for web=20
publishing. It=B4s an excellent software.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Georges Baladi</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_027A_01C125A0.1F8109F0--