[Zope] This document's folder's URL?

Rik Hoekstra rik.hoekstra@inghist.nl
Tue, 18 Apr 2000 10:03:17 +0200


Nolan Darilek wrote:
> 
> I've recently restructured my Zope site in order to take advantage of
> acquisition by moving page-specific code into other methods while
> leaving site-wide formatting in standard_html_header and footer. I'm
> running into a problem, though.
> 
> I have a menu DTML method which contains page-specific
> sidebars. Though this menu often changes, it would be great if I could
> use acquisition to minimize the number of menu methods. However, if I
> have a folder in which a menu method from a parent is acquired, I
> can't think of a way to make URLs absolute. Right now I'm doing:
> 
> <a href="../">Home</a><br>
> ...
> 
> But, it's quite obvious what happens in descendants; ../ no longer
> links to my homepage, and none of the relative links work.
> 
> So, is there a variable or method which creates an absolute link to
> the folder in which the current document resides, thus allowing me to
> use acquisition and avoid modifying menus whenever my structure
> deepens? So, I could do something like:
> 
> <a href="<dtml-var folder_url>/articles/">Articles</a><br>
> 
> and have that code work, no matter how many levels down 'menu' is
> acquired?
> 


Hm, I don't know if I understand this well, but this sounds like a
modified breadcrumbs, which makes use of the acquisition PARENTS. Of
course the usability depends on the uniformity of the urls in the menu.
Perhaps you could use
http://www.zope.org/Members/lstaffor/Breadcrumbs

Rik