[Zope] Re: incredible growing urls

Paul Winkler pw_lists@slinkp.com
Thu, 15 May 2003 08:42:33 -0400


On Thu, May 15, 2003 at 10:46:34AM -0400, Bill Bell wrote:
> 
> Dieter Maurer <dieter@handshake.de> wrote, in part:
> >   A trivial URL reference is one not containing a "/". They are harmless.
> >   A relative URL reference containing a "/" is non-trivial unless
> >   the path segment before each "/" is either "." or "..".
> >   Non-trivial URL references can cause growing URLs. Do not use them.
> 
> I'm a beginner. I have a very simple site in which the menu is generated with the 
> following code:
> 
> <dtml-with OSPN>
>   <dtml-in "objectItems(['Folder'])" sort="id">
>     <dtml-if expr="id[0] in '0123456789'">
>       <a href="&dtml-id;"><dtml-var expr="id[2:].replace('_', ' ')"></a><br/>
>     </dtml-if>
>   </dtml-in>
> </dtml-with>
> 
> Each time one clicks on a menu item the corresponding page is displayed. There 
> appears to be no non-trivial URL reference. owever, the URL grows.

I'm afraid Dieter's wrong about this. yes, it can happen! :-)
Use an absolute url for the link:

<a href="&dtml-absolute_url;"><dtml-var expr="id[2:].replace('_', ' ')"></a><br/>


-- 

Paul Winkler
home:  http://www.slinkp.com
"Muppet Labs, where the future is made - today!"