{% for t in term_list %} {% if term.name == t.name %}{{ t.name|safe }}{% else %}{{ t.name|safe }}{% endif %} {% endfor %}