[Zope] dtml syntax- check file existence

Sean Kelley sean@horse101.com
Sun, 15 Dec 2002 09:24:02 -0800


Hi

I need help checking the existence of a file in a sub folder.



if file(graphic) in sub folder exists

  display graphic

else

  display message that there is no graphic



The tricky part of this for me is that I have an ID for a graphic which 
is available in a <dtml-in> loop

so the graphic I am testing the existence of is named "id.thumb.jpg" and 
is in a sub folder so if I do another dtml-in my ID is not available in 
the second in loop.



A partial failed example:

<dtml-in photos2>

     <dtml-if <dtml-var id>.thumb.jpg>                                
     // I know this is not right

          <img src="/photos2/<dtml-var id>.thumb.jpg">        
            // and know id is not available at this level but not sure 
how to pass it along.

     <dtml-else>

             no image

</dtml-in>