I want to define a variable in my Django template but if I set the variable within the statement I can't call it again. Is there any way to call the variable from the other part of my template? Thank you in advance!
My attemt:
{% if a > 1 %}
{% with "string_1" as var %}
{% endwith %}
{% elif a < 1%}
{% with "string_2" as var %}
{% endwith %}
{% else %}
{% with "string_3" as var %}
{% endwith %}
{% endif %}
{% if var='string_1' %} #here i want to call the variable again
<p>This is string_1</p>
{%else%}
<p>This is not string_1</p>