Add Bundle to <drupal-media /> for Decoupled applications

Created on 5 January 2022, over 3 years ago
Updated 12 December 2023, over 1 year ago

Problem/Motivation

As a Decoupled developer, I want the Bundle of a Media entity added as a data prop to the <drupal-media /> tag so I can load the Media Entity via the JSON:API

Steps to reproduce

  1. Create a decoupled frontend for a Drupal JSON:API backend
  2. Add the Drupal Media or Media Library CKEDitor plugins
  3. Create content with Media via the above CKEditor plugin (confirm that the source contains <drupal-media />)
  4. Transpile the unprocessed markup in the frontend (@TODO - Add example of this)
  5. Register a DrupalMedia component that registers the data props
  6. Load the Media Entity via the JSON:API

If setup correctly, the unprocessed markup should get transpiled and try to render a DrupalMedia component with the attributes bound as props. Using a Fetch hook or similar, the props could be used to run a JSON:API query, or be bound directly to a DruxtEntity component (if using Druxt) to render the Media entity.

However, as the Bundle isn't provided, the it's not possible to determine if it's Image, Document, File, etc.

@Todo - add example gitpod repository

Proposed resolution

Add the Bundle attribute to all relevant plugins.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Feature request
Status

Active

Version

10.0

Component
Media 

Last updated 20 minutes ago

Created by

🇦🇺Australia deciphered

Live updates comments and jobs are added and updated live.

Missing content requested by

🇦🇺Australia dpi
over 1 year ago
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024