[Zope] URL relative to document, not folder. How to fix?

James Hazard james.hazard@commonaccord.com
Wed, 12 Jun 2002 10:34:05 -0400


Thanks, <base href="/Members/myuser/index_html"> looks like what I want.

I'm using CMF, so far quite standard.  I'd like the href base to apply to
all pages on the site.  After a lot of experimentation, I can't see that
standard_html_header contributes to the pages in CMF -- main_template seems
to be doing most of the work.
Would I put something in there?  If so, any suggestion for a command?  <base
href="<dtml-var 'PARENTS[0].absolute_url()'>"> is my guess in dtml, but I
gather that won't work in a Template.

Sorry for basic questions, huffing and puffing up the learning curve --

Jim

>>-----Original Message-----
>>From: Kevin Teague [mailto:kteague@bcgsc.bc.ca]
>>Sent: Tuesday, June 11, 2002 8:57 PM
>>To: James Hazard; zope@zope.org
>>Subject: Re: [Zope] URL relative to document, not folder. How to fix?
>>
>>
>>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
>>
>>