{% import "_includes/forms" as forms %} {% if sections %} {% if craft.app.getIsMultiSite() %} {% set editableSites = craft.app.sites.getEditableSites() %} {% if editableSites|length > 1 %} {% set siteInput %}
{% endset %} {{ forms.field({ id: 'site-id', label: "Site"|t('app'), }, siteInput) }} {% endif %} {% endif %} {% set sectionOptions = [] %} {% for section in sections %} {% set sectionOptions = sectionOptions|merge([{ label: section.name|t('site'), value: section.id }]) %} {% endfor %} {{ forms.selectField({ label: "Section"|t('app'), instructions: 'Which section do you want to save entries to?'|t('app'), id: 'section', name: 'section', options: sectionOptions, value: widget.section, toggle: true, targetPrefix: 'section' }) }} {% set selectedSectionId = widget.section %} {% for section in sections %} {% set showSection = ((not selectedSectionId and loop.first) or selectedSectionId == section.id) %} {% endfor %} {% else %}

{{ "No sections are available."|t('app') }}

{% endif %}