[Zope] DTML in Product WWW does not bring images

Dieter Maurer dieter@handshake.de
Wed, 20 Feb 2002 22:36:49 +0100


zope news writes:
 > I Tried, I really did, but I just did not get it.  Looking at the code it
 > just doesn't make sense to me.
 > ... images for product ...
 > misc_ = { 'MyPic' : Globals.ImageFile('www/MyPic.jpg',globals()) }
 > ...
 > <img src="<dtml-var SCRIPT_NAME>/misc_/MyClass/MyPic"> .....
 > 
 > Is this correct??
You must register your "misc_"!

Out of hand, I do not know how you do it. But you can find out
by looking through the sources in the "App" folder.
Search for "misc_".

 > If yes, why DOESN'T SCRIPT_NAME expand to anything when viewed ?
"SCRIPT_NAME" is the name of the CGI script that started Zope,
provided you use "pcgi" to start Zope (what you probably do not...).

When you do not connect Zope via "pcgi", "SCRIPT_NAME" is empty
(as it should be).

Using Zope with "pcgi" is old, "SCRIPT_NAME" is deprecated (as
it does not play well with virtual hosting).
The modern replacement is "BASE1".

 > What is
 > the value that should go there?  And why does misc_ appear before MyClass, I
 > would have thought it goes the other way around?
Usually, products install their "misc_" in a global "misc_" registry
under their name. The URL is that of the registry ("misc_")
followed by the product ("MyClass") followed by the key defined
in the products "misc_".
Apparently, your product does not register its "misc_".


Dieter