{% comment %} Spaceless is required here to make sure prepend and append work properly {% endcomment %} {% if field.field.widget.bootstrap %} {% with bootstrap as field.field.widget.bootstrap %} {% with prepend=prepend|default:field.field.widget.bootstrap.prepend|default:"" append=append|default:field.field.widget.bootstrap.append|default:"" %} {% if prepend %} {% if append %}
{{ prepend }}{{ field }}{{ append }}
{% else %}
{{ prepend }}{{ field }}
{% endif %} {% else %} {% if append %}
{{ field }}{{ append }}
{% else %} {{ field }} {% endif %} {% endif %} {% endwith %} {% endwith %} {% else %} {{ field }} {% endif %}