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.People who come to your site want a personal relationship with Elvis. You can provide this by tailoring your site to your viewer's needs and preferences. Let's add the ability to bring new Elvis sightings to the attention of site visitors. This way when a visitor comes to your site they'll immediately know which sightings are new since they last visited.
sightingsdocument to edit it.
Viewtab to view it.
All the sightings should be marked as New.
Now none of the sightings should be marked as New. This is because you've already seen them.
sightingsFolderfolder to enter it.
DTML Methodfrom the "Select type to add..." list.
Seattlefor the id. Since the title is optional and isn't really needed in this case, leave the title field blank.
Add and Editbutton.
<p>6/1/2000 -- Seattle</p> <p>Elvis spotted spare changing on Broadway. He denied being the King.</p>
Now you've created a new sighting. Let's see if it is marked as new by the sightings page.
sightingsdocument in the
Sure enough our new sighting is marked New.
How does this work? It uses HTTP Cookies. When you visit the
sightings page a cookie is set that records the current time. Then
each time you return to the page sightings that are newer than the
cookie will be marked as new.
Let's look at the DTML for the
sightings page to see how this is
sightingsdocument to view its contents.
The document sets a cookie with this code:
<dtml-call expr="RESPONSE.setCookie('lastVisited', _.DateTime())">
The document checks each sighting when displaying it to see if it is
newer than the
<dtml-if expr="bobobase_modification_time() > _.DateTime(lastVisited)">
bobobase_modification_timemethod returns the last modification time of an object.
In the next lesson you'll learn how to create a mail feedback form.
Comments on this lesson? Email feedback.