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 %}
@@ -19,12 +22,17 @@ }) }}
- {{ forms.text({ + {{ twigfield.text({ + id: config.id, class: 'ltr', name: "#{config.name}Subpath", value: config.subpathValue, placeholder: "path/to/subfolder"|t('app'), describedBy: describedBy, + }, "Twigfield", "monaco-editor-background-frame", { + 'fontSize': 13, + }, { + 'SectionShorthandFields': 0, }) }}
@@ -57,6 +65,7 @@ {{ block('sourcesField') }} {{ _self.uploadLocationField({ + id: 'defaultUploadLocation', label: 'Default Asset Location'|t('app'), instructions: 'Where assets should be stored when they are uploaded directly to the field, or via a front-end form.'|t('app') ~' '~ uploadLocationNote, name: 'defaultUploadLocation', @@ -69,6 +78,7 @@