If
Renders its children conditionally, based on the truthiness of a path.Signature
Attributes
Truthiness rules
Example
Runtime behavior
- When the condition is false the subtree does not render at all, but
Datainside it is still prefetched (it was collected at parse time). - There is no
Else; for an either/or case use two opposite conditions, or return the state from a script. Testaccepts{...}or a bare path.
Gotchas
- An empty array counts as false; to detect “the array exists but is empty”, check its length or use a script result.
- Do not put
Resources/Triggers/FunctioninsideIf; they are only allowed at the root.