Insert images to a RichEditor field without the full url

Hi,

I prepare a plugin which has a RichEditor field to display a html formated text with the |content filter in the frontend.

So far it all works good: The html is rendered properly as well as the october-links generated by the insertPageLink toolbar button (<a href="october://cms-page@link/404"></a> for example… in case someone would like to link to an error page :smiley: )

However, if I insert an image through the insertImage field via “Browse Media Library”, the image is inserted with it’s absolut url instead of just the relative path.

Since I work on several different subdomains (like local.xy.com or dev.xy.com) and prepare the content for the live environment, I dont want to have the absolut urls to the local environment ofc.

Right now, I have to remove the url part directly in the html for every image I insert. This is quite annoying and buggy.

Is there a solution that I only insert the relative image path ot such an october:// shortcut like for the cms-page above?

Thanks a lot ^^

Try adding RELATIVE_LINKS=true to .ENV configuration file.

2 Likes

That didn’t work but I found this in the system.php configuration file
'relative_links' => false,

…and changing it to true worked, so thanks for the final hint! :slight_smile:

2 Likes