[Zope] ImageFile in python class
zope-mailinglist
zope-mailinglist <zope-mailinglist@mopa.at>
Tue, 29 May 2001 19:23:36 +0200
i dont know for shure but does this work?:
index_html = DTMLFile('dtml/manage_myclass.dtml', globals())
it should mean:
index_html = DTMLFile('dtml/manage_myclass', globals())
there is no need for the dtml extension
the image stuff is right but, remember that the path is relative to the
modules home
class MyClass(self):
this means that you inherit from self ?!
from OFS import Folder
class MyClass(Folder.Folder):
try this - i think that you have to inherit from some zope object
and add this object via the zmi or via python
good luck
the
----- Original Message -----
From: "Jean-François Ménard" <menard.jean-francois@hydro.qc.ca>
To: <zope@zope.org>
Sent: Tuesday, May 29, 2001 6:45 PM
Subject: [Zope] ImageFile in python class
> Thanks Marc for your response!
>
> But... There MUST be a better way to publish an image in a python class?
>
> Here is what I would like to do:
>
> class MyClass(self):
> """ Class example """
>
> image = ImageFile('www/image.gif', globals())
> index_html = DTMLFile('dtml/manage_myclass.dtml', globals())
>
> def __init__(self, id, title):
> """ Initialization of my class """
> ...
>
> How can I use the "image" property in my "index_html" dtml file???
>
> I tried:
>
> <dtml-var image> give me a broken image.
>
> Then:
>
> <img src="<dtml-var absolute_url>/image>
>
> Broken image again...
>
> I looked at the code in OFS/misc_ , with no luck...
>
> Any help would be VERY appreciated... I'm stuck on this problem for _too_
> long now... : /
>
> Thanks!
>
> J-F
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> 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 )
>