[Zope] URL relative to document, not folder. How to fix?
Kevin Teague
kteague@bcgsc.bc.ca
Tue, 11 Jun 2002 17:56:36 -0700
Hi,
The problem is how the web browser interprets the relative links -- it
thinks that the methods called on Zope objects are actually levels in
the hierarchy. For instance, if a user views:
http:://mysite.com/Members/myuser/index_html/document_view
Then ./sibling.html is linked to:
http:://mysite.com/Members/myuser/index_html/sibling.html
But if the user views:
http:://mysite.com/Members/myuser/index_html
Then ./sibling is linked to:
http:://mysite.com/Members/myuser/sibling.html
Which is what you want.
The easiest way to fix this problem is to set base tag to the URL of the
object. Put something in standard_html_header that generates code that
looks like:
<base href="/Members/myuser/index_html">
Then all links in the document should work as expected.
James Hazard wrote:
> Thanks. "Acquisition", i.e., that it finds doc1.html/doc2.html, makes sense
> to me. The part I find hard to believe is having to rewrite links into a
> special Zope format. HTML links of "sibling.html" or "../docInParent.html"
> are, as far as I know, conventional. Writing them as "../sibling.html" or
> "../../docInParent.html" is confusing and means they won't work if someone
> copies a group of documents onto a non-Zope system.
>
> Am I making sense?
>
> Jim
>
>
>>>-----Original Message-----
>>>From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Max M
>>>Sent: Tuesday, June 11, 2002 12:59 PM
>>>To: James Hazard
>>>Cc: zope@zope.org
>>>Subject: Re: [Zope] URL relative to document, not folder. How to fix?
>>>
>>>
>>>James Hazard wrote:
>>>
>>>
>>>>It seems that the path is relative to the document and not the folder,
>>>>so to speak. Have I got something misconfigured?
>>>
>>>
>>>It's called aquisition and is quite normal ... in Zope :-)
>>>
>>>just imagine that the correct amount of ../../../../ is inserted
>>>automagically, and then it is quite easy to image what a path should be.
>>>
>>>regards Max M
>>>
>>>--
>>>
>>>"Sorry I would Really Like To Help More On This Project,
>>>But Am To Busy Doing Paid Work On A Tight Deadline"
>>> Max M
>>>
>>>
>>>
>>>
>>>
>>>
>>>_______________________________________________
>>>Zope maillist - Zope@zope.org
>>>http://lists.zope.org/mailman/listinfo/zope
>>>** No cross posts or HTML encoding! **
>>>(Related lists -
>>>http://lists.zope.org/mailman/listinfo/zope-announce
>>>http://lists.zope.org/mailman/listinfo/zope-dev )
>>>
>>
>
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
--
-- Kevin Teague
Genomics Web Developer
BC Genome Sciences Centre
http://www.bcgsc.ca