Geir Bækholt wrote:

>Hello Mike, 
>
>Saturday, September 01, 2001, 16:18:37, you wrote:
>
>MS> I am working with a tiny table called TrainingSchedule.  One of the
>MS> columns is called Subject and contains a G, H or U.  I've figured out
>MS> how to dump the TinyTable into a html table using <dtml-in>.
>
>MS> My question: How do I substitute a graphic for the letter in my pretty
>MS> html table?
>
>MS> Mike
>
>if you have a folder named for instance "/icons" with three GIFs, with
>ids G, H and U , you could probably do something like :
>
><!-- warning : untested code -->
>
><dtml-in mytable>
>
> |||table stuff|||
>
><dtml-with icons>
><dtml-var "_[_['sequence-item']]">
></dtml-with>
>
> ||||more table stuff||||
>
></dtml-in>
>
>note that this will result in an error if the letter in the table does
>not have a corresponding GIF (if it works at all..)
>
>
But it won't be "sequence-item" because it is coming from a tiny table. 
It will be "Subject". I think this is a good aproch.

More untested code:

<dtml-with icons>
  <dtml-var "_[Subject]">
</dtml-with>

If you put the icons in the same folder as the tinytable you won't need the dtml-with 
tags. The _[Subject] will get the value of the object with the name *stored it* the 
object Subject.

If there is any chance that the graphic won't exist or that Subject will be empty then 
you might want to look at the dtml-try tag.

Phil.






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

Reply via email to