Hi my problem is that Im setting my batch size to 3, yet I keep getting 5 items. As a matter of fact, sometimes I get 4 when asking for 2 and so on. Here's what Im using: <dtml-call "REQUEST.set('day3', ZopeTime().Day())"> <dtml-if "day2 == 'Monday'"><dtml-call "REQUEST.set('daysfolder3', cindycity)"></dtml-if> <dtml-if "day2 == 'Tuesday'"><dtml-call "REQUEST.set('daysfolder3', techbytes)"></dtml-if> <dtml-if "day2== 'Wednesday'"><dtml-call "REQUEST.set('daysfolder3', techbytes)"></dtml-if> <dtml-if "day2== 'Thursday'"><dtml-call "REQUEST.set('daysfolder3', cindycity)"></dtml-if> <dtml-if "day2 == 'Friday'"><dtml-call "REQUEST.set('daysfolder3', techbytes)"></dtml-if> <dtml-if "day2 == 'Saturday'"><dtml-call "REQUEST.set('daysfolder3', techbytes)"></dtml-if> <dtml-if "day2 == 'Sunday'"><dtml-call "REQUEST.set('daysfolder3', behindscenes)"></dtml-if> <dtml-if daysfolder3> <dtml-with news88><dtml-with daysfolder3> <dtml-in ranked_stories size=3><br> <font size=2><dtml-if headline><A HREF="/<dtml-var section>/<dtml-with daysfolder3>&dtml-id;</dtml-with>/&dtml-id;"><b><dtml-var headline></b></a></dtml-if></font> <font size=1> from <a href="/<dtml-var section>/<dtml-var subsection>/index"><i><dtml-var subsectionname></i></a></font><br> <font size=1> <dtml-if time><dtml-var time fmt=pCommonZ></dtml-if></font><br> <font size=2> <dtml-if shortstory><dtml-var shortstory></dtml-if></font> <hr size=1 width=90%> </dtml-in> </dtml-with> </dtml-with> </dtml-if> The file "ranked_stories" is a python method: return self.selectItems( self.story_list() ) "story_list" is also a python method: result = [] for item in self.objectValues( [ 'DTML Document' ] ): if item.hasProperty( 'publish' ): result.append( item ) return result Thanks in advance. Tom Scheidt | www.falsemirror.com | tom@falsemirror.com ---------------------------------------------------------------------------- -----------
from the DTML reference page 41, regarding <dtml-in>: the default setting for the orphan attribute is 3. So you might try: <dtml-in ranked_stories size=3 orphan=0 > -- Jim Washington Tom Scheidt wrote:
Hi my problem is that Im setting my batch size to 3, yet I keep getting 5 items. As a matter of fact, sometimes I get 4 when asking for 2 and so on. Here's what Im using:
[code snipped]
Thanks in advance. Tom Scheidt | www.falsemirror.com | tom@falsemirror.com
----- Original Message ----- From: Tom Scheidt <tom@falsemirror.com> To: <zope@zope.org> Sent: Wednesday, June 21, 2000 6:35 PM Subject: [Zope] DTML-IN Question
Hi my problem is that Im setting my batch size to 3, yet I keep getting 5 items. As a matter of fact, sometimes I get 4 when asking for 2 and so on. Here's what Im using:
<snip a lot ... :)>
<dtml-in ranked_stories size=3><br> <font size=2><dtml-if headline><A HREF="/<dtml-var section>/<dtml-with daysfolder3>&dtml-id;</dtml-with>/&dtml-id;"><b><dtml-var headline></b></a></dtml-if></font> <font size=1> from <a href="/<dtml-var section>/<dtml-var subsection>/index"><i><dtml-var subsectionname></i></a></font><br> <font size=1> <dtml-if time><dtml-var time fmt=pCommonZ></dtml-if></font><br> <font size=2> <dtml-if shortstory><dtml-var shortstory></dtml-if></font> <hr size=1 width=90%> </dtml-in>
try: <dtml-in ranked_stories mapping size=3> And maybe is bettrer tu add 'start' attribute. (UNtested)
The file "ranked_stories" is a python method:
return self.selectItems( self.story_list() )
"story_list" is also a python method:
result = [] for item in self.objectValues( [ 'DTML Document' ] ): if item.hasProperty( 'publish' ): result.append( item ) return result
PM
participants (3)
-
Jim Washington -
Marcel Preda -
Tom Scheidt