{% extends "_layouts/cp" %}
{% set fullPageForm = true %}
{% import "_includes/forms" as forms %}
{% block content %}
{{ redirectInput('settings/sites') }}
{% if site.id %}{% endif %}
{{ forms.textField({
first: true,
label: "Name"|t('app'),
instructions: "What this site will be called in the CP."|t('app'),
id: 'name',
name: 'name',
value: site.name,
errors: site.getErrors('name'),
autofocus: true,
required: true,
translatable: true
}) }}
{{ forms.textField({
label: "Handle"|t('app'),
instructions: "How you’ll refer to this site in the templates."|t('app'),
id: 'handle',
class: 'code',
name: 'handle',
value: site.handle,
errors: site.getErrors('handle'),
required: true
}) }}
{% if not craft.app.i18n.getIsIntlLoaded() %}
{% set languageWarning = 'Enable the [Intl extension]({link1}) or install additional [locale data files]({link2}) for more language options.'|t('app', {
link1: 'http://php.net/manual/en/book.intl.php',
link2: 'https://github.com/craftcms/locales'
}) %}
{% endif %}
{{ forms.selectField({
label: "Language"|t('app'),
instructions: "The language content in this site will use."|t('app'),
id: 'language',
name: 'language',
value: site.language,
options: languageOptions,
errors: site.getErrors('language'),
warning: languageWarning ?? null
}) }}
{{ forms.checkboxField({
label: "This site has its own base URL"|t('app'),
id: 'has-urls',
name: 'hasUrls',
checked: site.hasUrls,
toggle: 'url-settings'
}) }}
{{ forms.textField({
label: "Base URL"|t('app'),
instructions: "The base URL for the site"|t('app'),
id: 'base-url',
class: 'ltr',
name: 'baseUrl',
value: site.originalBaseUrl ?: site.baseUrl,
errors: site.getErrors('baseUrl')
}) }}
{% endblock %}
{% if not site.handle %}
{% js %}
new Craft.HandleGenerator('#name', '#handle');
{% endjs %}
{% endif %}