Create a media_library form element

Created on 3 July 2019, over 5 years ago
Updated 25 January 2023, almost 2 years 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 13 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.71.5 2024