While most control flow and logic should be embedded in the web actions themselves and not in the template, Chloe templates do support a minimal amount of control flow.
t:comment | All markup within a comment tag is ignored by the compiler. |
t:bind | Renders child content bound to a nested form named by the t:name attribute. See with-form. |
t:each | Renders child content once for each element of the sequence in the value named by the t:name attribute. The sequence element and index are bound to the value and index values, respectively. See with-each-value. |
t:bind-each | Renders child content once for each element of the sequence in the value named by the t:name attribute. The sequence element's slots are bound to values. See with-each-object. |
t:even | Only valid inside a t:each or t:bind-each. Only renders child content if the index value is even. |
t:odd | As above, but only if the index value is odd. |
t:if | Renders child content if a boolean condition evaluates to true. The condition value is determined by the t:code or t:value attribute, exactly one of which must be specified. The former is a string of the form vocabulary:word denoting a word to execute with stack effect ( -- ? ). The latter is a value name. |