[Zope] How to set an 'index' in batch display?

Dieter Maurer dieter@handshake.de
Sun, 17 Mar 2002 20:36:00 +0100


dvl writes:
 > ....
 > In other words:
 > The query already detects that image n6c117 is from date 02/02/1796.
 > <dtml-var count-date> even gives the correct number of images for that
 > day, let's say the count for date 02/02/1796 is 11 images: n6c111
 > through n6c121.
 > 
 > Basically i have two questions, i think:
 > How can i calculate the 'index' number of image n6c117 (that is: 7
 > from 11)
You bind the query result to a name and search through it for your
image. It's better to do this in a Python Script than in DTML.
In DTML, you would use "REQUEST.set('index', index+1)" to count
while moving through your sequence.

 > How can i set that index in the lines
 > <dtml-in expr="Query(date=(_.str(date)))" size=1 start=qs>
 > <dtml-in expr="Query(date=(_.str(date)))" next size=1 start=qs>
 > 
 > Things like 'start=im' etc don't seem to work here.
That should work.

However, you need to be careful for next and previous batches.
For them, you should not search for your image and start there!


Dieter