[PP-1] [Meta] Consider adopting Media Widgets as an experimental feature

Created on 4 December 2024, 3 months ago

This was initially discussed with @catch and and the first step was posted as a Drupal CMS proposal at:

🌱 [Meta] Consider adopting Media Widgets as an experimental feature Active

Problem/Motivation

Currently Drupal core is not fully ready to adopt media entities as the default choice over raw file entities.

The Media Widget module was developed as part of a client project with the goal of being ready when this would eventually happen. The module defines a basic upload widget for media types not allowing to reference existing entities, except from the current one.

Additional project requirements were to define a single Link widget capable of handling any URL the user could enter: a URL could represent an OEmbed resource, a plain link, or even a non-OEmbed resource to be embedded in the site page via custom markup. This was implemented through the following strategy:

  • The Media Widget module exposes an OEmbed media widget mimicking the core one provided by the media library, but without the ability to reference existing media items.
  • The Media Link module defines a new Link media source and replaces the OEembed media widget class with a new implementation allowing to fall back to a raw link media item if no OEmbed provider matches the given URL.
  • The Media Remote Embed module defines a new Remote Embed media source and replaces the Media Link OEmbed media widget class with yet a new implementation allowing to detect a custom embed provider in the given URL. If no such provider is found, the widget falls back to a raw link media item, unless a matching OEmbed provider is found.

This allows to handle all sorts of user inputs via media items, which in turn opens the possibility for further improvements.

Proposed resolution

Consider adopting the Media Widget ecosystem as an experimental feature.

Remaining tasks

  • Discuss the proposed solution
  • Review the existing code
  • Create implementation tasks

User interface changes

TBD

API changes

None currently foreseen.

Data model changes

None currently foreseen.

🌱 Plan
Status

Active

Component

Idea

Created by

🇮🇹Italy plach Venezia

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024