Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 301208

Ensure that embedded media displays sanely by default

$
0
0

Problem/Motivation

In #2940029: Add an input filter to display embedded Media entities, we added the ability to embed media entities into WYSIWYG text editors and HTML content, using an input filter. By default, the media items are embedded by rendering them through their "full" view mode (although this can be overridden by changing a special data attribute in the raw HTML). The "full" view mode might not be entirely appropriate for an embedded representation of a media item, so this issue is where we can explore the possibility of adding a new view mode specifically for use when embedding media items in HTML, and changing the input filter to use it as the default view mode.

Proposed resolution

  • Add a new view mode 'Embed' that will be installed with the media module.
  • When adding a new media type, a sensible default entity view display should be created for that media type.
  • For media types with an image source, the image style should use the 'large' image style that comes with the Image module.
  • If for some some reason the 'large' image style has been deleted, it will be regenerated when adding a media type with an image source. This is just a default and can be changed by site builders.
  • If a site builder deletes the 'Embed' entity view display for a media type, it won't be regenerated when resaving a media type. They are only generated when adding a new media type through the UI.
  • If a media type is generated programmatically, it won't generate a media entity view display. They are only generated when adding a new media type through the UI.
  • Standard and Demo Umami profiles will ship with a media.image entity view display configured to use the 'large' image style.
  • An upgrade path will be added, so that existing media types will get an 'Embed' entity view display when upgrading the media module.

Remaining tasks

Once we've decided what we want, make it happen.

User interface changes

TBD.

API changes

TBD, but likely none.

Data model changes

None anticipated.

Release notes snippet

TBD


Viewing all articles
Browse latest Browse all 301208

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>