LongLink Runtime Concepts

if

Definition

Conditionally renders an XML node when its expression evaluates to a truthy value.

Usage

Add if to rendered XML nodes and adapter-consumed child nodes that should appear only in one state.

Rules

  • if required. Expression evaluated against the current XML runtime scope.
  • scope. Can read State, Query, params, and loop aliases available at the node position.
  • result. Falsy results skip the node and its children; truthy results render normally.

Example

xml
<Badge if="${order.blocked}" variant="error" i18n="orders.blocked" />
<Selector label="Status" value="$filters.status">
<SelectorOption value="open" label="Open" />
<SelectorOption if="${user.canClose}" value="closed" label="Closed" />
</Selector>