[Zope] dtml-in size error

Nick Garcia ngarcia@codeit.com
Tue, 28 Mar 2000 16:05:51 -0800


Tino Wildenhain wrote:
> 
> hi Mauricio,
> 
> mauricio_sl@uol.com.br wrote:
> >
> > This one goes especialy to ho write zope.
> >
> > I have found that the dtml-in has a problem when you specify a batch-size that is less than the double of the length of the input list.
> > Ex.:
> > a list of 6 itens:
> > when size is 3, dtml-in returns 3 itens, correct. (3*2 <= 6) = true
> > when size is 4, dtml-in returns 6 itens, error. (4*2 <= 6) = false
> >
> > Is this a bug?
> This works for me (tested right at the moment with Zope 2.10)
> 
> <ul>
> <dtml-in "1,2,3,4,5,6" size="4">
> <li><dtml-var sequence-item>
> </dtml-in>
> </ul>

One thing you need to keep in mind is that dtml-in has an orphan
attribute that determines the minimum amount of items to print out.  If
orphan is set to 3 (default) and you have a list of 6 items, and you set
size=4, the dtml-in tag will realize that 2 is too little to have on one
page and so it displays all 6.

If you don't want this, set orphan=0 in the dtml-in.

-- 
Nick Garcia | ngarcia@codeit.com
CodeIt Computing | http://codeit.com