Hi, suppose I have folder gallery that contains 40 photos. I want to make a DTML page that previews these photos. Suppose I want to load 15 photos each view and I want to arrange that 15 photos into 5 columns and 3 rows format... how do I accomplish that? I have read the example in Zope book about batch processing, but in my case I guess I have to make other loops in the batch loop ( 2 more loops I guess). But I am confused about the inner loops: over what object should the inner loops interate? Thanks. -- Mico Siahaan ------------- mico@intermatik.co.id
On Wed, 2003-11-26 at 02:38, Mico Siahaan wrote:
Hi, suppose I have folder gallery that contains 40 photos. I want to make a DTML page that previews these photos. Suppose I want to load 15 photos each view and I want to arrange that 15 photos into 5 columns and 3 rows format... how do I accomplish that? I have read the example in Zope book about batch processing, but in my case I guess I have to make other loops in the batch loop ( 2 more loops I guess). But I am confused about the inner loops: over what object should the inner loops interate?
You'll need to use the "prefix" attribute of dtml-in so that you can distinguish one loop's objects from the others. Ex: <dtml-in rows prefix=row> <tr> <dtml-in cols prefix=col> <td><dtml-var "my_thing(col_item, row_item)"></td> </dtml-in> </tr> </dtml-in> HTH, Dylan
Hello Mico, you probably do not want to use several dtml-in loops. Better use a counter to insert the line breaks. <dtml-in allImages size=bs start=qs orphan=0 prefix=seq> <dtml-if seq_start> <table> <tr> </dtml-if> <dtml-if "seq_index > 0 and seq_index % 3 == 0"> </tr><tr> </dtml-if> <td><dtml-var "seq_item.tag()"></td> <dtml-if seq_end> </tr> </table> </dtml-if> </dtml-in> with appropriate links for next and prev batches you should get nice three columns tables, with as many rows as needed for bs images. Hope it helps Ulrich -- World Wide Web Publisher, Ulrich Wisser, Vallatorpsv.158, S-18752 Täby http://www.publisher.de Tel: +46-8-53460905 Fax: +46-8-534 609 06
participants (3)
-
Dylan Reinhardt -
Mico Siahaan -
Ulrich Wisser