[ZPT] Re: Re: DTML/ZPT examples

Lynn Walton waltonl@franklin.edu
Wed, 13 Jun 2001 07:57:50 -0500


>  I would like to propose the following alternative:
>
> <H4 tal:content="python:test(len(result)==0, path('template/title'), 'Untitled')">Dummy Title</H4>
>
> --Brent

Brent, thanks for showing this. And Peter, thanks for providing that great examples page.  I couldn't have figured out ZPT nearly as
well without it.
I like the method Brent suggested, because in the other method of using two tags with inverse conditions,  you'll see both tags in a
WSYWIG editor which partially defeats one of the main purposes of ZPT.

Now for a possibly dumb newbie question ..... where does  test come from in  python:test ?

I can see what it does, but I'm curious as to whether it's a built in Zope thing only, or python in general? Although I couldn't find it
in my books, or the module index for python and just using it at a python interactive interpreter without knowing what module it came
from didn't work, so it isn't like  python:len() in that respect.   Can someone point me to any docs that explains the nature of how
that is magically accessible in ZPT. And if so, what else is magically accessible?

Thanks!
Lynn