[Zope] Simple (I hope) question re: images

Lennart Regebro lennart@regebro.nu
Tue, 29 Jan 2002 13:13:01 +0100


The question is simple, and the answer is rather simple also:
The handling of paths when it comes to virtual hosts is far from perfect in
Zope. Making things work like you want is a major accomplishment where you
need to dig deep down in the internals of zope (trust me on this, I'm trying
to do it :-) ).
But the URL the images return works (unless your setup is very special).
It's a bit ugly in the HTML code, but most people doens't read it anyway.

So the really, really simple answer is: Don't worry, be happy.  :-)

----- Original Message -----
From: "Angie Bayley" <angie_bayley@hotmail.com>
To: <zope@zope.org>
Sent: Tuesday, January 29, 2002 11:55 AM
Subject: [Zope] Simple (I hope) question re: images


> Hi all,
>
> I have what I suspect is a very simple question regarding images,
> but I've had a look through the list archives and also through the
> Zope book and can't track down an answer.
>
> This is a site which is being virtually hosted; Apache and Zope
> both running on the same box and Apache rewriting URLs to pass
> them to Zope.
>
> I want to keep images in a folder of their own on a Zope site
> that I am creating - not too unusual - and currently I'm
> referencing them from other folders as
>
> dtml-var "images.example_gif"
>
> (angle brackets removed to avoid confusing mail programs,
> browsers etc.)
>
> This gives me the right image, but the source code produced is
> wrong; it gives
>
> http://host.with.zope:8080/virtual.host.name/images/example.gif
>
> whereas what I'd rather have it produce would be
>
> /images/example.gif
>
> or, at a pinch,
>
> http://virtual.host.name/images/example.gif
>
> Am I missing something blatantly obvious here, or can someone
> suggest a workaround for this?