[Zope] This document's folder's URL?
Chris McDonough
chrism@digicool.com
Mon, 17 Apr 2000 22:56:52 -0400 (EDT)
Nolan,
Perhaps something like:
<a href="<dtml-var expr="this().absolute_url()">/Articles">Articles</a>
This can be shortened to:
<a href="<dtml-var absolute_url>/Articles">Articles</a>
And can be further shortened to:
<a href="&dtml-absolute_url;/Articles">Articles</a>
On Mon, 17 Apr 2000, 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?
>
> _______________________________________________
> 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 )
>