[Zope] Using ZPT with options/radio/checkboxes

Chris Withers chrisw at nipltd.com
Thu Aug 7 19:00:05 EDT 2003


Paul Winkler wrote:
> 1) It's surprising - other attributes don't behave this way.

Not very. The attributes it applies to need this, and I think it only happens if 
the content type of the ZPT is text/html. Try doing a checkbox withotu this 
feature ;-)

> 2) It's undocumented AFAICT.

Hmm... try the Zope 2.6 Book, I know I've read this documentation in the 
language specs somewhere...

> 3) It's specific to XHTML and likely to be problematic when using ZPT to
> generate other flavors of XML. I notice that this special behavior
> is applied regardless of what tag you put these attributes in.

See note about content type above.

> There is of course the common idiom of writing the entire tag twice with two
> opposing "tal:condition"s, but that often leads to redundant html
> as well as redundant tag contents.

Erg! Ug! Yuk! People do this?!

> <input type="checkbox" 
>  tal:conditional_attributes="checked request/some_var | nothing" />

I suspect that will work as expected if you remove the conditional_ prefix... do 
let me know though!

cheers,

Chris




More information about the Zope mailing list