I have little issue with this code. Please update again
{% if template == 'index' %} {% else %} {% endif %}