diff --git a/composer.json b/composer.json index 31b874d3002..47867645140 100644 --- a/composer.json +++ b/composer.json @@ -45,6 +45,7 @@ "league/flysystem": "^1.1.4", "league/oauth2-client": "^2.6.0", "mikehaertl/php-shellcommand": "^1.6.3", + "nystudio107/craft-twigfield": "^1.0.13", "pixelandtonic/imagine": "~1.2.4.1", "seld/cli-prompt": "^1.0.4", "symfony/yaml": "^5.2.1", diff --git a/src/templates/_components/fieldtypes/Assets/settings.html b/src/templates/_components/fieldtypes/Assets/settings.html index 89cfdba270b..69d3d3f8fc0 100644 --- a/src/templates/_components/fieldtypes/Assets/settings.html +++ b/src/templates/_components/fieldtypes/Assets/settings.html @@ -2,11 +2,14 @@ {% import "_includes/forms" as forms %} +{% import "twigfield/twigfield" as twigfield %} + {% set fileKindOptions = field.getFileKindOptions() %} {% set isMatrix = 'craft\\fields\\Matrix' in craft.app.view.getNamespace() %} {% macro uploadLocationField(config) %} {% embed '_includes/forms/field' with config %} + {% import "twigfield/twigfield" as twigfield %} {% block input %} {% import '_includes/forms' as forms %}
{{ value }}diff --git a/src/templates/settings/sections/_edit.html b/src/templates/settings/sections/_edit.html index 43219a62e71..45dc001863a 100644 --- a/src/templates/settings/sections/_edit.html +++ b/src/templates/settings/sections/_edit.html @@ -100,8 +100,8 @@ value: (section.type == 'single' and siteSettings and siteSettings.uriFormat == '__home__') }, singleUri: { - value: (section.type == 'single' and siteSettings and siteSettings.uriFormat != '__home__') ? siteSettings.uriFormat, - hasErrors: (section.type == 'single' and siteSettings ? siteSettings.hasErrors('uriFormat')) + value: (section.type == 'single' and siteSettings and siteSettings.uriFormat != '__home__') ? siteSettings.uriFormat, + hasErrors: (section.type == 'single' and siteSettings ? siteSettings.hasErrors('uriFormat')) }, uriFormat: { value: siteSettings ? siteSettings.uriFormat, @@ -151,19 +151,20 @@ class: ['single-uri', 'type-single', section.type != 'single' ? 'hidden']|filter }, uriFormat: { - type: 'singleline', + type: 'twigfield', heading: "Entry URI Format"|t('app'), info: "What entry URIs should look like for the site. Leave blank if entries don’t have URLs."|t('app'), placeholder: 'Leave blank if entries don’t have URLs'|t('app'), code: true, - width: headlessMode ? 500, + width: headlessMode ? 500 : '40%', class: ['type-channel', 'type-structure', section.type == 'single' ? ' hidden']|filter }, template: not headlessMode ? { type: 'template', heading: "Template"|t('app'), info: "Which template should be loaded when an entry’s URL is requested."|t('app'), - code: true + code: true, + width: '40%', }, enabledByDefault: { type: 'lightswitch', @@ -175,6 +176,7 @@ rows: siteRows, fullWidth: true, staticRows: true, + section: section, errors: siteErrors|unique }) }} diff --git a/src/templates/settings/sections/_entrytypes/edit.html b/src/templates/settings/sections/_entrytypes/edit.html index 8c4c3ea79e1..7f5d57b97cd 100644 --- a/src/templates/settings/sections/_entrytypes/edit.html +++ b/src/templates/settings/sections/_entrytypes/edit.html @@ -11,6 +11,7 @@ {% import "_includes/forms" as forms %} +{% import "twigfield/twigfield" as twigfield %} {% block content %} {{ actionInput('sections/save-entry-type') }} @@ -99,7 +100,7 @@ {% endif %}
{myCustomField}
' }),
id: 'titleFormat',
@@ -108,6 +109,10 @@
value: entryType.titleFormat,
errors: entryType.getErrors('titleFormat'),
required: true
+ }, "Twigfield", "monaco-editor-background-frame", {
+ 'fontSize': 13,
+ }, {
+ 'SectionShorthandFields': section.id,
}) }}