[Zope] cookies + zpt

Jos van der Vleuten Jos.van.der.Vleuten@transiciel.nl
Wed, 2 Apr 2003 18:28:11 +0200


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>cookies + zpt</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>hello list,</FONT>
</P>

<P><FONT SIZE=3D2>I saw that the first time i send this question to the =
list it was in RTF-format and not nice readable, so i send it =
again.</FONT></P>

<P><FONT SIZE=3D2>I want to use something like the Zope tutorial lesson =
9 in ZPT, </FONT>
<BR><FONT SIZE=3D2>but i don't now how to do this. Any =
suggestions?</FONT>
<BR><FONT SIZE=3D2>This is the DTML version from the tutorial i'm =
talking about:</FONT>
</P>

<P><FONT SIZE=3D2>&lt;dtml-call =
expr=3D&quot;RESPONSE.setCookie('lastVisited', =
_.DateTime())&quot;&gt;</FONT>
</P>

<P><FONT SIZE=3D2>&lt;dtml-comment&gt;</FONT>
<BR><FONT SIZE=3D2>If this is their first time here set a default =
value</FONT>
<BR><FONT SIZE=3D2>for lastVisited, since they won't have the cookie =
yet.</FONT>
<BR><FONT SIZE=3D2>&lt;/dtml-comment&gt;</FONT>
</P>

<P><FONT SIZE=3D2>&lt;dtml-unless lastVisited&gt;</FONT>
<BR><FONT SIZE=3D2>&nbsp; &lt;dtml-call =
&quot;REQUEST.set('lastVisited','1999/01/01')&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;/dtml-unless&gt;</FONT>
</P>

<P><FONT SIZE=3D2>&lt;h2&gt;&lt;dtml-var title&gt;&lt;/h2&gt;</FONT>
</P>

<P><FONT SIZE=3D2>&lt;dtml-in =
&quot;sightingsFolder.objectValues()&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;dtml-if =
expr=3D&quot;bobobase_modification_time() &gt; =
_.DateTime(lastVisited)&quot;&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;b&gt;New&lt;/b&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;/dtml-if&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;dtml-var sequence-item&gt;</FONT>
<BR><FONT SIZE=3D2>&lt;/dtml-in&gt;</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>&gt; Jos van der Vleuten</FONT>
<BR><FONT SIZE=3D2>Programmeur / Analist </FONT>
<BR><FONT SIZE=3D2>&gt; <A HREF=3D"http://www.walcheren-online.net" =
TARGET=3D"_blank">http://www.walcheren-online.net</A></FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; UCC Business Solutions</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Buizerdlaan 2</FONT>
<BR><FONT SIZE=3D2>&gt; Postbus 1534</FONT>
<BR><FONT SIZE=3D2>&gt; Nieuwegein </FONT>
<BR><FONT SIZE=3D2>&gt; Telefoon +31 (0)30 6008600</FONT>
<BR><FONT SIZE=3D2>&gt; Fax +31 (0)30 6008601</FONT>
<BR><FONT SIZE=3D2>&gt; <A HREF=3D"http://www.ucc.nl" =
TARGET=3D"_blank">http://www.ucc.nl</A></FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Have a nice day !</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
</P>

</BODY>
</HTML>