[ZDP] BackTalk to Document The Zope Book (2.6 Edition)/Using Zope Page Templates

webmaster at zope.org webmaster at zope.org
Mon Nov 24 16:47:58 EST 2003


A comment to the paragraph below was recently added via http://zope.org/Documentation/Books/ZopeBook/2_6Edition/ZPT.stx#2-61

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

    The interesting part is the 'tal:repeat' attribute on the 'tr'
    HTML tag.  This attribute tells the template to iterate over the
    values returned by "container/files", which is the Python script
    you created in the current folder (the "container"), which returns
    a list of Zope objects.  The repeat tag causes Zope to create a
    new table row with columns representing a bit of metadata about
    each of those objects.  During each iteration, the current file
    object being iterated over is assigned the name 'item'.

      % Anonymous User - Nov. 20, 2003 9:41 am:
       With each pass through the loop the tal:repeat attribute creates a variable/property/thing named 'item' (this
       is an arbitrarily chosen name, it could be named anything) and pushes it into the namespace stack?
       This variable/property/thing references one of the file which was returned by the python script?

       On the first pass through the loop 'item' represents the first file returned by the python script?
       On the second pass through the loop 'item' represents the second file returned by the python script? etc...?

      % Anonymous User - Nov. 24, 2003 4:47 pm:
       the loop creates a "file" object and assigns it the name "item".
       You could call it george, tom , sally or foo. 
       On the first pass through the loop 'item' is an object which contains information about the first file ...



More information about the ZDP mailing list