Hi Todd, Id suggest you grab a copy of the Zope book! Check out: http://www.zope.org/Members/michel/ZB It comes in many different formats, but the printed version from your local bookstore will help support a couple of nice resources :) Here's what I found on page 63: <table> <dtml-in expr="objectValues('File')"> <dtml-if sequence-even> <tr bgcolor="grey"> <dtml-else> <tr> </dtml-if> <td> <a href="&dtml-absolute_url;"><dtml-var title_or_id></a> </td></tr> </dtml-in> </table> The key bit here is the <dtml-if sequence-even> block. Add a <dtml-else> block if you need to specify a second color. Happy Zoping! Eric.
-----Original Message----- From: Todd Loomis [mailto:tloomis@dmso.mil] Sent: Thursday, August 09, 2001 1:51 PM To: eric@walstads.net Subject: RE: [Zope] Help with expr
Eric:
Thanks, ending up using the limit in my SQL statement thru Zope. When I tried <dtml-in get_story end=5> it gave just 1 record. Have one last question: Can you the rows to have a different back ground color in the table?
Todd
At 12:53 PM 8/9/2001 -0700, you wrote:
Hi Todd, I've never tried to use a limit (yet) but the dtml-in syntax includes an 'end=n' (<dtml-in get_story end=5>) parameter that may do what you want (I'm not sure what it does :). If that doesn't work, check out the Zope Book for details on DTML in. Also, if your "get_story" list is generated from a SQL, it will likely be more efficient to let the SQL call limit the results so that Zope doesn't have to. HTH, Eric.
Also is their a way to limit this to just show the first 5.
Todd At 12:06 PM 8/9/2001 -0700, you wrote:
Hi Todd, My guess is that you code is doing string comparisons rather than ZopeTime comparisons. It might work if you remove the .strftime() method from the logic portions. Eric.
<dtml-in get_story> <dtml-if expr="ZopeTime(end) > ZopeTime() and ZopeTime(start) <= ZopeTime()"> <dtml-var title> </dtml-if> </dtml-in>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Todd Loomis Web Developer (SAIC) Defense Modeling & Simulation Office 1901 N. Beauregard Street, Suite 500 Alexandria, VA 22311 Office: 703.824.3407 Fax: 703.379.3778 tloomis@dmso.mil