November 25, 2006

When True isn't True enough

I found this brilliant tal:condition inside a Plone template today:

    <div class="row"
             tal:condition="python:test(content_type.startswith('text'), 1, 0)">
                <h2 i18n:translate="heading_file_contents">File contents</h2>
                <pre tal:content="here/get_data|here/data|nothing">
                </pre>
        </div>