[Zope] images in directories

Chris Withers chrisw@nipltd.com
Wed, 08 Nov 2000 10:06:11 +0000


Dieter Maurer wrote:
> 
> Then Chris Withers wrote: use
> 
>     <dtml-with images><dtml-var image.gif></dtml-with>
> 
> I did not believe him and tried it out...
> ... it works in Zope 2.2.2.

...worked for me all the way back to 2.1.4 ;-)

Anyway, if you're _really_ lazy, write an external method something
alogn the lines of:

def showImage(self,path):
	return self.restrictedTraverse(path)(self,self.REQUEST)


...then, in your dtml, you can do:

<dtml-var "showImage('/images/image.gif')">

This is all totally untested of course ;-)

I've often wondered why this isn't built into DTML so that you could do:

<dtml-var /folder/myobject>

obviously, you wouldn't be able to do this with stuf inside " " ;-)

cheers,

Chris