[ZDP] BackTalk to Document The Zope Book (2.5 Edition)/Advanced Page Templates

webmaster@zope.org webmaster@zope.org
Wed, 25 Sep 2002 17:30:09 -0400


A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZopeBook/current/AdvZPT.stx#4-17

---------------

        While it's been mentioned before, it's worth saying again: you
        can nest 'tal:repeat' statements inside each other. Each
        'tal:repeat' statement must have a different repeat variable
        name. Here's an example that shows a math times-table::

          <table border="1">
            <tr tal:repeat="x python:range(1, 13)">
              <div tal:repeat="y python:range(1, 13)"
                   tal:omit-tag="">
                <td tal:content="python:'%d x %d = %d' % (x, y, x*y)">
                  X x Y = Z
                </td>
              </div>
            </tr>
          </table>

          % Anonymous User - June 24, 2002 5:03 pm:
           Am I SUPPOSED to see only "X x Y = Z" in a table box?
           I see no times tables and no additional rows.
           what did I do wrong? I saved this code in an html file and uploaded it and saved it in a DTML Doc. Both had
           same result.

          % Anonymous User - June 24, 2002 5:12 pm:
           First, read http://www.zope.org/Documentation/ZopeBook/ZPT.stx . Then read your above comment to yourself
           aloud. Then think to yourself, "does DTML have anything whatsoever to do with ZPT?" (Hint: the answer is no).

          % Anonymous User - Sep. 25, 2002 5:30 pm:
           /must have/should have/ # nested repeats w the same name are not verboten! (blf)
           but occlusion of outer names by inner names here is in most cases not wanted.