{% 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 }) }} |
' ~ "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 ~' '~ "Note that the subfolder path can contain variables like{slug}
or {author.username}
."|t,
errors: settings.getErrors('defaultUploadLocationSubpath')
}, uploadLocationInput('defaultUploadLocation', settings, sourceOptions)) }}
{slug}
or {author.username}
."|t,
errors: settings.getErrors('singleUploadLocationSubpath')
}, uploadLocationInput('singleUploadLocation', settings, sourceOptions)) }}