Created by camil7 . Last modified 2003-12-31 23:47:25.
Sometimes one needs some tag in a page template
just for the logic (i.e. to define variables inside of a tal:repeat
loop,
but do not really need a separate html-tag in the layout.
One possibility is to use tal:omit-tag=""
inside the tag, which executes the tal:
statements but does not render the tag, only its contents.
However an easier way to achive this is to name the tag <tal:block>
;
in this case the element is not rendered, and one can even skip
the tal:
prefix to the tal statement.
This also has the advantage one can clearly see the tag
is just needed for the logic.
Thus instead of:
<span tal:omit-tag="" tal:define="foo container/bar">...</span>
one can write:
<tal:block define="foo container/bar">...</tal:block>
You do not even have to name the tag <tal:block>
; <tal:def>
or <tal:x>
would do as well.
However <tal:block>
seems to work best with some WYSIWYG editors,
and is just very common in use.