1

I want to insert an image into node body content using Ckeditor and Media. Everything seems to work except all I get is a link to the image file but I would like it to insert an image tag. When I click Ckeditor's Add Media button and choose an image I get an option Current format is and I can choose from Default, Preview and Teaser. While the first two return nothing, Teaser at least inserts a link to the image file.

How can I get it to insert an image tag instead of a link?

I am using Drupal 7.22 with Media 7.x-2.0-unstable7, Wysiwyg 7.x-2.2 and the latest Ckeditor.

2
  • I know it is possible. Example. What needs to be configured to achieve this?
    – daniels
    Jun 20, 2013 at 18:07
  • Found a solution. See my answer below.
    – daniels
    Jun 29, 2013 at 14:33

2 Answers 2

2

Insert Module will do that, it will place the image in body field. Support for all major WYSIWYG editors, including tinyMCE, CKeditor.

Insert is a utility that makes inserting images and links to files into text areas or WYSIWYGs much easier. It adds a simple JavaScript-based button to FileField and ImageField widgets. When used with ImageField and ImageCache, images may be inserted into text areas with a specific ImageCache preset.

enter image description here

2
  • Thanks for the answer. I guess it would work but I would loose the library features of Media, right? Let's say, I would like to use the same image in another node. Does Insert allow me to reuse the same image or does it have to uploaded again?
    – daniels
    Jun 20, 2013 at 17:46
  • You need to upload again
    – Bala
    Jun 20, 2013 at 17:47
0

After lots of trying and searching for answers I finally found an answer. It turns out that Media 7.x-2.0-unstable7 and Wysiwyg 7.x-2.2 currently only support CKeditor up to version 4.0.3. Any version greater than that will, at least for now, fail. If you have to downgrade your CKeditor version and have mixed up buttons make sure to empty your cache. After that the Media button works as expected and lets you insert images using image styles defined at admin/structure/file-types/manage/image/file-display. Hope this helps anybody!

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.