Is it possible to set the folder used by HTMLEditorField's image button?

htmleditor
silverstripe-4
Tags: #<Tag:0x00007f10c93abae8> #<Tag:0x00007f10c93ab958>

#1

Silverstripe Version: 4.3

UploadField provides a setFolderName() function which allows you to control the folder for files (so that everything doesn’t end up in Uploads).

I am trying to provide the same functionality for files uploaded in HTMLEditorField. Eg, the website has a Blog (which makes heavy use of inline images), and I would like all these images to be stored in a “Blog” folder.

I wrote a module for SS3 that made this possible but am having no luck figuring out how I might accomplish the same thing in SS4. The SS3 version worked by extending HtmlEditorField_Toolbar, but this does not exist in SS4.

This page has documentation for Customising the “Insert” panels, but I tried the given example and it doesn’t seem to have any effect. The “updateFieldsForImage” extension point is not being called, and I can’t find any sign that this extension point actually exists. (Or ANY extension points on ModalController for that matter, despite the above documentation stating “There’s lots of extension points in the ModalController class to get you started.”)

Thanks in advance for any help.