{% extends "_components/fieldtypes/elementfieldsettings" %} {% import "_includes/forms" as forms %} {% macro uploadLocationInput(name, settings, sourceOptions) %} {% from "_includes/forms" import select, text %}
{{ select({ id: name~'Source', name: name~'Source', options: sourceOptions, value: settings[name~'Source'], }) }} | {{ text({ id: name~'Subpath', class: 'ltr', name: name~'Subpath', value: settings[name~'Subpath'], placeholder: "path/to/subfolder"|t }) }} |
{slug}
or {author.username}
."|t %}
{% if isMatrix %}
{% set uploadLocationNote = uploadLocationNote|replace({
'{slug}': '{owner.slug}',
'{author.username}': '{owner.author.username}'
}) %}
{% endif %}
' ~ "No sources exist yet."|t ~ '
') }} {% endif %} {{ forms.field({ label: "Default Upload Location"|t, instructions: "Where should files be uploaded when they are dragged directly onto the field, or uploaded from the front end?"|t ~' '~ uploadLocationNote, errors: settings.getErrors('defaultUploadLocationSubpath') }, uploadLocationInput('defaultUploadLocation', settings, sourceOptions)) }}