Using images from my_Product
Hi, I have the next structure in my product My_Product /My_Product /www /page.dtml ... /img /my_img.gif ... /My_Pruduct.py ... I've define in My_Product.py a python class with the same name and inside this class I define what I show next: my_img = ImageFile('img/my_img.gif', globals()) In page.dtml I try to insert my_img with this sintax: <dtml-var my_img> This doesn't work. my_img appear as a broken image when I saw page.dtml This work when I use the same method to insert a piece of code DTML but doesn't work with an image. What I am doing wrong? Thanks in advanced Martin
Luis =?iso-8859-1?Q?Mart=EDn_Arga=F1araz?= writes:
I have the next structure in my product My_Product
/My_Product /www /page.dtml ... /img /my_img.gif ... /My_Pruduct.py ...
I've define in My_Product.py a python class with the same name and inside this class I define what I show next:
my_img = ImageFile('img/my_img.gif', globals())
In page.dtml I try to insert my_img with this sintax:
<dtml-var my_img>
This doesn't work. my_img appear as a broken image when I saw page.dtml Look at the generated URL (e.g. viewing the HTML source code). What do you see?
The file should have been found successfully. Otherwise, you should have gotten a startup exception (did you activate Zope logging and checked the log file?). Do you call "page.dtml" in the context of one of you "My_Product" instances? If not, "my_img" will not be known. Dieter
participants (2)
-
Dieter Maurer -
Luis Martín Argañaraz