This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
kattsoff
Hi! How can I add fileupload field in theme.yaml? I need to have opportunity update site logo in theme settings.
fredericomarinho16918
in theme.yaml, do:
form:
fields:
site_name:
label: Site name
comment: The website name as it should appear on the front-end
default: My Amazing Site!
site_logo:
label: Site logo
comment: The logo will be used in the website
type: fileupload
mode: image
imageHeight: 30
imageWidth: 152
filetypes: png
thumbOptions:
mode: crop
quality: 100
extension: auto
See fileupload topic: https://octobercms.com/docs/backend/forms#form-fields
fredericomarinho16918
To get in the front-end:
{{ this.theme.site_logo.getPath }}
or
{{ this.theme.site_logo.getThumb(300,auto) }}
Kuznetsov Semen
fredericomarinho16918 said:
in theme.yaml, do:
form:
fields: site_name: label: Site name comment: The website name as it should appear on the front-end default: My Amazing Site! site_logo: label: Site logo comment: The logo will be used in the website type: fileupload mode: image imageHeight: 30 imageWidth: 152 filetypes: png thumbOptions: mode: crop quality: 100 extension: auto
See fileupload topic: https://octobercms.com/docs/backend/forms#form-fields
And how to download more than one file. That is, support for the $attachMany behavior
1-4 of 4