[ZPT] how can I avoid path to grow huge ??

Robert Rottermann robert@redcor.ch
Thu, 2 May 2002 07:20:07 +0200


Thanks Dieter,
I mean Thank you!
This is really helping me to understand the mechanics at work.

Robert
----- Original Message -----
From: "Dieter Maurer" <dieter@handshake.de>
To: "Robert Rottermann" <robert@redcor.ch>
Cc: <zpt@zope.org>
Sent: Wednesday, May 01, 2002 9:15 PM
Subject: Re: [ZPT] how can I avoid path to grow huge ??


> Robert Rottermann writes:
>  > Thanks dieter,
>  > As you can see, I am using only relative paths.
>  >         <a href="scripts/showGardenPage?roomnr=gd"
>  >            tal:content="structure
python:here.scripts.worte('selection',
>  > 'gd')">
> I said "simple relative" and explained "without containing '/'".
>
> Your path is relative but not simple: there is this "/" between
> "scripts" and "showGardenPage"...
>
>  > changing it to (adding tall:attributes):
>  >         <a href="scripts/showGardenPage?roomnr=gd"
>  >            tal:attributes="href python:'%s/showGardenPage?roomnr=gd' %
>  > here.scripts.absolute_url()"
>  >            tal:content="structure
python:here.scripts.worte('selection',
>  > 'gd')">
>  >           Garten-Dekoration
>  >         </a>
>  > works but seems convoluted and I fail to understand why it is
neccessary.
> When you would read the "Web Publishing" section of
>
>   <http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html>
>
> you might understand:
>
>   When you use any relative reference, the browser adds the
>   documents base reference.
>
>   The base reference is either explicitly specified in the document
>   with a "base" tag in the HTML "head" element or derived
>   by the browser from the document URL (by stripping from right
>   to the last '/').
>
> This gives your the following options:
>
>   *  live with the path lengthening
>
>   *  avoid "/" in relative references
>
>   *  set the base tag appropriately (not easy)
>
>   *  use absolute URLs
>
>
> Dieter
>
>
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://lists.zope.org/mailman/listinfo/zpt
>