[Zope] infobar and urls
Paul Erickson
erickson@kaivo.com
Sat, 09 Mar 2002 18:05:35 -0700
Joel Burton wrote:
>On Sat, 9 Mar 2002, Paul Erickson wrote:
>
>>Joel Burton wrote:
>>
>>>On Sat, 9 Mar 2002, Jens Grewen wrote:
>>>
>>>>Hi,
>>>>
>>>>use
>>>>Link is <a href="/AFolder/">link here</a>
>>>>
>>>>instead of
>>>>
>>>>Link is <a href="AFolder/">link here</a>
>>>>
>>>>
>>>>Jens
>>>>
>>>Assuming your item is in the root folder, of course. ;-)
>>>
>>>You can also use <a href="<dtml-var "AFolder.absolute_url()"
>>>url_quote>">link here</a>, which will find the correct URL for
>>>AFolder and put it in. The nice thing about this is that you can move
>>>AFolder around in the hierarchy, but as long as the current method can
>>>find it through acquisition, it will work.
>>>
>>Or yet another variation:
>>
>><a href="&dtml.url-AFolder;">link here</a>
>>
>>Does what Joel's does, except that it is shorter, possibly more easy to
>>read.
>>
>
>Err, yeah, but for some reason, I thought that absolute_url() was
>safer for certain kinds of objects. Or am I making this up in my memory?
>
Now you've got me curious... Th e documentation -
http://www.zope.org/Members/AlexR/EntitySyntax
says that using &dtml.url actually calls the absolute_url() method.
Your's could be safer though, since it uses url_quote, although
hopefully no object id's contain characters that are illegal in url's.