[ZPT] suggestion: content and/or silent repeat

Gary & Karyn Gary & Karyn" <garykaryn@earthlink.net
Mon, 30 Jul 2001 16:32:17 -0400


I don't see this suggestion this month in the archives...if this has already
been hashed out, forgive a newbie.

While working through Evan's tutorials (thank you!!), I was
somewhat...surprised...by the use of tbody in the following example in the
first tutorial:

      <table border="1" width="100%">
        <tr>
          <th>#</th><th>Id</th><th>Meta-Type</th><th>Title</th>
        </tr>
        <tbody tal:repeat="item container/objectValues">
          <tr bgcolor="#EEEEEE" tal:condition="repeat/item/even">
            <td tal:content="repeat/item/number">#</td>
            <td tal:content="item/id">Id</td>
            <td tal:content="item/meta_type">Meta-Type</td>
            <td tal:content="item/title">Title</td>
          </tr>
          <tr tal:condition="repeat/item/odd">
            <td tal:content="repeat/item/number">#</td>
            <td tal:content="item/id">Id</td>
            <td tal:content="item/meta_type">Meta-Type</td>
            <td tal:content="item/title">Title</td>
          </tr>
        </tbody>
      </table>

This seems surprisingly clunky for the graceful ZPT system--it produces
multiple tbody groupings incorrectly.  I tried to think of superior methods
with the tools given and merely came up with the usual "invisible" span and
div ideas found throughout the tutorial.  Not only are these inappropriate
logically (as markup) in this case but they seem likely to cause browser
issues as well.  SO...

The repeat statement repeats the given tag in which it is placed (in this
case tbody).  Why not also have a repeat method that repeats tag *content*,
and not the tag itself?  I perceive this as somewhat of a parallel to the
content/replace division.

Slightly more risky, and not well thought out yet: how about a completely
silent version of the repeat method that eliminates the containing tag while
repeating the inner content (the closest analog to replace)?

Has this been suggested and rejected before, or is my suggestion poorly
researched (i.e. already implemented)?  I'm subscribed to the digest, and
have not yet received one other than the original welcome, so I'll check the
archives regularly for awhile to see responses.

Thanks!

Gary Poster