[Zope] tal:repeat

Casey Duncan casey@zope.com
Mon, 29 Apr 2002 15:50:14 -0400


 Maybe something like:

<table>
  <tr tal:define=3D"subfolders python:container.objectValues('Folder')">
    <span tal:repeat=3D"folder subfolders" tal:omit-tag=3D"">
      <td tal:attributes=3D"bgcolor python:('yellow','red')[here is folde=
r]"
           tal:content=3D"folder/title>
        Title
      </td>
    </span>
  </tr>
</table>

It relies on the fact the "here is folder" always returns either a 1 or a=
 0

hth,

Casey

On Monday 29 April 2002 03:13 pm, Tom Nixon allegedly wrote:
> I am using this code to generate a navigation bar. I need to have a
> different bgcolor attribute on the td if we're already in that folder.
> In other words, I need to do tal:attributes=3D"bgcolor string:red" but
> only where folder =3D=3D here. The condition only applies to the bgcolo=
r
> attribute so I'm not sure where it goes. Any ideas?
>=20
> <table>
>   <tr tal:define=3D"subfolders python:container.objectValues('Folder')"=
>
>     <td tal:repeat=3D"folder subfolders" bgcolor=3D"yellow">
>       <span tal:replace=3D"folder/title">Title</span>
>     </td>
>   </tr>
> </table>
>=20
>=20
>=20
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>=20