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? Best Regards, Mauricio Souza Lima - Hiperlógica mauricio@hiper.com.br - www.hiper.com.br
mauricio_sl@uol.com.br wrote:
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.
Adding an "orphan=0" tag inside the dtml-in should do it: <dtml-in foo orphan=0> . . . bar . . . </dtml-in> A more general question for the list, though: Shouldn't the default orphan value be zero? It seems to me that if someone explicitly says "I want three items," it should be more of a special case that they'd somehow want more . . . -CJ
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> best regards Tino Wildenhain
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
participants (4)
-
Christopher J. Kucera -
mauricio_sl@uol.com.br -
Nick Garcia -
Tino Wildenhain