Zope cannot find the tutorial examples. You should install the tutorial examples before continuing. Choose "Zope Tutorial" from the product add list in the Zope management screen to install the examples.
If you have already installed the tutorial, you can either follow along manually, or reinstall the tutorial examples. Note: make sure that you have cookies turned on in your browser.So we've seen that the
sightingspage is built from objects in the
sightingsFolderfolder. How does it work?
sightingsdocument to edit it.
<dtml-var standard_html_header> <h2><dtml-var title></h2> <table border="1"> <dtml-in expr="sightingsFolder.objectValues()"> <tr><td> <dtml-var sequence-item> </td></tr> </dtml-in> </table> <dtml-var standard_html_footer>
Notice how each sighting now has a box drawn around it.
What's going on? The <dtml-in> tag iterates over a list of
objects. The <
dtml-var sequence-item> tag inserts the
current object. The
expr="sightingsFolder.objectValues()" part of
the <dtml-in> tags tells it how to get a list of objects. It
objectValues method of the
objectValues returns all the objects contained by a folder.
You can programmatically build web pages with groups of objects by looping over them and inserting them.
dtml-var sequence-item> inserts the current object when looping over a list of objects.
In the next lesson you'll learn about how to manage and display pictures.
Comments on this lesson? Email feedback.