I have some input text that I always need, but in the output I like to show it depending on an input condition (boolean: Show text Y/N).
I can solve this by repeating the code: once with the {% ic %}-tag, once without it, in combination with the if-statement.
However, this means that all code needs to be doubled, something I rather like to avoid.
So I tried a workaround, see below.
{% input period.custom.berekeningniettonen.rc as:boolean %} Tekst niet mee opnemen in output?
{% assign niet_tonen = period.custom.berekeningniettonen.rc %}
{% if niet_tonen == true %}
{% capture tonen_ic %}
{% raw %}
{% ic %}
{% endraw %}
{% endcapture tonen_ic %}
{% else %}
{% capture tonen_ic %} {% endcapture tonen_ic %}
{% endif %}
{{ tonen_ic }}
However, it seems the {% raw %} also works on the {% ic %} when I use {{ tonen_ic }}, the {% ic %} code is not executed when I do like this…
Would there be another way to solve this?
Thanks.
Ward