Change record status: 
Project: 
Introduced in branch: 
8.8.x
Introduced in version: 
8.8.0-alpha1
Description: 

The ability to display Media entities from within a text field has been added, through the introduction of a new "Media embed" text filter (@Filter=media_embed).

This filter transforms <drupal-media> tags with the data-entity-type, data-entity-uuid and data-view-mode attributes into rendered media entities.

To use it:

  1. Go to Administration → Configuration → Content authoring → Text formats and editors
  2. Select a text format (e.g. Basic HTML)
  3. Check "Embed media" under "Enabled filters"
  4. Add <drupal-media data-entity-type data-entity-uuid data-view-mode data-align data-caption> in "Limit allowed HTML tags and correct faulty HTML" (data-view-mode is optional as of #97) if the filter is enabled and "Save configuration".

    Note that this is also visible there, but for the purpose of testing this functionality, we don't need to change the default settings:

  5. Go to node add article (/node/add/article)
  6. Select "Source" from the CKEditor
  7. Add
    <drupal-media data-align="center" data-caption="The first core Media embed ever." data-entity-type="media" data-entity-uuid="84911dc4-c086-4781-afc3-eb49b7380ff5"></drupal-media>
    
    <p>and</p>
    
    <drupal-media data-align="center" data-caption="This media entity is missing" data-entity-type="media" data-entity-uuid="wrong"></drupal-media>
    

    and save, you should now see:

Impacts: 
Site builders, administrators, editors
Module developers
Themers
Site templates, recipes and distribution developers