[ZPT] Re: Dynamic title for template?

Evan Simpson evan@digicool.com
Fri, 27 Apr 2001 12:26:29 -0400


From: "Tim Moore" <tmoore@tembel.org>
> I have a standard macro that's used by all my templates to provide
> navigation links, basic layout, etc.  It contains the title tag.
>
> What I'd really like is for the title tag to be set to the title of
> the template if it has one, or the title of the container if the
> template's own title is blank.  Is it possible to do this as a simple
> path reference, rather than having to resort to conditionals and
> python trickery?

Ah, I see.  Right now, the best you can do is:

<title tal:content="python:template.title or container.title">Title</title>

In 1.2, you will be able to write:

<title tal:content="(if) template/title"><span
tal:replace="container/title">Title</span></title>

Cheers,

Evan @ digicool