I can't count how many times this topic comes up in Drupal, and I personally have had to deal with a clean way to implement inline images in posts on a ton of occasions. There are a lot of options out there, but I have used this one sucessfully on multiple occasions, and only recently implemented this exact solution on my own blog a few weeks back, and had the topic come up again today with some questions from @susanmacphee.
In Drupal 7, with image field and image cache functionality in core, we may begin seeing many more simple implementations of images inline, but for now in Drupal 6, we are still stuck with some clunky options to make it "simple". Again, please note this is NOT the only way to implement inline images, but I've found it offers the most flexibility for me personally.
The Drupal Modules you will need
- WYSIWYG - offers an API for implementing a variety of WYSIWYG editors including FCKeditor 2.6, jWYSIWYG 0.5, markItUp 1.1.5, NicEdit 0.9.0, openWYSIWYG 1.4.7, TinyMCE 3, TinyMCE 2, Whizzywig 55, WYMeditor 0.5, YUI editor 2.7.0
- IMCE - IMCE is an image/file uploader and browser that supports personal directories and quota.
- IMCE Bridge - This module is acts as a bridge between the IMCE module and the Wysiwyg module.
For the purposes of this implementation, I'm going to assume you already have the WYSIWYG installed and configured with your chosen editor. Instructions on istallation for the WYSIWYG module can be found in this handbook page.
Also, for the purposes of this demonstration, I'm using TinyMCE as the editor, but I believe the instructions here will work with both FCKedtior and TinyMCE.
Turning on the modules
Once you have downloaded, both the IMCE and IMCE Bridge modules, you will need to turn them on at admin/build/modules. The default IMCE module can be found in the Other section of modules, and the IMCE WYSIWYG Bridge can be found with WYSIWYG under User Interface modules.
![]()

Configuring the WYSIWYG module
Once all the modules are turned on, the first thing you will want to do is head over to admin/settings/wysiwyg and for each input filter you have selected to enable a WYSIWYG editor for, you will need to select the associated edit link in order to add the image handling options to that input format.

Once you have found the edit page, you will need to enable two options, Image and IMCE. These are found under the Buttons & Plugins fieldset. On my setup, the Image checkbox is the 6th from the top in the right column, and the IMCE is in the last row in the center. This may vary depending on any other modules you have enabled that add additional options to the WYSIWYG module.
Now once those are enabled, in your default editor, you should (at least as super admin have the image button on the WYSIWYG toolbar. It's there near the middle of the screenshot below. I'll get to configuring the IMCE & role based permissions in a moment here.
![]()
Configuring IMCE per user roles
The IMCE module offers great flexibility when configuring how your roles may interact with uploading images to the server. This can play an important role when dealing with a large site with hundreds and thousands of users, and limited server space. You can start configuring the IMCE settings at admin/settings/imce.

You can see two sections to this configuration form, first the IMCE profiles, and second, the assignments of profiles to roles. By default, there is a custom profile that is applied to user 1, which is great when using a single user blog to allow the admin to really do whatever they want, upload as much as they want, etc. For the demonstration here, I'm just going to show what is under that page, however, you can create as many profiles as you want, and configure different settings for each, and apply them to the roles associated with your site accordingly.
You will see in the following screenshots that the IMCE module does a GREAT job of putting good descriptions. If you get confused, read closely, and the answer should be there!! You may also click on the screenshots below for the larger version.
The settings available in the above screenshot are:
- Profile Name - Just an identifier for the profile
- Maximum File Size per Upload - The maximum size per file uploaded. This cannot exceed the limit configured in your php.ini
- Directory Quota - This quota is for any directory the user has access to. So if this is set to 2MB, and the user has access to 5 folders, they could upload up to 10MB spread across those folders they may access
- Total User Quota - The total quota that the user must stay under.
- Permitted File Extensions - This one is VERY important when granting users access. In my example as admin/user1 I have placed no restrictions, but this should be set to something like .jpg, .png, .gif
- Maximum Image Resolution - The largest size a user may upload. You may want to use this to keep a user's original upload from taking up too much space on the server. There are resize options available, but this original image will still be uploaded and stored.
- Maximum Number of Files per Operation - allows a user to select more than 1 image (not to upload at a time, but to operate on) to resize, delete, etc.
Next, you are able to configure how the profile will have access to certain directories on the server. Again, in my configuration for user1, there are no restrictions here, but in order to create a directory for each user to manage user quotas, you could use the following token to accomplish that:
users/user%uid creates directories such as users/user1, users/user42, etc.
For each directory you configure here for a profile, you can choose to allow them to browse, upload, create thumbnails, delete & resize in that directory. This is is really helpful if you want a user to have access to a directory to browse for images you may have set, but NOT be able to upload to that directory. The Include subdirectories option for each will apply the same settings to those directories underneath the one defined.
The thumbnails section is quite handy if you want to automatically generate alternate sizes for the images being uploaded by a user. You can create as many as you like by simply entering in a name, a set of dimensions using WIDTH x HEIGHT, and can optionally add a prefix and suffix to the file name in order to avoid naming conflicts.
Using IMCE in your WYSIWYG editor
And for the final product, I'll show you a few shots of using IMCE in your editor to get images inline with your content!
You can click on the image button in your WYSIWYG toolbar to open the initial image configuraiton popup.

Next to the Image URL field, you see the browse button, which will allow you to open the IMCE file manager, and upload images to the server, and insert or manipulate images already on the server.
Finally, we have the options available to us here. In the upper left, we have the file browser that shows us the directories we have access to, lower left is a log of actions and operations, lower right is a preview window, and the upper right are the images located in the directory being browsed. At the top of the window you will see upload, delete, resize, and Send to TinyMCE.
Choosing Upload will present you with an upload field to add a new image from your computer, and allow you to choose which if any of the preconfigured thumbnail sizes in the profile should also be created when uploading this image
Selecting an image, and then choosing delete will prompt you first, then delete the image in question.
Selecting an image, and then choosing resize will give you boxes for height and width and an option to create a new image, or resize the original. If you just enter a width, and tab out of the box, it will auto detect the appropriate height to use to keep scale.
Once you have uploaded or resized any images you need, you may select an image, and then choose the Send to TinyMCE option, and the image details will be sent back to the small popup window where you can review the location, and click the Insert button, finally inserting the image into the editor.
Conclusion
This was a damn long example in order to accomplish what really should be so simple you'd think in Drupal. Please feel free to chime in on eaiser ways, or why these modules may or may not be good to use, but for the features they do implement, especially the quotas per role in IMCE, it is a powerful option, but really takes some documentation for end users to be able to use this method quickly.
Also, configuring this appropriately can be a challenge, and I hope this has at least given a brief overview of where to get started!!





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.
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.
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
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
Thank you
This was very informative. Thanks for the posting.
ïmce
Nice vid. If, like me you really dislike imce's interface, you can use filefield_sources as a sort of overlay.
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!
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
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
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.
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) ;?>
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?
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!
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
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!
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
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
Great work!
Thanks alot for a wonderful tutorial. I am also a newbie to drupal and your tutorial really helps me.
Post new comment