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 toDrupal.insert.ImageHandler
hooking up to thealt
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.