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