title: How to check if, elif, else conditions at the same time in django template
body: <p>I have 3 category in category field. I want to check it in django template and assign appropirte urls for 3 distinct category.</p>
  
  <p>I tried:</p>
  
  <pre><code>{% for entry in entries %}
          {% if entry.category == 1 %}
          &lt;a href="{% url 'member:person-list' %}"&gt;&lt;li&gt;{{ entry.category }}&lt;/li&gt;&lt;/a&gt;
          {% elif entry.category == 2 %}          
          &lt;a href="{% url 'member:execomember-list' %}"&gt;&lt;li&gt;{{ entry.category}}&lt;/li&gt;&lt;/a&gt;
           {% else %}
           &lt;a href="{% url 'member:lifemember-list' %}"&gt;&lt;li&gt;{{ entry.category}}&lt;/li&gt;&lt;/a&gt;
          {% endif %}
  {% empty %}
      &lt;li&gt;No recent entries&lt;/li&gt;
  {% endfor %}
  </code></pre>
  
  <p>But I know python only check first matching condition with if. Therefore it gave only one desired result. How do I get all three entries with their correct links?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Though python only check first matching if condition, when use elif within for loop it check each condition until endfor loop. Therefore my answer below worked fine. </p>