I have:
{% for field in form %} {{ field }} {% end for %}
What I want is to put an ‘if’ statement to exclude a field which .label or whatever is provided. Like:
{% for field in form%} {% if field == title %} {% else %} {{ field }} {% endif %} {% endfor %}
Is it possible? I have to many fields to write them one by one and only one or two to exclude.
Yes, this should be possible:
Django’s template tags offer
ifequalandifnotequalvariants, and you can test the field.label against either a context variable, or a string.