2

Since Drupal offers many different approaches to inserting images, I am a bit lost. I am looking for a configuration that allows editors to comfortably insert images with captions. My requirements are:

  • Works with WYSIWYG editors
  • One input form to upload the image and enter the caption
  • At most one more step in the workflow to position the image in the text
  • Ability to create blocks with several images side-by-side
  • Ideally, no code changes (inserting JavaScript or altering PHP) should be necessary in order to retain upgrade capabilities

It seems that many people are using a combination of the wysiwyg module with IMCE and the IMCE wysiwyg bridge. However, I don't see any support for image captions in that toolchain.

The other alternative is the Insert Image With Text module, which is still in beta and rarely discussed anywhere. As far as I understand, this method is not really practical because it limits users to one image per node (or would require several image fields in the respective content type).

Is there any combination of modules and content settings that can fulfil those requirements?

3
  • I would also add ability to multiple uploads with "one click".
    – David
    Commented Jun 10, 2014 at 12:24
  • Have you tried IMCE + CKEditor? Without the WYSIWYG module in between. Imo the "adding a caption" should be the job of the wysiwyg editor, not of IMCE. But I don't remember if CKEditor does that..
    – donquixote
    Commented Jun 11, 2014 at 8:39
  • @donquixote, I feel that captions should rather be properties of the image object... and since HTML still doesn't offer a caption property for imgs, I feel that a Drupal field is a good compromise.
    – jstarek
    Commented Jun 17, 2014 at 12:15

3 Answers 3

3
+50

You are looking for Insert module.

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. When used with ImageField and ImageCache, images may be inserted into text areas with a specific ImageCache preset.

Features

  • Support for all major WYSIWYG editors, including tinyMCE, CKeditor, the WYSIWYG project (the recommended approach), and plain text areas.
  • Insert images using ImageCache presets
  • Maximum width setting for inserted images (for combined use with the Image Resize Filter module)
  • Per-field insert configuration

enter image description here

1
  • 1
    Thanks for the screenshot, which actually pointed out a configuration issue I had during previous testing. After reconfiguration, Insert indeed seems to do everything I need.
    – jstarek
    Commented Jun 17, 2014 at 12:12
5

Have you tried the Media module? From the project page:

  • Add media (images and video) into any textarea (requires Wysiwyg module).
  • Use the fields API (formerly CCK) to add fields to any type of media, eg. captions on images.
  • Plugins to use remote media from sites like YouTube, Flickr, ...
  • A unified interface for adding any type of media as a field to nodes.
  • Mass importing of files.
  • Drag and drop upload (with Plupload module).
  • Responsive image support (with Picture module).
1
  • Thank you for your suggestion. In the end, I found Insert better suited to my needs. Media seems to be the better choice for complex setups, but the necessary configuration was a bit too much for my taste.
    – jstarek
    Commented Jun 17, 2014 at 12:13
0

You can achieve that by using the Insert image with text module

This module extends the functionality provided by the Insert module, by extending the inserted markup for the image, to contain a text below the image. For all available styles, a variation with additional text is added the list of choices, and the entered description text is added to the wysiwyg where it's still editable in its own container. The inserted markup can be overridden by a template.

Usage

Install this module and the Insert module.

Create an Image field on a node, and check the "Enable Title field" option. In the field settings, at the "insert" section, check the "Enable insert button" field, and select the styles/presets you want to insert. Those with the description enabled, are prefixed with a "With description" text.

Now you can enter text in the field after uploading an image into the field, then select a style/preset with description, and the image will be inserted with the chosen description in the WYSIWYG.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.