I am trying to set the bgcolor of a page based on the existance of a variable.

Neither of these seem to work:

  tal:attributes="bgcolor python:test(hasattr(options, 'error'), 'red', 

  tal:attributes="bgcolor python:test(hasattr(request, 'error'), 'red', 

I can access the error variable with this:

<p class="error" tal:condition="exists: options/error" tal:content="options/error | nothing">There was an error</p>
Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to