{% ckan_extends %} {# Remove 'free extras' from the package form. If you're using convert_to/from_extras() as we are with our 'custom_text' field below then you need to remove free extras from the form, or editing your custom field won't work. #} {% block custom_fields %} {% endblock %} {# https://github.com/okfn/ckan/blob/master/ckan/templates/macros/form.html documents the macros for fields #} {% block dataset_fields %} {% if data.groups %}
{% for group in data.groups %} {% endfor %}
{% endif %} {% set group_name = 'groups__%s__id' % data.groups|length %} {% set group_attrs = {'data-module': 'autocomplete', 'data-module-source': '/api/2/util/group/autocomplete?q=?', 'data-module-key': 'id', 'data-module-label': 'title'} %} {{ form.input(group_name, label=_('Add Group/Theme'), id="field-group", value=data[group_name], classes=['control-medium'], attrs=group_attrs) }} {% endblock %}