FW: [Zope] Setting the correct bgcolor it TR tag

Paul Zwarts paz@oratrix.com
Thu, 12 Jul 2001 14:08:04 +0200


I always forget.....

-----Original Message-----
From: Paul Zwarts [mailto:paz@oratrix.com]
Sent: Thursday, July 12, 2001 2:08 PM
To: Gitte Wange
Subject: RE: [Zope] Setting the correct bgcolor it TR tag


Hi Gitte,

I would suggest you rethink your classing system first. You are heading for
alot of code writing in this method. Why not create classes such as:

MediaManager
CurrentItem
OddItem
EvenItem


and so on covering ALL of the objectTypes you use. That way you can use:

<dtml-in "objectValues()" sort="getId" size="19" start=qs skip_unauthorized>
 <TR class="<dtml-var "ObjName.objectProperty(propName)">">
</dtml-if>

or something like that.

Then for alternating colors, you use a combination of your and mine:

<dtml-in "objectValues()" sort="getId" size="19" start=qs skip_unauthorized>
 <TR class="
   <dtml-if "objectName==_['sequence-item']">
     <dtml-var "ObjName.objectProperty(propName)">
   <dtml-elif sequence-even>
     EvenItem
   <dtml-else>
     OddItem
   </dtml-if>">
</dtml-in>

Although I dont know your datamodel, this works quite well. Just remove the
tabs and returns to make the outputted HTML look more sane.

Cheers,
Paz




-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Gitte
Wange
Sent: Thursday, July 12, 2001 1:57 PM
To: zope@zope.org
Subject: [Zope] Setting the correct bgcolor it TR tag


Hello,

I am generating a list of objects with different BG color in the TR tag. The
code I have now looks like this:
<dtml-if sequence-odd>
 <TR class="MastHead">
<dtml-else>
 <TR BGCOLOR="#FFFFFF">
</dtml-if>

Usually this works in a <dtml-in> sequence but ...

We will one list objects that has metatype=Media Manager Show so therefor
the
code looks like this:
<dtml-in "objectValues()" sort="getId" size="19" start=qs skip_unauthorized>
 <dtml-if expr="meta_type == 'Media Manager Show'">
<dtml-if sequence-odd>
 <TR class="MastHead">
<dtml-else>
 <TR BGCOLOR="#FFFFFF">
</dtml-if>

Since it only some of the object values that are used I cannot be sure that
the bg color of the row-items is set corectly (right now they are all blue).
Therefor I thought if I could move the type-check into the <dtml-in>
request.

Anywho knows how to do this ??

Regards,
--
Gitte Wange Jensen

Sys Admin, Developer and a lot more
MMmanager.org Aps, Denmark

Phone: +45 29 72 79 72
Email: gitte@mmmanager.org
Web: www.mmmanager.org

Quote of the day:
Livet er svært, men frygt ej -
matematik er sværere.

	- Storm P.

_______________________________________________
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 )