[ZPT] Hmm... is this right

Guido van Rossum guido@digicool.com
Wed, 13 Jun 2001 09:21:26 -0400


> With the new "default" syntax you can "call" the default text of the tag.
> 
> <h4 tal:content="python:test(result,
> default,path('template/title'))">Untitled</h4>
> 
> This means that if 'result' is false, "default" is inserted. And in this
> case default is "Untitled".
> If a web desginer opens my ZPT objects in Dreamweaver she will see stuff
> like this:
> 
> <div tal:content="here/title">When the page is rendered, right here the
> Title will be shown. Cheers, Peter</div>
> 
> I.e. my "default" text is notes that are meant to be ignored. All of a
> sudden it matters what it says there. What's you view on this? Isn't this
> confusing?

Well, you don't *have* to use the default variable...  It's easy to
construct examples where the default text makes sense in both
contexts:

<div tal:content="python:test(...,greeting,default)">Welcome!</div>

--Guido van Rossum (home page: http://www.python.org/~guido/)