title: Invalid block tag
body: <p><strong>//EDIT</strong></p>
  
  <p>I am using standard template language, not jinja. Standard template language does not support a <code>set</code> tag. </p>
  
  <p>How can I declare a new variable using jinja?</p>
  
  <p>The second line in the following code block result to an error:</p>
  
  <pre><code>{% set msg_class = "" %}
  </code></pre>
  
  <p>Error message:</p>
  
  <p>Invalid block tag on line 13: 'set', expected 'elif', 'else' or 'endif'. Did you forget to register or load this tag?</p>
  
  <p>Rest of the code:</p>
  
  <pre><code>{% if msg %}
    {% set msg_class = "" %}
    {% if status == 1 %}
      {% set msg_class = "alert alert-success" %}
    {% elif status == 3 %}
      {% set msg_class = "alert alert-danger" %}
    {% elif status == 4 %}
      {% set msg_class = "alert alert-warning" %}
    {% else %}
      {% set status = 2 %}
      {% set msg_class = "alert alert-info" %}
    {% endif %}
  {% endif %}
  </code></pre>
  
  <p>Using an array like in the following thread that I found, seems really ugly to me. Is it the only solution?</p>
  
  <p><a href="https://stackoverflow.com/questions/4870346/can-a-jinja-variables-scope-extend-beyond-in-an-inner-block">Can a Jinja variable&#39;s scope extend beyond in an inner block?</a></p>