Created on 18 February 2016, over 8 years ago
Updated 16 July 2024, 4 months ago

I'm having problems getting a caption to work.
I'm using the image field caption module and insert module,
I would like to insert an image and caption anywhere in the text.

How can I achieve this?
Thank you.

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom SBDC

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Image field captionモジュールとInsertモジュールを使って、
    画像とキャプションを本文中の任意の位置へ挿入したいです。

    どうすれば実現できますか?

  • There is good support for adding captions in the core Drupal image CKEditor plugin, which is why I had decided to drop the complexity from the Insert module for version 3.x.

    The Insert module also does not expose JavaScript APIs anymore as no one was using them and removing helped reducing complexity in respect to making version 3.x happen. However, if you want to achieve inserting captions, you should be able to implement your own module, which would need to depend on both the Insert module and the Image field caption module. In that module, you would overwrite Drupal.insert.ImageHandler with your custom extended version of just the same class. The concept of hooking up to the caption field should be similar to Drupal.insert.ImageHandler hooking up to the alt field.

    Additionally, the insert-image.html.twig template would need to be overridden attaching the caption field to the HTML output.

    This is just some pointers. Unfortunately, I cannot guarantee it would work just like that, and I do not have capacity to work on a submodule at this point. But feel free to open a new feature request to maybe join forces with others interested in that feature.

Production build 0.71.5 2024