Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Changing Content Editors default upload folder.


Go to End


2 Posts   998 Views

Avatar
zigonick

Community Member, 6 Posts

6 March 2015 at 11:27am

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").

Avatar
kinglozzer

Community Member, 187 Posts

7 March 2015 at 12:11am

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