When users try to upload images for including inline in their stories/posts, the image upload pop up includes all the fields associated with posting content. Menu Settings, Input format and so on.
Can those things be disabled so that the image is simply written INLINE into the story?
So far all user posts with supposedly inline images just create a different node and write both to the screen - but separately. That's not INLINE at all.


jaharmi’s picture

Inline images are one of the most basic features that I’d expect a CMS to handle. Userland Manila—the first Web content management system I used—handled this very well out of the box in 1999.

In comparison, I’ve been really struggling with this in my six-month old Drupal 4.7 install. I’ve seen lots of different ideas and solutions presented in my Web searches on the topic. I’m very frustrated with the situation and my feeling is that there needs to be one sane way to handle inline images, and frankly, it ought to be better than either hardcoded img links or what I was doing in 1999, or it’s not worth it. (If some developer is interested, I’m more than happy to outline my thoughts in a less rant-worthy fashion.)

Not found one solution works for me yet; right now, using attached images and inserting the full img tags by hand kind-of works but doesn’t display images for guest visitors. I’ve also tried various modules, including img_assist (which just gives me a blank pop-up window in Safari and Firefox), and even those don’t work for me. (And the modules aren’t necessarily easy to install, themselves.)

I haven’t tried using the [image:] syntax, partly because I can’t find any coherent documentation on it. However, I did see something about it in the read me for Drupal 4.5 or 4.6, when I was dabbling but not yet running my site with the software.

I do feel like image handling is a failing of Drupal and I’d love to see it fixed, and am willing to be part of the solution.


Chris Star’s picture

I am by no means developer caliber here. That's why I'm using a CMS in the first place,
but it seems to me that if I could..

a) create a user directory inside FCKeditor's file browser's UserFiles folder with each new registration (I prefer FCK to tiny, though I couldn't give you 2 good reasons).

b)pass the current user id to FCK during the user's create content process - in other words Any time FCK is invoked - I could provide users upload an insert mechanisms in their own folders.

c) get even 1 of the Drupal input filters to write a working image tag (so far I've not succeeded in planting even one image inline with content [ie text] supplied by users)

Then I could get inline images that users wouldn't have to 'learn" how to insert. FCK's file browser is intuitive. That is, EASY. users on some of my other sites using that tool find it very friendly.

I changed the default toolset in fckeditor.js to get more of FCK's tools opened up, but Drupal stripped the Only local images are allowed. tags from posts. So that didn't work. I have yet to find a filter / html code setting that doesn't strip these tags.

image_assist is not the least "user friendly" IMO. I can get the image into the image_assist pop up , but they don't get inserted into the actual user' posts.

Any suggestions?

I also have gallery2 installed, and I despise the necessary g2 specific tags required to drop a g2 image into a post. That's horrible. Users won't do it.

Getting a single users g2 images loaded as thumbnails for selection inside a SIMPLE image insert mechanism (like FCKeditor's file browser) would be great. But, I've yet to dive in deep enough to see how and where g2 images are stored, how they're referenced.

I could sure use a good explanation of how to get Drupal to write a working image tag. I know I must sound like a moron, but I've added Only local images are allowed. to allowed tags in both filtered html and full html and then tried posting with both input formats. It hasn't worked.

sepeck’s picture

the <img> tag is not part of the default allowed html in Filtered HTML. You have to add it. If you post content successfully with Full HTML then it's an input filter configuration issue.

That said, I am not sure how compatible img_assist is with fckeditor. img_assist has more testing with Tiny_MCE.

-Steven Peck
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
Test site, always start with a test site.
Drupal Best Practices Guide

Chris Star’s picture

Thanks for the post -

Yeah, I didn't wrap <img> in code tags in my previous post. That should say that I had added <img> to the allowed tags for both filtered and full html. Didn't work - jscript not passing the data from the img_assist form to the fckeditor textarea?. Or, is that not what it is meant to do?

And, yes, I can post content with either filtered OR full html with no problem - but images "inserted" via img_assist never make it to the acutal post text area.

Let me go over that more pointedly:

User begins creating "story". Form opens, and user begins to enter a subject/title and so on.
User writes to the body of the story, decides to add an image between paragraphs 3 and 4, so then clicks the "add image" button and gets the img_assist pop up.

All is well.

User either selects or uploads and then selects an image to insert into the post.

THEN - and here it gets ugly, user is asked to complete a form with titles, menu settings, etc - when all img_assist needs to do here is write the link to the chosen image into the story post the user is attempting to publish. Maybe that's not what it is supposed to do.

At any rate, completing the img_assist form and clicking the insert buton "seems" to do absolutely nothing. However, if the user continues with his story and publishes it, the image supposedly inserted into his story will appear on the rendered story page completely out of context, above and separate from the story into which it was supposed to be inserted, which is not INLINE at all.

So, I'll change my position, start a new topic maybe, asking How can I set up Drupal to allow users to add inline images with their post?

Thanks, Drupal Community. I appreciate your help.

sepeck’s picture

If you 'add an image' you are doing the whole process of adding an image. Images are nodes so you need to do the title, if a user has rights choose a place in the menu (optional) etc. img_assist then adds code to link to that image in the story (haven't used v5 yet). This link is to a different node but depending on settings can be html img src= or the filter tag system.

You might look at upload preview. This leverages the upload modules method of attach the image to the individual node (no re-size etc). You can then link with img src or what have you. Not sure, been awhile since i have used that method.

Image handling is complex and no one need suits everyone which is why there are several approaches and no clear winners yet.

-Steven Peck
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
Test site, always start with a test site.
Drupal Best Practices Guide

DocMartin’s picture

I've found this thread after looking around to solve what indeed should be pretty simple, leastaways as far as my naive notions go: get an image file into a folder, link to it, have it display. Done this without great difficulty in Joomla, via ftp then wysiwyg editor. But Drupal indeed has some tripwires, starting with that html filter!

w Drupal, fckeditor works for me if to imce (tho not if fckeditor browser pops up, looking in wrong folder: something I hope to fix soon).
In this case, surely my images aren't nodes - but I'm placing them within nodes (?)
The images can be reused if needs be.

I have image assist in tandem with fckeditor, but get new pages (which are whole image nodes?) for the image, and yes, get more than simply image, inc titles. Creating nodes, which include images?

Also checked out image [imagefield] within CCK; and imagecache.
Seen Lullabot article:
- rather bamboozled me I'm afraid, and seems over complex for just adding images to stories.

Hadn't seen re upload preview: looks promising.

Been pondering a sketchy handbook page on images: judging by some posts I've seen, an outline of some options might be useful.

Martin Williams
CheungChauHK 長洲HK - South China Sea island in Hong Kong.

DocMartin and Hong Kong Outdoors

ontwerpwerk’s picture

As far as I know img_assist does not work with FCKeditor at the moment.
img_assist writes the html to the textarea but FCKeditor changes that textarea into an iframe, img_assist does not handle that so it won't work.

there are some alternatives: the internal fckeditor file management, use IMCE or manually copy image urls (from upload.module or from image nodes)

please note that the first two options are less secure than you might want

I work for Ontwerpwerk