Good evening, good morning, and good day, I'm having a small but frustrating problem. I've read the book, searched the archives, etc. Any help will be appreciated. with the file object, "mds_logo" in the current folder, the following code works: <html> <body> <dtml-var mds_logo> </body> </html> it does not work, however, if I move the object to the "images" folder and reference it as follows: <html> <body> <dtml-var images/mds_logo> </body> </html> for what it's worth, if I call the logo from the address bar in my browser, it works: http://freezope2.nipltd.net/mds/images/mds_logo Danny
Yup. <dtml-with images> <dtml-var mds_logo> </dtml-with> Slashes aren't allowed in DTML "name" targets. ----- Original Message ----- From: "Danny Morgan" <danielhmorgan@cox.net> To: <zope@zope.org> Sent: Sunday, August 11, 2002 9:28 PM Subject: [Zope] object paths with dtml-var -- newbie
Good evening, good morning, and good day,
I'm having a small but frustrating problem. I've read the book, searched the archives, etc. Any help will be appreciated.
with the file object, "mds_logo" in the current folder, the following code works: <html> <body> <dtml-var mds_logo> </body> </html>
it does not work, however, if I move the object to the "images" folder and reference it as follows: <html> <body> <dtml-var images/mds_logo> </body> </html>
for what it's worth, if I call the logo from the address bar in my browser, it works:
http://freezope2.nipltd.net/mds/images/mds_logo
Danny
On Sunday, August 11, 2002, at 09:29 PM, Chris McDonough wrote:
<dtml-with images> <dtml-var mds_logo> </dtml-with>
Slashes aren't allowed in DTML "name" targets.
You can also write it as <dtml-var expr="images.mds_logo"> ___/ / __/ / ____/ Ed Leafe http://leafe.com/ http://foxcentral.net
You can also write it as <dtml-var expr="images.mds_logo">
Probably not. You'd at least need to do: <dtml-var expr="images.mds_logo()"> ... or more likely... <dtml-var expr="images.mds_logo(_, REQUEST)"> or something of that ilk. ;-) - C
for what it's worth, <dtml-var expr="images.mds_logo"> works, but neither <dtml-var expr="images.mds_logo()"> nor <dtml-var expr="images.mds_logo(_, REQUEST)"> do. Again, thanks for the helpful and prompt replies. Danny
Danny Morgan writes:
for what it's worth, <dtml-var expr="images.mds_logo"> works, but
neither <dtml-var expr="images.mds_logo()"> nor <dtml-var expr="images.mds_logo(_, REQUEST)"> do. When you say, something does not work, you should be more precise. What happens? Wrong result, exception?
The name "mds_logo" suggests, it is an "Image" object. Image objects are not callable. This means, you cannot use "mds_logo(...)". What is your aim? Dieter
Dieter Maurer wrote:
The name "mds_logo" suggests, it is an "Image" object. Image objects are not callable.
Really? I don't think that's true, if you call an image object you get a '<img src=xx>' string back... am I wrong? Chris
Chris Withers wrote:
Dieter Maurer wrote:
The name "mds_logo" suggests, it is an "Image" object. Image objects are not callable.
Really?
I don't think that's true, if you call an image object you get a '<img src=xx>' string back...
am I wrong?
Chris
I wondered myself and looked it up. It's the __str__ method of the image class which returns the tag. Additionally, there's an index_html method defined which returns the file itself. No __call__ method though. This is something I always are confused of, why sometimes __call__() is used, and sometimes index_html(). cheers, oliver
Dieter Maurer wrote:
Chris Withers writes:
Really?
I don't think that's true, if you call an image object you get a '<img src=xx>' string back... This is done by its "__str__" method.
I stand corrected ;-) Chris
participants (6)
-
Chris McDonough -
Chris Withers -
Danny Morgan -
Dieter Maurer -
Ed Leafe -
Oliver Bleutgen