[Zope-dev] dtml-in: next-batches
Bryan Baszczewski
bryanbz@2s2i.com
Wed, 7 Mar 2001 19:05:07 -0500
I found this in some Zope documentation. It wont give you "1,2,3,4,5...10"
it gives "(1-10)(11-20)(21-30)...". Monkey with it a little and you'll get
it. Beware it will call your External Method or ZSQL as many times/10.
<dtml-in expr="SOME_EXTERNAL_METHOD(REQUEST)" previous orphan=1 size=10
start=qs>
<dtml-in previous-batches mapping>
<dtml-unless sequence-start>, </dtml-unless>
<a href="<dtml-var document_id><dtml-var sequence-query
>qs=<dtml-var batch-start-number>">
(<dtml-var batch-start-number> - <dtml-var batch-end-number>)</a>
</dtml-in>
</dtml-in>
<dtml-in expr="SOME_EXTERNAL_METHOD(REQUEST)" next orphan=1 size=10
start=qs>
<dtml-in next-batches mapping>
<dtml-unless sequence-start>, </dtml-unless>
<a href="<dtml-var document_id><dtml-var sequence-query
>qs=<dtml-var batch-start-number>">
(<dtml-var batch-start-number> - <dtml-var batch-end-number>)</a>
</dtml-in>
</dtml-in>
<dtml-in expr="SOME_EXTERNAL_METHOD(REQUEST)" orphan=1 size=10 start=qs>
<dtml-var sequence-index>)">
<dtml-var expr="_.getitem('sequence-item')[1]">
<dtml-var expr="_.getitem('sequence-item')[2]">
</dtml-in>
-Bryan
-----Original Message-----
From: zope-dev-admin@zope.org [mailto:zope-dev-admin@zope.org]On Behalf
Of Brett Carter
Sent: Wednesday, March 07, 2001 6:34 PM
To: zope-dev@zope.org
Subject: [Zope-dev] dtml-in: next-batches
Does anybody have an example of how to use the supposed next-batches
mapping returned by dtml-in?
I'm trying to build a google-like pageing feature into my application,
so we just show the first 5 results, then have a link to each next
page, ie "1,2,3,4..."
Thanks,
-Brett
_______________________________________________
Zope-Dev maillist - Zope-Dev@zope.org
http://lists.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://lists.zope.org/mailman/listinfo/zope-announce
http://lists.zope.org/mailman/listinfo/zope )