Hello... I am trying to assign a value to a variable, but I`m having problems with it. I just want to make a table with diferent colors... like the example: <!--#let cor="'FALSE'"--><!--#/let--> <table> <dtml-in "especialidade.objectValues()"> <dtml-if "cor == 'FALSE'"> <!--#let cor="'TRUE'"--><!--#/let--> <tr bgcolor="#EEEEEE"> <dtml-else> <!--#let cor="'FALSE'"--><!--#/let--> <tr bgcolor="#007CC3"> </dtml-if> </dtml-in> </table> How can I make this work? Thanks. ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
How about (untested, but should work): <table> <dtml-in "especialidade.objectValues()"> <dtml-if sequence-odd> <tr bgcolor="#EEEEEE"> <dtml-else> <tr bgcolor="#007CC3"> </dtml-if> </dtml-in> </table> You could also use sequence-even instead. hth Phil ----- Original Message ----- From: "After Dark" <afterz@zipmail.com> To: <zope@zope.org> Sent: Wednesday, March 28, 2001 3:46 PM Subject: [Zope] Variables...
Hello... I am trying to assign a value to a variable, but I`m having problems with it. I just want to make a table with diferent colors... like the example:
<!--#let cor="'FALSE'"--><!--#/let--> <table> <dtml-in "especialidade.objectValues()"> <dtml-if "cor == 'FALSE'"> <!--#let cor="'TRUE'"--><!--#/let--> <tr bgcolor="#EEEEEE"> <dtml-else> <!--#let cor="'FALSE'"--><!--#/let--> <tr bgcolor="#007CC3"> </dtml-if> </dtml-in> </table>
How can I make this work?
Thanks. ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
_______________________________________________ Zope maillist - Zope@zope.org 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 )
<!--#let cor="'FALSE'"--><!--#/let--> <table> <dtml-in "especialidade.objectValues()"> <dtml-if "cor == 'FALSE'"> <!--#let cor="'TRUE'"--><!--#/let--> <tr bgcolor="#EEEEEE"> <dtml-else> <!--#let cor="'FALSE'"--><!--#/let--> <tr bgcolor="#007CC3"> </dtml-if> </dtml-in> </table>
In this case: <dtml-in "especialidade.objectValues()"> <dtml-if sequence-even> <tr bgcolor="#EEEEEE"> <dtml-else> <tr bgcolor="#007CC3"> </dtml-in> See the ZQR (http://www.zope.org/Members/ZQR) for useful <dtml-in> variables Generally, use <dtml-call "REQUEST.set('cor', 'FALSE')"> for something like this Ivan
Thank you very much. Work very well. Now I just have another doubt. Ex.: Do I need to do a cast or something like that to make this? Because the parameter is an object, but zope treats like a string. <dtml-in "REQUEST['parametro'].objectValues()"> Thank you. On Wed, 28 Mar 2001 16:04:42 +0100 Ivan Cornell <ivan.cornell@framestore.co.uk> wrote:
<!--#let cor="'FALSE'"--><!--#/let--> <table> <dtml-in "especialidade.objectValues()"> <dtml-if "cor == 'FALSE'"> <!--#let cor="'TRUE'"--><!--#/let--> <tr bgcolor="#EEEEEE"> <dtml-else> <!--#let cor="'FALSE'"--><!--#/let--> <tr bgcolor="#007CC3"> </dtml-if> </dtml-in> </table>
In this case: <dtml-in "especialidade.objectValues()"> <dtml-if sequence-even> <tr bgcolor="#EEEEEE"> <dtml-else> <tr bgcolor="#007CC3"> </dtml-in> See the ZQR (http://www.zope.org/Members/ZQR) for useful <dtml-in> variables
Generally, use <dtml-call "REQUEST.set('cor', 'FALSE')"> for something like this
Ivan
________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
one thing i notice right off the bat is that you are setting the color after you close your let. i've not tried it, but would this work? <dtml-let cor="'TRUE'"> <tr bgcolor=#EEEEEE> </dtml-let> ciao! greg. Gregory Haley DBA/Web Programmer Venaca, LLC.
<!--#let cor="'FALSE'"--><!--#/let--> <table> <dtml-in "especialidade.objectValues()"> <dtml-if "cor == 'FALSE'"> <!--#let cor="'TRUE'"--><!--#/let--> <tr bgcolor="#EEEEEE"> <dtml-else> <!--#let cor="'FALSE'"--><!--#/let--> <tr bgcolor="#007CC3"> </dtml-if> </dtml-in> </table>
How can I make this work?
Thanks. ________________________________________________ Don't E-Mail, ZipMail! http://www.zipmail.com/
_______________________________________________ Zope maillist - Zope@zope.org 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 )
participants (4)
-
After Dark -
ghaley@mail.venaca.com -
Ivan Cornell -
Phil Harris