[ZPT] Re: ZPT/TALES question

Evan Simpson evan@digicool.com
Fri, 20 Apr 2001 12:25:07 -0400


From: "Martijn Pieters" <mj@digicool.com>
> On Fri, Apr 20, 2001 at 11:34:33AM +0200, Martijn Pieters wrote:
> > On Thu, Apr 19, 2001 at 09:34:27PM +0000, Tim Moore wrote:
> > > OK, so my site has a standard METAL template that all of the templates
> > > in the site use.  It contains navigation links and such.  I want one
> > > of those links to always go to the index_html page that's at the same
> > > level of the hierarchy as the standard template macro.  The problem is
> > > that if I use a path like "here/index_html/absolute_url", then "here"
> > > is considered relative to the template that uses the macro, not the
> > > one that defines it.  Can anyone offer any suggestions?
> >
> > Have you tried "container/index_html/absolute_url"?

This won't work.  Right now, conceptually at least, all macro processing is
performed in a single step prior to TAL processing.  This means that TAL
code has no idea whether any macros were used, or where they lived.  It is
exactly as though you cut & pasted the templates together.

The only suggestion I have (and it's not a great one) is to get the standard
template's absolute_url and surgically convert it:

tal:define="st_url here/standard_template/absolute_url; i_hurl
python:st_url[:-17] + 'index_html'"

Sorry,

Evan @ digicool