[Zope] This document's folder's URL?
Nolan Darilek
nolan_d@bigfoot.com
Tue, 18 Apr 2000 00:25:08 -0500
>>>>> "Michel" == Michel Pelletier <michel@digicool.com> writes:
Michel> you lost me. absolute_url() in a method will render the
Michel> URL to the folder that contains the method. absolute_url
Michel> in a document will render the absolute url of the
Michel> document.
Hmm. Here is the source of a "menu" method:
<a href="&dtml-absolute_url;/../../">Main</a><br>
<a href="&dtml-absolute_url;/articles/">Articles</a><br>
<a href="&dtml-absolute_url;/fiction/">Fiction</a><br>
On the index_html in the folder which contains this method, that code
renders:
<a href="http://ethereal.dyndns.org/nolan/writing/index_html/../../">Main</a><br>
<a href="http://ethereal.dyndns.org/nolan/writing/index_html/articles/">Articles</a><br>
<a href="http://ethereal.dyndns.org/nolan/writing/index_html/fiction/">Fiction</a><br>
When I click on a link, 'Articles' perhaps, the articles folder is
entered, with 'menu' being acquired. The rendering in
articles/index_html is:
<a href="http://ethereal.dyndns.org/nolan/writing/articles/index_html/../../">Main</a><br>
<a href="http://ethereal.dyndns.org/nolan/writing/articles/index_html/articles/">Articles</a><br>
<a href="http://ethereal.dyndns.org/nolan/writing/articles/index_html/fiction/">Fiction</a><br>
So it looks as if absolute_url doesn't use the URL to the folder in
which the method is defined, since the /articles/ shouldn't be before
the ..'s, or am I doing something incorrect?
Now we'll copy the above code into a DTML document of the same
name. Here is its rendering in writing/index_html:
<a href="http://ethereal.dyndns.org/nolan/writing/menu/../../">Main</a><br>
<a href="http://ethereal.dyndns.org/nolan/writing/menu/articles/">Articles</a><br>
<a href="http://ethereal.dyndns.org/nolan/writing/menu/fiction/">Fiction</a><br>
And, again when clicking on articles:
<a href="http://ethereal.dyndns.org/nolan/writing/menu/../../">Main</a><br>
<a href="http://ethereal.dyndns.org/nolan/writing/menu/articles/">Articles</a><br>
<a href="http://ethereal.dyndns.org/nolan/writing/menu/fiction/">Fiction</a><br>
Which seems to behave as I'd think it should. The only change was that
menu is now a DTML document as opposed to a method, and the links now
behave as I would expect. IIRC this is Zope 2.1.4. Is this a bug? (I
think the problem also occurs with URL#.)