Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter sections but set the result in a variable #904

Open
piegamesde opened this issue Mar 22, 2024 · 1 comment
Open

Filter sections but set the result in a variable #904

piegamesde opened this issue Mar 22, 2024 · 1 comment

Comments

@piegamesde
Copy link

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

@Keats
Copy link
Owner

Keats commented Mar 23, 2024

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 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants