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

Nolan Darilek nolan_d@bigfoot.com
Mon, 17 Apr 2000 20:17:30 -0500


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?