We were hoping to have unified captions maintained in the media library. I added a caption field to the "image" media type, "field_image_caption". That's great for places where we are using media library images in templating, I can theme their output how I want. However I am not seeing an easy way to get it to play nice with the editor's built-in "caption" function. Ideally if the person clicked on "caption" in the editor then the caption would be prepopulated from the media library field (field_image_caption).

I suppose a less-idea alternative would be to disable the editor's caption ability and simply doing some twig to theme the media library's field as a caption, but that will risk losing captions on previous pieces of content that relied on the caption function in the editor.

Of course we could probably come up with some convoluted theming logic to check all eventualities, is built-in caption field populated, if not use caption from media library (or vice-versa).

Is there an option I am overlooking that ties the editor's caption function into a media field, as would seem ideal?enter image description here enter image description here enter image description here


Your Answer

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

Browse other questions tagged or ask your own question.