Current approach does not work with ajax uploads
| Project: | Easy Image Insert |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | dboulet |
| Status: | won't fix |
Jump to:
Considering that CCK loads fields that contain multiple values using ajax, it doesn't make sense to use the current approach of altering the imagefield widget using hook_form_alter(). I've rewritten this module, which now instead provides a completely new CCK widget for the filefield. This widget borrows heavily from the imagefield widget, and so behaves in the exact same fashion, but contains the extra form items that allow you to insert the image.
This approach removes the need for creating any system variables, as the widget is now activated per field, instead of per node.
Another thing that I've changed is to rely more on Javascript to provide the 'Insert Image' button and select boxes, loading only the imagecache paths in the html of the imagefield. This allows for graceful degradation in the case that the Javascript is not activated.
I've attached the entire rewritten module, feel free to to test and give feedback--but keep in mind that I am not officially attached to this project. I'll leave it up to the module maintainers to decide to adopt this approach or not.
| Attachment | Size |
|---|---|
| easy_image_insert.zip | 2.96 KB |

#1
Printing urls works ok for me, but I don't see inserting button.
The .js file seems to be included, so I'm not sure what's the problem..
You print the urls for images - may that approach is not very 'quick' so editor have to select the url and copy&paste it - but at the same time it gets more TinyMCE power like selecting align/border/space when inserting.
Your code looks more professional and correct then native Easy Image Insert module. Thanks!
#2
The URLs get printed onto the page, and then the JavaScript works with those to create the interface used to insert the image. If you replaced the current official release if this module with mine, it's possible that you need to clear your browser cache for my JavaScript to work.
#3
No, the problem was that I've used alpha version of filefield, they've changed classnames since beta release. After the upgrade everything seems to work ok :)
#4
Right, I forgot to mention that my code only works with the 6.x-3.0-beta3 versions of filefield and imagefield.
#5
This is just what I was looking for. I had problems getting the offical version to insert the images, but this works great. The only thing I can't figure out is how to add presets. Under the preset option there is only "Original" available. I do have presets that I'd been using for other parts of my site, but I can't figure out how to properly add presets for this module.
Could anyone explain how to do this?
#6
Hi Jboo, I think that only presets that are prefixed with "eii_" are used by this module. A word of warning: it seems like this module has been abandoned and development has stopped completely. Before deciding to use this module, I would take a look at Filefield insert or Image with Image Assist. Good luck.
#7
Thanks dboulet, I thought that was the case and had tried it, but having rechecked I noticed I'd used "eei_"!! No wonder it didn't work. Thanks for your help.
#8
The module is declared deprecated.