{% set readOnly = readOnly ?? false %} {% import '_includes/forms.twig' as forms %} {% set headlessMode = craft.app.config.general.headlessMode %} {% if not readOnly %} {{ actionInput('sections/save-section') }} {{ redirectInput('settings/sections') }} {% if section.id %}{{ hiddenInput('sectionId', section.id) }}{% endif %} {% endif %} {{ forms.textField({ first: true, label: "Name"|t('app'), instructions: "What this section will be called in the control panel."|t('app'), id: 'name', name: 'name', value: section.name, errors: section.getErrors('name'), data: {'error-key': 'name'}, autofocus: true, required: true, disabled: readOnly, }) }} {{ forms.textField({ label: "Handle"|t('app'), instructions: "How you’ll refer to this section in the templates."|t('app'), id: 'handle', name: 'handle', class: 'code', autocorrect: false, autocapitalize: false, value: section.handle, errors: section.getErrors('handle'), data: {'error-key': 'handle'}, required: true, disabled: readOnly, }) }} {{ forms.lightswitchField({ label: 'Enable versioning for entries in this section'|t('app'), id: 'enableVersioning', name: 'enableVersioning', on: section.enableVersioning, disabled: readOnly, }) }} {{ forms.selectField({ label: "Section Type"|t('app'), instructions: "What type of section is this?"|t('app'), warning: section.id and section.type != 'single' ? 'Changing this may result in data loss.'|t('app'), id: 'type', name: 'type', options: typeOptions, value: section.type, toggle: true, targetPrefix: '.type-', errors: section.getErrors('type'), data: {'error-key': 'type'}, disabled: readOnly, }) }}