[Zope] How to implement a round through the whole web site

Christian Leutloff leutloff@sundancer.oche.de
25 Aug 2000 15:00:59 +0200


Hi,

I want to add a round to a small Zope based web site. Therefor I would
like to add a prev and a next button on each page. So it is possible
to start on the first page and then move on to the next one by
clicking on the next button. After some clicks on the next button I'm
sure to have visited all pages. 

I want to realize this goal through adding an attribute named sequence
(´seq´) to every DTML document that should be reached through the
round. The value is a 4 digit number that defines the order in which
the pages should appear. Then I've started to implement a method using
DTML to generate the hyperlinks for prev/next. The strategy would be
to determine the sequence number of the actual document. Afterwards
all documents are searched and each id is compared to the actual
one. The results should be saved in variables that could be used to
set up the links after all documents have been processed.

My problem is now how to store the intermediate results in
variables. I'm able to define a variable (myseq), but I'm not able to change
the value afterwards:

<-------- snip
<dtml-call "REQUEST.set('myseq', 7L)">

<dtml-if "_.has_key('seq')"> 
<dtml-call "myseq = seq">  <-- wrong!!!
   Seq: <dtml-var seq>/
<dtml-else>
   sequence is missing!
</dtml-if>
<dtml-var myseq>
<-------- snap


What is the most efficient way to traverse all DTML documents in a
given branch of a Zope server? Today I use something like this:

<dtml-in "krawczak.objectItems('Folder')" sort=id>
<dtml-in "objectItems('Folder')" sort=id>
<dtml-in "objectItems('DTML Document')" sort=id>
<br> <dtml-var id>,
Properties:
<dtml-in "propertyMap()">
<dtml-var "_['sequence-item']['id']">,
</dtml-in>
</dtml-in>
</dtml-in>
</dtml-in>

Are there better solutions?


Do you know of a predefined way to implement the round through the web
site? 

Thank you
        Christian

-- 
Dipl.-Ing. Christian Leutloff, Aachen, Germany  christian@leutloff.de
   http://www.oche.de/~leutloff/                leutloff@debian.org

            Debian GNU/Linux - http://www.de.debian.org/