[Zope-CMF] I can't live without DTML in Portal Document

Loren Stafford lstafford@morphics.com
Tue, 2 Oct 2001 14:59:19 -0700


Not a great subject line, but I'm having trouble expressing the real problem
in a few words. So here are a lot of words:

On my Intranet site, I've got a Portal Folder

   http://morphicsweb//Portal/Members/lstaffor/Papers/2001_09_01/,

and in that folder a Document (Format HTML) called 'index_html' and a Portal
Image 'Fig_1.gif'. In 'index_html' I reference the image with <img
src="../Fig_1.gif">. When I click the View action the document is requested
with the URL


http://morphicsweb/Portal/Members/lstaffor/Papers/2001_09_01/index_html/docu
ment_view

and the browser expands the 'img' reference to

  http://morphicsweb/Portal/Members/lstaffor/Papers/2001_09_01/Fig_1.gif

and all is well.

However, if I find the document by a Topic search, the document is requested
with the URL

  http://morphicsweb/Portal/Members/lstaffor/Papers/2001_09_01/index_html

and the browser expands the 'img' reference to

  http://morphicsweb/Portal/Members/lstaffor/Papers/Fig_1.gif

which is invalid, since Fig_1.gif is not in that folder.

I've made a temporary fix by coding the absolute URL of the image in the img
tag, but, until now, I haven't had to code absolute URLs since I started
using Zope. I usually generate them with DTML, but I can't use DTML in a
Portal Document. I could play a trick with acquisition, moving the image up
one level (or the index_html Document down one level); but that would still
be a trick.

What is the right solution to this problem? What is the real problem?

-- Loren