{% extends "_layouts/cp" %} {% import "_includes/forms" as forms %} {% set fullPageForm = true %} {% set saveShortcutRedirect = continueEditingUrl %} {% set groupHandle = group.handle %} {% set isNewCategory = category.id ? false : true %} {% hook "cp.categories.edit" %} {% block saveButton %}
{% endblock %} {% block main %} {% if category.id %}{% endif %} {% if craft.isLocalized() %}{% endif %}
{% include "_includes/tabs" %} {{ forms.textField({ label: "Title"|t, locale: category.locale, id: 'title', name: 'title', value: category.title, errors: category.getErrors('title'), first: true, autofocus: true, required: true, maxlength: 255 }) }}
{% for tab in group.getFieldLayout().getTabs() %} {% endfor %}
{% if showPreviewBtn %} {% include "_includes/previewbtns" %} {% endif %} {% if craft.isLocalized() %} {% endif %}
{{ forms.textField({ label: "Slug"|t, locale: category.locale, id: 'slug', name: 'slug', value: category.slug, placeholder: "Enter slug"|t, errors: (category.getErrors('slug')|merge(category.getErrors('uri'))) }) }} {% if parentOptionCriteria is defined %} {{ forms.elementSelectField({ label: "Parent"|t, id: 'parentId', name: 'parentId', elementType: elementType, selectionLabel: "Choose"|t, sources: ['group:'~group.id], criteria: parentOptionCriteria, limit: 1, elements: (parent is defined and parent ? [parent]), errors: category.getErrors('parent') }) }} {% endif %} {% set statusInput %}
{{ forms.lightswitch({ id: 'enabled', name: 'enabled', on: category.enabled }) }}
{% if not isNewCategory %}
{% endif %} {% endset %} {{ forms.field({ label: "Enabled"|t, id: 'enabled' }, statusInput) }}
{% if category.id %}
{{ "Date Created"|t }}
{{ category.dateCreated.localeDate() }} {{ category.dateCreated.localeTime() }}
{{ "Date Updated"|t }}
{{ category.dateUpdated.localeDate() }} {{ category.dateUpdated.localeTime() }}
{% endif %} {# Give plugins a chance to add other panes here #} {% hook "cp.categories.edit.right-pane" %}
{% endblock %} {% if not category.slug %} {% includejs "window.slugGenerator = new Craft.SlugGenerator('#title', '#slug');" %} {% endif %}