tera
tera copied to clipboard
Filter sections but set the result in a variable
Not sure how to best describe this, and I couldn't find anything matching in the documentation. But basically what I need is to create a larger string, and use the templating features for that. The documentation mentions "filter sections":
{% filter upper %}
Hello
{% endfilter %}
and what I'd need would be something like
{% set upper %}
Hello
{% endset %}
which stores Hello in the variable upper. The important bit is that I can then use all of the templating features inside it.
Not sure if there are other ways to achieve it
Well it's actually implemented exactly like that in v2: https://github.com/Keats/tera2/blob/master/src/tests/rendering_inputs/success/set_blocks.txt ;)