This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

g.vanto67453
g.vanto67453

I am trying to intercept the file (Pages > Content > (menu bar) > Insert Image) upload location in order to push to Cloudinary and have the "link" returned as a CDN url - (to make deployment easier, no need to worry about image url's referencing dev location on deployment of code to live server).

Looking at the class https://octobercms.com/docs/api/backend/formwidgets/richeditor (modules/backend/formwidgets/RichEditor.php) I can't seem to see an event being fired for when a file is uploaded?

Any help much appreciated. g PS: How does one typically deploy static pages content? Because my images are all referencing local URLs (dev environment), in the page markup...

daftspunky
daftspunky

Hi g,

This is an advanced topic without a simple answer. Consider adding your own custom button to the rich editor, this happens in JS and not in PHP. Also, it might be worthwhile using the Media Manager s3 options which should support this out of the box already. See this article for more info: https://octobercms.com/docs/media/providers

Regarding the locally referenced URLs, you can rename them with a search and replace function in your code editor. However, you can also specify a preference to use relative links using the system.relative_links config option found in the config/system.php file.

I hope this helps!

g.vanto67453
g.vanto67453

Thanks Sam, I have delved a little into the editor code, it's quite hefty!

I'm thinking might be simplest to just update all content (static pages) on production, git commit and push and then pull on DEV again (at which point image URLs will point to production location which will be fine).

Thanks for the relative links tip too.

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.