[Zope] Question about .tag() attribut of images

Sven Rudolph sven@spaghetticode.de
Sun, 17 Feb 2002 22:02:34 +0100


Hello zopeusers.

I have a little Problem with images. I have imported about 2000 images into zope using the Zope ftp server. Unfortunately all those pictures now have the extension .gif or .jpg or .jpeg.

If I try to include a picture into a DTMLDocument with
<dtml-var "mypicture.gif.tag()">
Zope tells me that the object mypicture has no attribute "gif". It seems to me, that using an object id with a dot makes access to attributes, well, difficult.
But...
If I write the following DTML code:
<dtml-in mypicturefolder>
<dtml-var tag><br>
</dtml-in>
all the pictures are correctly represented by <img>-tags with width, height and alt.

The following works either:
<dtml-var mypicture.gif> -> complete <img>-tag
But..
<dtml-var  "mypicturefolder.mypicture.gif">
doesn't work -> Attribute error - mypicturefolder.mypicture.gif has no attribute gif

I had a look at the documentation and found the "namespace variable". It says it has to be used for "illegal" object ids (with . or , or anything inside).
So I tried:
<dtml-var  _['mypicturefolder.mypicture.gif']>
and
<dtml-var  _['mypicture.gif']>
but the result is an key error-> object doesn't exist.

Well, now you could say "Why don't you just use <dtml-var mypicture.gif>?".
Because this seems to work in "mypicturefolder" only. But if I am in a different folder I have to use <dtml-var  "mypicturefolder.mypicture.gif">, and this doesn't work.
If I rename mypicture.gif to mypicture_gif everything works fine, even from distant folders, but this isn't an option with 2000 pictures referenced by nearly 10000 Documents (did I mention the documents?).
Anyway.
The next problem is, that I have written my own image product which inherits from Image and adds some extra attributes (description, keywords, etc.), so I have to find a way to acccess those attributes from anywhere.

Now the time has come to ask for some help. Am I missing something ovbious? Is it described in the documentation, but I'm to blind to see it? I guess so :-(

Thanks in advance for your help

Greetings 

Sven Rudolph