[Zope] Images and Acquisition

marc lindahl marc@bowery.com
Fri, 19 Oct 2001 14:12:50 -0400

> From: "Tommy Johnson" <tommy@7x.com>
> Actually, I did that when I first started with zope, but have come to use
> the other way. First, it allows me to drop the extension (which isn't
> needed) and second, I don't have to specify an absolute path.

Actually, it works with no extension or any extension, and you don't have to
specify an absolute path in your DTML/HTML - the browser constructs it,
which is nice for caching.

> Also, you can't use the power of acquistion when you do it the first way.

Why not?  It works for me...

> That can be a major pain when you have different logos for different
> sections of your site. First, you gotta name all the images different names
> (even though they are logos - why can't 'logo' do?) and second, you have to
> add code to distinguish where you are (what section) in order to display the
> correct logo.
> That's not as elegant as simply saying <dtml-var Image_logo>

If you say <img src="Image_logo"> then the browser requests
/folder/folder/folder/Image_logo -- if it doesn't exist, then Zope traverses
up until it finds one...