tal:omit-tag

Dieses Attribut gibt dem PHPTAL Parser auf, die Anfangs- und Endauszeichnung des umgebenden Elementes zu ignorieren und nur den Inhalt auszugeben.

<span tal:omit-tag="condition">
  if the condition is true, then only this text will appear and span open and close will be removed
</span>

Ergibt:

only this text will appear, span open and close will be removed

Dieses Attribut ist nützlich, wenn Sie ein Auszeichnung wahlweise darstellen möchten oder nicht. Z.B. kann ein Text in Abhängigkeit von einer Bedingung einmal als Text und einmal als Verweis ausgezeichnet werden.

Wenn Sie ein Element benötigen, das niemals ausgegeben wird, können Sie dazu tal:block verwenden

<tal:block tal:repeat="x php:range(1,10)">only this text will appear, ten times.</tal:block>