1

I use image upload default ckeditor and IMCE module for drupal 8. But both of them return relative paths.

Output code actual relative path:

<img src="/sites/default/files/Images/image1.jpg">

Output code expected absolute path:

<img src="http://example.com/sites/default/files/Images/image1.jpg">

How to correct it?

1
  • 2
    Why would you not want relative pathing? As soon as you pull down the code/db to another environment or working locally, the images won't work (or load extremely slowly because you're pulling them across the network).
    – Kevin
    Jun 27, 2017 at 23:58

2 Answers 2

1

IMCE has a checkbox setting to enable absolute paths in configuration page

1

Step to set absolute path of image in ckeditor.

  1. Firstly install and enable IMCE Module.
  2. Go to the editor setting "admin/config/content/formats/manage/basic_html" In CKEditor plugin settings disable "Enable image uploads Disable to use IMCE file browser." checkbox.

3.Go to IMCE setting page "admin/config/media/imce" and "Enable absolute URLs" checkbox in conman settings section. enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.