{% if event.has_prev %} {# no need for 'is_first': if you can go to the left, you can go all the way to the left too #} {% else %}