Create a media_library form element

Created on 3 July 2019, almost 5 years ago
Updated 25 January 2023, over 1 year ago

Problem/Motivation

Developers have no easy way of adding the Media Library to a custom form. A real world use case would be creating a custom layout plugin for Layout Builder that gives a content editor the power to select a background image from existing media in Drupal. The only current solution is to use the entity_autocomplete element or the entity_browser β†’ element which is not very straight forward how to use ✨ Simplify adding Entity Browser form element to custom form Needs work .

Proposed resolution

Abstract the Media Library from the MediaLibraryWidget to a media library form element. The widget will instead call the media library form element and the media library can be used outside of the Field API.

Remaining tasks

TBD

User interface changes

There should be no UI changes.

API changes

The media library will be available to all forms.

Data model changes

None.

Release notes snippet

TBD.

✨ Feature request
Status

Needs work

Version

10.1 ✨

Component
MediaΒ  β†’

Last updated about 16 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States nathandentzau Rhode Island

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.

Production build 0.69.0 2024