Inline images in Drupal with WYSIWYG API, TinyMCE and IMCE

18 +
k4ml's picture

Yeah, it works. I'm using

Yeah, it works. I'm using this approach too in my websites. Except that when you want to add the image, it result in 2 popup windows. Be prepare to answer this when use ask ;)

So far I haven't seen yet any tinymce + filebrowser integration that feel 'seamless' (except Wordpress). Everyone seem to use the default tinymce image popup and then attach some button to open up another popup for file browser. I'm not sure how hard it is to create custom tinymce button that will directly open a popup for filebrowser.

Ivan's picture

Hey. Thanks for the

Hey. Thanks for the tutorial. 

I've found myself moving from FCKeditor module + builtin file browser to the WYSIWYG Api + IMCE + bridge and I agree that it works really well.

himerus's picture

It is a decent option for sure

Thanks for the comments!

Again, my real reason for posting this was that the question was posed to me on how to set this up using these modules, and it is something that I've done over and over both on my own site(s) and others as well. The definite issue is usability of this system to the person creating nodes and inserting images with those 2 popups.

It would be nice to see a modification of IMCE that added a direct popup to the file browser, and would then directly insert the appropriate code into the editor.

Jake Strawn
Drupal Rockstar

alex overton's picture

Thanks :-)

Great tutorial , Thanks for taking the time . Clear instructions very informative wow ! Confirmed my thoughts and I had forgotten about the IMCE bridge . CHEERS !!

 

Have a nice day !

Alex

Anonymous's picture

Thank you

This was very informative. Thanks for the posting.

whatdoesitwant's picture

ïmce

Nice vid. If, like me you really dislike imce's interface, you can use filefield_sources as a sort of overlay.

Ayman's picture

Excellent .. but a feature missing?

Excellent and really helpful, thank you!


But I was hoping to see the option of adding a "description" for each uploaded file. Then a way for this description to appear under the image (just like image assist does). Have you encountered any such requirement, or know of a proper solution (modules) for it?


Thanks!

Jrose's picture

Might have missed something.

First off, Let me say thank you. I have been looking for a simple solution to adding inline images.  I admit I am a newbie to Drupal.

I have setup everything up following your video that you have put together. I did note that you didn't go over everything that was in your blog post, which you stated in the clip. I did skip over the Configuring IMCE per user roles because right now the site is just for me and using it to learn Drupal. Everything appears to be working except...

After I click save when creating the new content I do not see the image on the newly created page.  Everything works up to that point.

My setup is:

Drupal 6.10 - default settings

Modules:

WYSIWYG

IMCE

WYSIWYG IMCE Bridge

TinyMCE placed into the following location: /sites/all/libraries

Any guidance here would be much appreciated.

Regards,

Joe

 

himerus's picture

It's the input filter

You've got a easy issue to solve. :)

It wasn't mentioned in the post or the video, and should have been.

By default, the two input filters that ship with Drupal are Filtered HTML and Full HTML. Filtered HTML filters out many things and only allows a bare set of tags to be used. Oddly enough, the IMG tag is NOT set up in that filter.

You can do 1 of 2 things to easily solve this. Either change the input type to Full HTML on those posts, OR the more appropriate fix for me personally is going into the settings for the Filtered HTML input filter, and adding <img> to the allowed tags list.

Jake Strawn
Drupal Rockstar

Kelly's picture

Hey this page really

Hey this page really informative and interesting. I tried to do the same thing that jrose did, but I can't get iline images. I have added <img> to my filter html (under input formats). But still no luck. I have got inline images to work by other methods, I would much rather use this one though. I don't know if that is enough info for you to try to do anything, but if you have any ideas, I would love to hear them.

Joanne's picture

Image Links

might not be the best place to post this comment, but just bumped into your blog. been searching everywhere in how to put images in the footer & block regions. sounds simple? i'm having an extremely hard time.

i downloaded theme_image & linkimagefield. have no idea if that's what i need.

i also tried this:

<?php $image = 'myfile.jpg';header('Content-type: image/jpeg') ;$source = imagecreatefromjpeg($image) ;?>

JRose's picture

Worked

Adding the tag to the filtered HTML tag list worked.

Thank you,

You wouldn't happen to have a guide on adding a gallery would ya?

hixster's picture

Thanks great tutorial

Hey Jake,

Thanks for taking the time to post this great tutorial. I am always looking at ways to make image uploads easier, especially for my clients. I have been using the FCKEditor & ImgAssist modules for a while, but will probably switch to this method as it's seems way less clunky.

Just out of interest, which theme are you using for you admin pages and admin menu, it looks pretty clean.

 

Thanks again!

himerus's picture

The admin module/theme

For this tutorial, and still on my own site, I have the Admin module (http://drupal.org/project/admin) The version 1 of that module provided both the functionality, and the admin theme.

Since then, it has changed a bit, and the 2nd version of the Admin module only provides a sidebar or top region method of getting to the places you want to go, and reorganizing the IA of the sections in the administrative section. The new version doesn't provide a theme, but I now use the Rubik theme provided by Development Seed. (http://code.developmentseed.org)

The combination of those give a great interface for D6 sites, and every client I've pushed those off on have loved the interface.

Jake Strawn
Drupal Rockstar

girish's picture

Hey, Thanks a lot for the

Hey, Thanks a lot for the tutorial. As it is i'm a newbie to drupal and found this tutorial helpful.

initially i had tried fck editor with wysiwyg without much success, but your tutorials helped me set tinymce properly.

But there seems to be a problem. When i insert an image or try to embed a video it appears in the editor box but when i try to preview or save, it gets replaced by html code with the address.

As you have earlier recomended i added <img> tag to filtered html and also used full html type. But it dint change anything. I dont get whats wrong with it.

Anyways thanks again!

Automatic Athlete's picture

Finally!!! A tutorial that works!

Just wanted to say thanks so much for you insight!!! I have scoured the internet for some explanation of inserting inline images in Drupal and you have helped me with your solution!!!


Great work and thanks again!!!


The Automatic Athlete

Anonymous's picture

Alternative

There is also a alternative way with http://drupal.org/project/wysiwyg_imageupload

It integrates with all editory in the WYSIWYG  module (using its api) and is there cross editor compatible. It aims to be very easy and utiliazes imagecache.

You can look at this http://www.youtube.com/watch?v=LEKpvI1G8qE videocast to see it in action

UKC's picture

Great work!

Thanks alot for a wonderful tutorial. I am also a newbie to drupal and your tutorial really helps me.

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <h2> <h3> <h4> <h5> <h6> <img> <p>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Twitter-style @usersnames are linked to their Twitter account pages.

More information about formatting options