[Zope] Design/DTML question
Hi everyone, I'm working on a Web page for our local school board. I'd like to create a table that would display links to past board meeting minutes. The table would look like this: (Note: dates are bogus) +---+ | Meeting Minutes | | | | Monday, Jan. 10 Monday, Mar. 7 | | Tuesday, Jan. 24 Monday, Mar. 20 | | Monday, Feb. 7 Monday, Apr. 5 | | Monday, Feb. 27 Tues., Apr. 19 | | | |1999 | 2000 | 2001 | +---+ By default, dates for the current year would be displayed, but clicking on the years at the bottom of the table would display those dates. Right now, I've got the dates stored in a TinyTable. I can iterate through that list and generate the links, but I can't figure out how to display the table in two columns. dtml-in meetingDateTable trtddtml-var meeting_date/td/tr /dtml-in will print the dates in a single column, but how can I iterate through and refer to two different dates in one dtml-in pass? (Does that make sense?) The second thing I'm tring to figure out is how to make the year links at the bottom generate the new table of dates from a different TinyTable. Maybe I should use the same TinyTable for all of the meeting dates and pull out whichever year I need when the table is rendered. I'm also wondering if I should implement these meeting minutes and agendas in a ZClass. At first it seemed like this would be too simple to bother with, but now I'm wondering if a ZClass would be a better approach. I'd appreciate any comments. -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/ W. St. Paul, MN | | http://slashdot.org/ [EMAIL PROTECTED] | dtml-var pithy_quote | http://linux.com/ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Design/DTML question
From: Timothy Wilson [mailto:[EMAIL PROTECTED]] Right now, I've got the dates stored in a TinyTable. I can iterate through that list and generate the links, but I can't figure out how to display the table in two columns. table width=100% border=0 cellpadding=4 tr align=left valign=top dtml-in meetingDateTable dtml-if sequence-eventr align=left valign=top/dtml-if td width=50% dtml-var meeting_date /td dtml-if sequence-enddtml-if sequence-even td width=50% !-- an empty cell --/td /tr /dtml-if/dtml-if dtml-if sequence-odd/tr/dtml-if /dtml-in /table regards Max M ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Design/DTML question
At 1/10/01 04:44 PM, Max Mller Rasmussen wrote: From: Timothy Wilson [mailto:[EMAIL PROTECTED]] Right now, I've got the dates stored in a TinyTable. I can iterate through that list and generate the links, but I can't figure out how to display the table in two columns. alternating column solution by Max M deleted for brevity Or, if you insist that dates flow down the columns like I do, you could use this untested revision of Max's solution: table width=100% border=0 cellpadding=4 tr align=left valign=top td width=50% dtml-in meetingDateTable dtml-if "_.int(_['sequence-index'])*2==_.int(_['count-id']) or _.int(_['sequence-index'])*2==_.int(_['count-id'])+1" /tdtd width=50% !-- moved to next column -- /dtml-if dtml-var meeting_datebr /dtml-in /td /tr /table Gosh, wouldn't it be nice to have a sequence-midpoint ? But then somebody would surely want a sequence-first-quartile and so on :-) -- Dennis Nichols [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Design/DTML question
On Wed, 10 Jan 2001, Dennis Nichols wrote: Or, if you insist that dates flow down the columns like I do, you could use this untested revision of Max's solution: table width=100% border=0 cellpadding=4 tr align=left valign=top td width=50% dtml-in meetingDateTable dtml-if "_.int(_['sequence-index'])*2==_.int(_['count-id']) or _.int(_['sequence-index'])*2==_.int(_['count-id'])+1" /tdtd width=50% !-- moved to next column -- /dtml-if dtml-var meeting_datebr /dtml-in /td /tr /table This doesn't seem to work. The if statement only evaluates to true the first time through the loop. I agree that the dates must flow down, so don't I need to have some way to do the following: table dtml-in meetingDateTable tr tddtml-var meeting_date/td tddtml-var meeting_date[some later index]/td /tr /dtml-in /table It's the [some later index] part that would seem to be the bugger. Doable? Perhaps this would be a perfect application for a PythonScript? -Tim -- Tim Wilson | Visit Sibley online: | Check out: Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/ W. St. Paul, MN | | http://slashdot.org/ [EMAIL PROTECTED] | dtml-var pithy_quote | http://linux.com/ ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Design/DTML question
At 1/10/01 01:22 PM, Timothy Wilson wrote: On Wed, 10 Jan 2001, Dennis Nichols wrote: Or, if you insist that dates flow down the columns like I do, you could use this untested revision of Max's solution stuff removed This doesn't seem to work. The if statement only evaluates to true the first time through the loop. Because the objects in the loop had no 'id' attribute? In any case, here's a complete tested example: dtml-var standard_html_header dtml-call "REQUEST.set('meetingDateTable',['first','second','third','fourth','fifth'])" table border=1 cellpadding=4 tr align=left valign=top td width=50% dtml-in meetingDateTable dtml-if "_.int(_['sequence-index'])*2==_.len(meetingDateTable) or _.int(_['sequence-index'])*2==_.len(meetingDateTable)+1" /tdtd width=50% !-- moved to next column -- /dtml-if dtml-var sequence-itembr /dtml-in /td /tr /table dtml-var standard_html_footer -- Dennis Nichols [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
RE: [Zope] Design/DTML question
From: Timothy Wilson Or, if you insist that dates flow down the columns like I do, you could use this untested revision of Max's solution: Oh typical spine reaction I didn't read the dates, just assumed that it was left/right as usual. This untested code might work then: (The no-break tag nobr is really underestimated. It can save loads of table tags.) table tr tdnobr dtml-if "_['sequence-index'] = (_['batch-size']/2)" dtml-var meeting_date /dtml-if td tr tr tdnobr dtml-if "_['sequence-index'] (_['batch-size']/2)" dtml-var meeting_date /dtml-if td /tr /table Max M. W. Rasmussen,Denmark. New Media Director private: [EMAIL PROTECTED] work: [EMAIL PROTECTED] - Specialization is for insects. - Robert A. Heinlein ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )