Action > Template parameters (internal) β
This internal specification now delegates most user-facing documentation to the public page/guides/users/rules-engine/templates/index.md, which describes:
- Template syntax and Twig delimiters.
- Available Twig filters and basic examples.
- ProductβLive specific functions:
source,target,loadChildren,base64_encode,base64_decode. - Template engines (
twig.1,twig.2) and their behavior. - Error handling rules, playground usage, and XML examples.
The sections below keep only additional internal examples and known limitations that are not required in the public documentation.
Macros β
Macros are reusable pieces of code that can be used to simplify your Twig code.
Get the ident β
twig
{% macro getIdent(data) %}
{% for field in data.fields %}
{% if field.key == 'ident' %}
{{ field.value.data }}
{% endif %}
{% endfor %}
{% endmacro %}
{% set v = _self.getIdent(sourceItem) %}
{{ v }}1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
WARNING
The returned value is a string.
Known issues β
- We use Twing.js and it has some shortcomings on the Twig syntax.
In particular, it does not support thesortfilter or accessing an array element by numeric index.