upload_insert: Inserts attached files into body

Events happening in the community are now at Drupal community events on www.drupal.org.
mac2000's picture

This module adds insert buttons to attached files list (upload module), that inserts it into body in selected format. So there is no need in monsters like IMCE, Wysiwyg-imagefield etc., work out of box, supports wysiwyg, imagecache etc. Also when node deleted its files also deleted (via upload module).

Only local images are allowed.

Requirements:
* Upload module

Profit:
* Works out of box, no need in wysiwyg, jquery_ui, cck, views etc.
* Easy extend to support imagecache, lightbox etc via hooks.
* When node deletes - its files also deletes (upload module).

How this module work:
1. We are hooking form to determine is it node-form, and have it attachments, if so - including our js file.
2. In js file we going through each attached file and adding dropdown and insert button to them.
3. On insert button click we inserting content to body, if there is wysiwyg editor - then we inserting into it.

What this module does nots:
* This module just inserts selected template into body it does not provide any configurations like aligment, styles etc - all this can be done in your wysiwyg editor.

What will be done:
* hook_upload_insert_templates - that will collect insertion templates for different file types. So there will be way to easily extend module. At moment they are hard coded done.
* Add lightbox support. At moment only imagecache, file, image insertion implemented done.
* Permission to allow insertion of image in full size - for noob content editors done.
* Wide support of wysiwyg editors - at moment content propertly inserts into editor via detaching it, insertion, and then attach again - but there is way to insert directly into editor - implemented for tinyMCE.

Comments

You know about

greggles's picture

You know about http://drupal.org/project/insert right?

Your project seems very similar.

RE: You know about

mac2000's picture

Yep, I know about this module, but:

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.

To use this module you must install and enable cck, filefield, imagefield, also there must be defined filefield and imagefield fields foreach node type.

In my case - you just enabling default upload module - that will allow attach any type and count of files to node and there is no need in other modules and cck fields. So description will be something like this:

Upload 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 files attached to node via upload module.

What i want to accomplish is as simple as possible way of inserting images into node body without any dependencies like cck, wysiwyg, imce, imagebrowser etc, that will allow to make content manager friendly backend without need in tons of huge modules.

Probably modules may be merged into one, will try to contact author

Not interested in Upload module

quicksketch's picture

There was a request in the past about making Insert work with Upload module, but I've marked it "won't fix". There's no point in supporting the Upload module besides the short-term convenience. Upload module is officially dead; it's been removed from Drupal core in Drupal 7 and will no longer be supported or developed in the future. Additionally, the Upload module is absolutely terrible even in Drupal 6 (none of the following: upload directories, tokens, multiple fields, per-field settings, a progress bar, reuse of files, hooks of any kind, etc.) and I wouldn't ever recommend using it over CCK/FileField.

In any case, this module does sound almost identical. Insert offers the same functionality of working with ImageCache presets, already has hook_insert_styles, works with tinyMCE, CKeditor, FCKeditor, and any editor written correctly for the WYSIWYG module, works with Lightbox2 (which implements hook_insert_templates already), and everything else this module proposes to offer.

Sounds like this module is essentially is a backport of the existing Insert module for the D6 upload module. It's fine if it wants to exist for Drupal 6 only, but clearly this module doesn't have a future since Upload module is a dead module walking.

Contributed Module Ideas

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: