default

This is not an expression but a keyword, allowing template designers to keep the content of a tag as an alternative value if an error occurs, or if something is not defined.


            <span tal:define="myVar path/to/possible/var | default">
  default my var value
</span><span tal:content="some/var | other/path | default">
  no some/var and no other/path found here
</span><a href="unknown.xhtml" title="Unknown page" tal:attributes="href item/href | default; title item/title | default" tal:content="item/title | default">Unknown page</a>

          

Above examples introduce the ' |' character that allows the definition of alternatives for defines or prints.