[Zope] ZPT condition attribute question

Mark A. Lilly mlilly@inkwellmedia.net
Tue, 21 May 2002 05:04:38 -0700


hello,
i have an input tag, and i want to set the value attribute to either a
defined value or a blank string. my python expression either returns a
single instance or an empty list.

right now, i am using two Input tags in tandem. Only one remains after
rendering b/c one is removed.  my question, is it possible to write this so
i don't have to have nearly identical Input tags all over my page?

thanks,
mark


<input type="text" name="input_name"
	tal:condition="task/task_name | nothing"
	tal:attributes="value task/task_name" />

<input type="text" name="input_name"
	tal:condition="not:exists:task/task_name"
	tal:attributes="value string:hi" />