When editing the 'content' block of a page in the wysiwyg editor was wondering if there was a way to change the default upload folder for the popup file up-loader ("Insert Media").
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hi zigonick,
You can change the default upload location for all files by editing the Upload.uploads_folder configuration setting. E.g. in your config.yml:
Upload:
uploads_folder: 'MyUploadsFolder'
This would result in files, by default, being uploaded to the 'assets/MyUploadsFolder' directory. If you wish to change it just for the HtmlEditorField, you can do that by adding an extension to HtmlEditorToolbar and using the updateMediaForm() method.
As an alternative, you might want to consider the selectupload module which allows you to manually pick a directory when uploading: https://github.com/silverstripe-labs/silverstripe-selectupload.
Hope this helps,
Loz