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.
Currently media_wysiwyg.module uses class for determining if an HTML tag is a media element or not.
Some WYSIWYG editors really like to mess-up the classes (for example the styles dropdown from CKEditor). I replaced all instances of "media-element" class in JS with a data-media-element attribute and this seems to improve the integration between media and the WYSIWYG editor.
I've currently tested this approach with inline images, youtube and vimeo videos with custom "preview" view mode exposed by media_wysiwyg_view_mode.module.
Comment | File | Size | Author |
---|---|---|---|
#1 | media-change_media_element_selector-2352163-1.patch | 3.4 KB | SchnWalter |
Comments
Comment #1
SchnWalter CreditAttribution: SchnWalter commentedDidn't test with this exact patch, but it should work.
Comment #2
SchnWalter CreditAttribution: SchnWalter commentedComment #3
mglamanWorks like a charm, and I agree this would be more dependable.
Tested against images and videos - our videos display a generated thumbnail within WYSIWYG, so it worked in advanced use case as well.
Comment #5
aaron CreditAttribution: aaron commentedCommitted to http://drupalcode.org/project/media.git/commit/c18634a.