[Zope-CMF] I can't live without DTML in Portal Document
Florent Guillaume
fg@nuxeo.com
3 Oct 2001 12:46:53 GMT
> What is the right solution to this problem? What is the real problem?
I believe that Document (and other contents in general) should insert a
<base> tag in the <head> in some situations, but I've not yet completely
figured out the mechanism used (it's fairly intricate and not very well
documented -- see HTTPResponse::insertBase, and the call to
response.setBase in BaseRequest::traverse ...).
Your best bet in the meantime, as you mentionned, would be acquisition,
which is not that much of a hack (except that it can lead to
caching-unfriendly behaviour).
Florent Guillaume
Nuxeo
> 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.
>
>
> -- Loren
>
>
> _______________________________________________
> Zope-CMF maillist - Zope-CMF@zope.org
> http://lists.zope.org/mailman/listinfo/zope-cmf
>
> See http://www.zope.org/Products/PTK/Tracker for bug reports and feature
> requests
>
--
Florent Guillaume, Nuxeo SARL (Paris, France)
+33 1 40 33 79 87 http://nuxeo.com mailto:fg@nuxeo.com