Skip to content

Render: Twig

Available since: 1.1.0

Render an inline template using the Twig engine.

Fields

Machine name

Optionally define a machine name of this render element. It will be made available under that name in the render array of the current event in scope. Nested elements can be set with using "][" brackets, for example details][title.

Token name

Optionally define a token name of this render element. It will be made available under that token name for later usage.

Element weight

Optionally specify an element weight. The lower the weight, the element appears before other elements having a higher weight.

Build mode
Context values

Optionally specify context values to pass to the template. Can be an array using YAML syntax (needs to be enabled below) or a token holding the context data. Available token data will be automatically forwarded.

Interpret above value as YAML format

Nested data can be set using YAML format, for example mykey: "My value". When using this format, this option needs to be enabled. When using tokens and YAML altogether, make sure that tokens are wrapped as a string. Example: title: "[node:title]"

Template

Must be valid Twig syntax. This field supports tokens.