{% if section is not defined and sectionId is defined %} {% set section = blx.sections.id(sectionId).first %} {% if not section %}{% exit 404 %}{% endif %} {% endif %} {% extends "settings/sections/_edit/layout" %} {% set tab = 'settings' %} {% import "_includes/forms" as forms %} {% set isNewSection = (section is not defined or not section.id) %} {% set content %}
{% if not isNewSection %}{% endif %} {{ forms.textField({ label: "Name"|t, instructions: "What this section will be called in the CP."|t, id: 'name', name: 'name', value: (section is defined ? section.name : null), errors: (section is defined ? section.getErrors('name') : null), autofocus: true, required: true, translatable: true }) }} {{ forms.textField({ label: "Handle"|t, instructions: "How you’ll refer to this section in the templates."|t, id: 'handle', class: 'code', name: 'handle', value: (section is defined ? section.handle : null), errors: (section is defined ? section.getErrors('handle') : null), required: true }) }} {{ forms.textField({ label: "“Title” Label"|t, instructions: "What do you want the entries’ “Title” fields to be labeled?"|t, id: 'titleLabel', name: 'titleLabel', value: (section is defined ? section.titleLabel : 'Title'), errors: (section is defined ? section.getErrors('titleLabel') : null), required: true, translatable: true }) }} {{ forms.checkboxField({ label: "Entries in this section have their own URLs"|t, name: 'hasUrls', checked: (section is defined ? section.hasUrls : true), toggle: 'has-urls-setting' }) }}

{{ forms.textField({ label: "Entry URL Format"|t, instructions: "What the entry URLs should look like."|t, id: 'urlFormat', class: 'code', name: 'urlFormat', value: (section is defined ? section.urlFormat : null), errors: (section is defined ? section.getErrors('urlFormat') : null), required: true }) }} {{ forms.textField({ label: "Entry Template"|t, instructions: "The template to use when an entry’s URL is requested."|t, id: 'template', name: 'template', value: (section is defined ? section.template : null), errors: (section is defined ? section.getErrors('template') : null) }) }}
{% endset %} {% set js %} {% if section is not defined or not section.handle %}new Blocks.ui.HandleGenerator('#name', '#handle');{% endif %} {% if section is not defined or not section.urlFormat %}new Blocks.ui.EntryUrlFormatGenerator('#name', '#urlFormat');{% endif %} {% endset %} {% includeJs js %}