Menu Variables
Variables are mutable string values stored per-menu-instance. They act as local state, accessible as %variables_<name>% placeholders anywhere in the menu.
Declaration
Declare variables in the variables: map with their initial values:
Values are plain strings. Initial values are stored verbatim; runtime evaluation happens when set-variable runs (see below).
Reading Variables
Use %variables_<name>% in any field that supports placeholder substitution:
If no menu-local variable matches the key, the lookup falls through to the global variables: map in config.yml, so the same namespace works for both scopes.
Updating Variables
Use the set-variable action:
After the variable is updated, affected slots are automatically re-rendered.
Expression Syntax
Variable values support arithmetic and ternary expressions evaluated when set-variable runs.
Arithmetic — $e(...)
Wrap an arithmetic expression in $e(...). Placeholders inside the expression are resolved before evaluation; operands must evaluate to numbers.
Operators: +, -, *, /, ^, parentheses. The custom round(value, precision) function is also available.
The result is returned as an integer when the value is whole, otherwise as a double.
Ternary
The condition uses the same operators as the compare requirement: ==, !=, <, >, <=, >=.
Ternary expressions can be combined with $e(...) to compute branches.