{% if mode == 'edit-template' %} {% set Entity_id = templateData.id %} {% else %} {% set Entity_id = Entity.id %} {% endif %}