[Zope] Help Needed for creating : Page 1 2 3 4 Previous:Next

Holger Hoffmann hohoff@rz.uni-potsdam.de
Mon, 24 Jul 2000 14:35:40 +0200


Hi,

Peter Marriott wrote:
> 
> Hi,
> 
> I would really appreciate it if someone could point me to some example dtml
> that gives navigation links like the following at the bottom of a list of
> items.
> 
> Page 1 2 3 4 5    Previous:Next   (with the current page highlighted bold)

it is ugly, but it works for me ...
the following creates links like:

[ << previous ]  1  2  3  4  5  6  7  8  [ next >> ] 



<dtml-call "REQUEST.set('i', 1)">

<dtml-in somelist previous size=10 start=qs>
<a href="<dtml-var URL><dtml-var sequence-query>qs=<dtml-var
previous-sequence-start-number>">[ << previous ]</a>&nbsp;&nbsp;&nbsp;
</dtml-in>

<dtml-in somelist previous size=10 start=qs>
<dtml-in previous-batches mapping>
<a href="<dtml-var URL><dtml-var sequence-query>qs=<dtml-var
batch-start-number>"><dtml-var i></a>&nbsp;
<dtml-call "REQUEST.set('i',i+1)">
</dtml-in>
</dtml-in>

<dtml-var i>&nbsp;
<dtml-call "REQUEST.set('i', i+1)">

<dtml-in somelist next size=10 start=qs>
<dtml-in next-batches mapping>
<a href="<dtml-var URL><dtml-var sequence-query>qs=<dtml-var
batch-start-number>"><dtml-var i></a>&nbsp;
<dtml-call "REQUEST.set('i',i+1)">
</dtml-in>
</dtml-in>

<dtml-in somelist next size=10 start=qs>
&nbsp;&nbsp;&nbsp;<a href="<dtml-var URL><dtml-var
sequence-query>qs=<dtml-var next-sequence-start-number>">[ next >> ]</a>
</dtml-in>

... Holger