Lesson 7. Elvis Photo Archive

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.

The King had many faces. We can offer our site visitors a peek at the many sides of Elvis with a photo archive.
  1. Click the photos.html template.
  2. Click the Test tab to view it.

This page shows the photos in the archive one after another. It uses Image objects stored in the photoArchive folder. It's not very fancy. Let's improve it to display the title and size of the photos.

  1. Click your browser's back button to return to the photos.html template to edit it.
  2. Change the contents to:
    <html>
    
    <p tal:repeat="photo container/photoArchive/objectValues"> 
      <img tal:replace="structure photo">
      <span tal:replace="photo/title">title</span>
      (<span tal:replace="photo/getSize">size</span> bytes)
    </p>
    
    </html>
  3. Click the Save Changes button.
  4. Click the Test tab.

Notice how each photo now includes a title and size information.

Summary

Images can display themselves and can also provide useful information such as size, title, and URL.

In the next lesson you'll learn how to create pictures with Python scripting.