{% load slm %} {% with id=widget.attrs.id %}{% with per_col=widget.optgroups|length|div:widget.columns %}{% for group, options, index in widget.optgroups %}{% if forloop.counter0|divisibleby:per_col %}{% if not forloop.first %}{% endif %}
{% endif %}{% if group %} {% endif %}{% for option in options %}
{% include option.template_name with widget=option %}{% endfor %}
{% endfor %}
{% endwith %}{% endwith %}