[Zope] Batch Processing, final
Tom Deprez
tom.deprez@uz.kuleuven.ac.be
Fri, 11 Aug 2000 14:21:14 +0200
Pfew, I managed to implement the thing I wanted. However I'm not satisfied.
There must be an easier solution. If somebody knows which, then please let
me know! Thanks. Here is the code I use to display something like in a
search result :
Previous 1 2 3 4 5 6 Next
<dtml-in address_lookup size=5 start=query_start>
<dtml-if sequence-start>
<p>Search Result : <dtml-var count-CENTRE_NO> matches<p>
<table width="100%">
<tr>
<td align="left" width="60">
<!-- if not first page then show previous button -->
<dtml-if previous-sequence>
<a href="<dtml-var URL><dtml-var
sequence-query>query_start=<dtml-var previous-sequence-start-number>">
<dtml-var "gif_previous.tag(border='0')"></a>
</dtml-if>
</td>
<td align="center">
<!-- show previous page numbers -->
<dtml-in address_lookup previous size=5 start=query_start>
<dtml-in previous-batches mapping>
<a href="<dtml-var document_id><dtml-var
sequence-query>query_start=<dtml-var batch-start-number>">
<dtml-var
"(_.getitem('batch-start-index',0)/_.getitem('batch-size',0))+1"></a>
</dtml-in>
</dtml-in>
<!-- show present page number-->
<dtml-var
"(_.getitem('sequence-index',0)/_.getitem('sequence-step-size',0))+1"></a>
<!-- show next pages numbers-->
<dtml-in address_lookup next size=5 start=query_start>
<dtml-in next-batches mapping>
<a href="<dtml-var document_id><dtml-var
sequence-query>query_start=<dtml-var batch-start-number>">
<dtml-var
"(_.getitem('batch-start-index',0)/_.getitem('batch-size',0))+1"></a>
</dtml-in>
</dtml-in>
</td>
<td align="right" width="60">
<!-- if not last page then show next button -->
<dtml-if
"((_.getitem('sequence-index',0)+_.getitem('sequence-step-size',0))+1) <
(_.getitem('count-CENTRE_NO',0))">
<a href="<dtml-var URL><dtml-var
sequence-query>query_start=<dtml-var
"(_.getitem('sequence-index',0)+_.getitem('sequence-step-size',0))+1">">
<dtml-var "gif_next.tag(border='0')"></a>
</dtml-if>
</td>
</tr>
</table>
</dtml-if sequence-start>
.... show present page results ...
</dtml-in>
Regards, Tom.