{% import "_includes/forms" as forms %} {% set fieldNamespace = 'fields'~random() %} {% set fieldLayout = entryType.getFieldLayout() %}
{{ hiddenInput('fieldsLocation', fieldNamespace) }} {{ csrfInput() }} {% if section.type != 'single' and entryType.hasTitleField %} {% set titleField = fieldLayout.getField('title') %} {{ forms.textField({ label: titleField.label|t('site') ?: 'Title'|t('app'), instructions: titleField.instructions|t('site'), altLabel: tag('code', {text: 'title'}), id: 'title', name: 'title', required: true, first: true }) }} {% endif %} {% namespace fieldNamespace %} {% for field in fieldLayout.getFields() %} {% if field.required or field.id in widget.fields %} {% include "_includes/field" with { field: field, required: field.required, entry: null } only %} {% endif %} {% endfor %} {% endnamespace %}