{% import '_includes/forms.twig' as forms %} {% set readOnly = readOnly ?? false %} {% if not readOnly and fieldId is defined and fieldId %} {{ hiddenInput('fieldId', fieldId) }} {% endif %} {{ forms.textField({ first: true, label: "Name"|t('app'), instructions: "What this field will be called in the control panel."|t('app'), id: 'name', name: 'name', value: field.name, required: true, autofocus: true, errors: field.getErrors('name'), data: {'error-key': 'name'}, disabled: readOnly, }) }} {{ forms.textField({ label: "Handle"|t('app'), instructions: "How you’ll refer to this field in the templates."|t('app'), id: 'handle', name: 'handle', class: 'code', autocorrect: false, autocapitalize: false, maxlength: 64, value: field.handle, required: true, errors: field.getErrors('handle'), data: {'error-key': 'handle'}, disabled: readOnly, }) }} {{ forms.textareaField({ label: "Default Instructions"|t('app'), instructions: "Helper text to guide the author."|t('app'), id: 'instructions', class: 'nicetext', name: 'instructions', value: field.instructions, errors: field.getErrors('instructions'), data: { 'error-key': 'instructions', }, disabled: readOnly, }) }} {{ forms.lightswitchField({ label: 'Use this field’s values as search keywords'|t('app'), id: 'searchable', name: 'searchable', on: field.searchable, disabled: readOnly, }) }} {{ forms.customSelectField({ label: "Field Type"|t('app'), instructions: "What type of field is this?"|t('app'), warning: (fieldId is not empty and not field.hasErrors('type') ? "Changing this may result in data loss."|t('app')), id: 'type', name: 'type', options: fieldTypeOptions, value: field is missing ? field.expectedType : className(field), errors: field.getErrors('type'), data: { 'error-key': 'type', }, disabled: readOnly, }) }} {{ missingFieldPlaceholder|raw }} {% if craft.app.getIsMultiSite() %} {% set translationMethods = field.supportedTranslationMethods %} {% if translationMethods|length > 1 %}