[Zope] Testing if an image exists

Michael Fox michael@centurysoftware.com.au
Wed, 23 May 2001 11:01:01 +1000


Hello,

I have a folder called 'logos' which contains several images, and a session
variable called 'logo'.

I need to test if my session variable 'logo' matches the ID of an image
object in my 'logos' folder.

eg. I have an image in my 'logos' folder called 'mylogo' and the value of my
session variable is 'mylogo'.

So far I've come up with this dtml, which doesn't seem to work..

<dtml-with logos>
  <dtml-if _['logo']>
    <img src="logos/<dtml-var logo>">
  <dtml-else>
    no logo to display
  </dtml-if>
</dtml-with>

Has anyone had a similar need as above? can this be done?

Regards,

Michael Fox