Lee RowlandsSenior Developer
Introducing the File To Media module
A new contrib module that makes it easy for content editors to create Media Entities from existing Files.
We're pleased to announce the first release of the File To Media module, a relatively simple module that adds a much-requested content-editor feature - namely the ability to easily create a Media entity from an existing File.
The modules adds a new form for creating media entities from existing files, and a handy views plugin that gives you a drop-button of compatible media-types for a file.
To configure the module, edit the view provided by core at admin/content/files and add the File to Media field to the table and save the view.
Now when a user with the access files overview permission visits admin/content/files the get a handy drop-button link for any eligible files.
This link will show if:
- The file has no existing Media entity association
- The user has permission to create media of the given type
- The media-type supports files; and
- The file extension matches the field configuration for the media-type source field
After clicking on one of the links, the user is taken to a form to create new media of that type, with the file reference and media name pre-filled based on the given file.
A relatively small module, but a very useful feature for content-editors.
And of course, backed with the test-coverage you'd expect from any of the modules we maintain.
Give it a whirl and let us know what you think in the issue queue.
Watch this space for an announcement of a soon to be released related module that handles the opposite content-editor pain-point - deleting files from disk when deleting the associated media item.