Display File Entity fields when View Mode uses Picture and image inserted in CKEditor

Created on 13 November 2015, over 8 years ago
Updated 19 September 2023, 9 months ago

Is it possible to display File Entity fields (created in Administration > Structure > File types > Image > Manage fields) when adding an image in the Body field using CKEditor and when the "Enabled displays" in the View Mode is set to "Picture"?

Steps to reproduce - using "Picture" in View Mode does not display File Entity fields:
This assumes the modules listed below are enabled and configured.

  • In Administration > Structure > File types > Image > Manage fields, create two new text fields, one for Credit and one for Caption. Save.
  • In Administration > Structure > File types > Image > Manage display > WYSIWYG, set the Credit and Caption fields to be visible. Save.
  • In Administration > Structure > File types > Image > Manage file display > WYSIWYG, select "Picture" in the "Enabled displays" section and set the "Picture mapping." Save configuration.
  • Create a new test article.
  • Click in the Body field and then click on the "Add media" icon on the CKEditor toolbar.
  • When the media browser opens, choose a file and upload it. Click "Next."
  • Type some text in the Credit and Caption fields, scroll down and Save.
  • On the "Embedding" page, select WYSIWYG from the "Display as" drop-down menu; scroll down and click "Submit."
  • Close media browser if it doesn't close on it's own.
  • Save the article.
  • The image displays responsively using Picture's settings, but without the Credit and Caption fields.

Steps to compare - using "Image" in View Mode displays File Entity fields:

  • In Administration > Structure > File types > Image > Manage file display > WYSIWYG, deselect "Picture" and select "Image" or "Image with sizes" in the "Enabled displays" section. Save configuration.
  • Edit the test article and delete the existing image.
  • Click on the "Add media" icon on the CKEditor toolbar and add the same image from the library, again selecting WYSIWYG from the "Display as" drop-down menu; scroll down and click "Submit."
  • The image now displays with the Credit and Caption fields.

Modules in use:

  • Breakpoints 7.x-1.3
  • CKEditor 7.x-1.16+14-dev configured to use //cdn.ckeditor.com/4.5.3/full-all
  • CKEditor Line Utilities plugin 4.5.3
  • CKEditor Widget plugin 4.5.3
  • File Entity 7.x-2.0-beta2
  • Media 7.x-2.0-beta1+9-dev
  • Media CKEditor 7.x-2.0-alpha1+4-dev
  • Media WYSIWYG 7.x-2.0-beta1+9-dev
  • Media WYSIWYG View Mode 7.x-2.0-beta1+9-dev
  • Picture 7.x-2.13+2-dev

I looked at Add Captions to Picture β†’ , but that issue proposes to use a "Title is caption" flag and I'm trying to use File Entity fields.

The File Entity fields are displayed when an image is inserted in an article using a File field set to use a View Mode that uses Picture.

So how can File Entity fields, such as Credit and Caption, be enabled to display when inserting an image in CKEditor and using a View Mode that uses Picture?

πŸ’¬ Support request
Status

Closed: outdated

Version

2.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States camhoward New Hampshire, USA

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.

  • πŸ‡¬πŸ‡§United Kingdom lesleyfernandes

    I am closing all very old tickets that have not received comments for a long time. If someone is still facing these issues or thinks they are still relevant, please reopen it. Feel free to contribute with more info or a patch.

Production build 0.69.0 2024