[Zope] context and URLs

Peter Bengtsson peter at fry-it.com
Sun Jan 29 17:50:44 EST 2006


Instead of writing links like this::

 <a href="folderB/object">object</a>

write them like this::

 <a tal:attributes="href folderB/object/absolute_url_path">object</a>

I know it's more typing but it will solve all your problems. I always
let the server have a part in generating URLs and I never suffer from
problems like this.

On 1/29/06, Ole Johan Tennvassås <oj.tennvassaas at gmail.com> wrote:
> Im working on a zope application where i have several folders, all at the
> same level (not parent/children).  In one case a ZPT calls a script in
> another folder, which in turn calls another ZPT in the first folder again.
> My problem is that the base (?) URL (context?) which Zope prepends to all
> objects keeps building up (with the script folders name) each time this
> happens, and eventually something brakes probably because an object cant be
> found by acquisition.  Example: links created by href in ZPTs is first
> http://mysite/folderA/object, then changes to
> http://mysite/folderA/folderB/object, then to
> http://mysite/folderA/folderB/folderB/object and so on...
> If anyone can explain this to me, or link me to some examples on how this
> should be done, i would be glad!
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>
>
>


--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com


More information about the Zope mailing list