Syntax
Blocks
Blocks are a way to format tags in a way that is more readable. You can use them to format {if}
, {for}
and {function}
in a way that is slightly more readable. Blocks aren't required, but they are recommended for readability in some circumstances.
Tag names in blocks are prefixed with #
. Without this prefix, the block will be ignored. Block nesting is supported.
if
blocks
Syntax: [#if;condition] body [/if]
[#if;{ticket.reason}]
// Add the ticket reason only if it is not empty
{responder.embedField name="Reason" value={ticket.reason}}
[/if]
See also: {if}
for...of
blocks
Syntax: [#for;init;iterable] body [/for]
{=array;{[one;two;three]}}
[#for;{=item};{$array}]
{responder.embedField name="Item Value" value={$item}}
[/for]
See also: {for}
function
blocks
Syntax: [#function;name;args] body [/function]
[#function;add;{a;b}]
{=result;{a+b}}
[/function]
See also: {function}