Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I wrote up a small tutorial on how to get SVG Image Field working with Media Library on Stack Exchange here.
However, there is one small missing piece to get the SVG as Media source working with core Media module + Media Library.
The media library pop-up is missing a file upload form on the "SVG" tab.
I realize Media Library is still experimental in Drupal 8.7, however all signs point to this module being vetted and made official.
Comment | File | Size | Author |
---|---|---|---|
#13 | svg_image_field-media-library-3053011-13.patch | 2.13 KB | Eric_A |
#3 | Screen Shot 2019-05-06 at 11.46.22 PM.png | 119.76 KB | jwilson3 |
#2 | svg_image_field-media-library-3053011.patch | 2.1 KB | jwilson3 |
Comments
Comment #2
jwilson3This patch adds the missing pieces to get the SVG upload form working in the Media Library popup dialog, and to format the SVG field inside the media library.
Note: you should format your SVG field formatter on the Manage Form Display for the Media Library to have a width of 220 pixels, and an undefined height, and do not use the inline SVG formatter option.
Comment #3
jwilson3This needs work. The second step after uploading the image shows a broken preview image.
Comment #4
jwilson3I've written up a small tutorial on how to get SVG Image Field working with Media Library on Stack Exchange here.
Comment #5
kclarkson CreditAttribution: kclarkson commented@jwislon,
Is it possible to add your instructions into the README?
Thank you so much for making this happen!
Comment #6
scottsawyerI've been using this patch for quite a while now, would love to see it committed.
Comment #7
srjosh+1 RTBC
Comment #8
srjosh+1 RTBC (except would like to see README as well)
Comment #9
mandclu CreditAttribution: mandclu at Northern Commerce commentedI created #3175769: Update README with steps to use with Media Library as a child issue to get the README updated
Comment #10
jwilson3Patch added to the docs update issue, pls review!
Comment #11
mandclu CreditAttribution: mandclu at Northern Commerce commentedMerged this into a new 2.0.x branch, so we can have a beta release for this and other new features.
Comment #13
Eric_A CreditAttribution: Eric_A at RIVM, Dutch Open Projects commentedRerolled #2 by @jwilson3 for those seeking to cleanly patch the 8.x-1.3 release, not yet moving to 2.0.0-rc1. (Again for the info.yml dist file, not for the source file.)