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.
Hi,
Problem is that CKEditor is stripping out the PICTURE and SOURCE tags. I have tried multiple methods of allowing the tags, but nothing works.
I am using the following modules: Media, Breakpoints, Picture, CKEditor
Thank you for your input.
-Erik
Comment | File | Size | Author |
---|---|---|---|
#18 | media-support_picture_module-2496461-18.patch | 1.15 KB | ron_s |
| |||
#11 | media-support_the_picture_module-2496461-11.patch | 826 bytes | joseph.olstad |
| |||
#7 | Screenshot 2017-05-12 15.36.16.png | 27.68 KB | kalabro |
Comments
Comment #1
ErikHendrick CreditAttribution: ErikHendrick commentedComment #2
ErikHendrick CreditAttribution: ErikHendrick commentedComment #3
loparr CreditAttribution: loparr commentedsame here, have you found a solution?
Comment #4
ErikHendrick CreditAttribution: ErikHendrick as a volunteer commentedHi,
I found no solution, I believe there is no solution in D7.
In D8 there is this module: https://www.drupal.org/project/inline_responsive_images
However, as of about 3 or 4 weeks ago, that module has bugs as well:
https://www.drupal.org/node/2770965
Changing from Inline WYSIWYG Images to Images as Fields
I had read several times over the last couple years about content authoring solutions that worked around inline images via WYSIWYG because that can be a problem for migrations. The solution is to use images in Fields. So I re-thought the content authoring solution and re-worked it with the Paragraphs module.
Paragraphs Module
Using the paragraphs module has turned out to be very helpful for the content author. Additionally, I get exactly what I want in using Responsive Images anywhere in the content. For example: Create Paragraph Type: Image Medium + Text which has an image field and a body field. Then in Display mode for the Image, choose "Responsive Image" and select the responsive image style.
Using only the Paragraphs module you can end up with several paragraph types to accommodate the various Image Paragraph Only types, or Image + Text paragraph types. However, using the Classy Paragraphs module allows you to cut the number of Paragraphs by 50% or more since Floating the image Right or Left can be done with a simple check of a box.
Comment #5
loparr CreditAttribution: loparr commentedHi, I just turned off ckeditors Advanced content filter. Now all picture markup inserted remains.
Comment #6
ErikHendrick CreditAttribution: ErikHendrick as a volunteer commentedThanks, that must have been the one thing I didn't try.
Comment #7
kalabroI had to use this workaround to make Media WYSIWYG and CKEditor (part of WYSIWYG) work together:
It simply doesn't render
<picture>
at all in WYSIWYG mode. Fallback display will be used to render image (see attached).I quickly ran though the code in Chrome and my current assumption is that `media_wysiwyg.filter.js` can't properly parse and replace
<picture>
output.Comment #8
joseph.olstadInteresting, where is this 'picture' type comming from? is this a custom module making this type? or is this a type of image that you created?
Oh ok, nevermind, I see issue summary now, picture is a module. I haven't tried this module before.
Comment #9
joseph.olstadthis code could either go into the media module as a patch, or into the picture module as a patch or commit.
have to make a patch
Comment #10
joseph.olstadComment #11
joseph.olstadPlease back off your custom workaround(s) and try this patch , should apply to either 7.x-3.x or 7.x-2.x.
Comment #12
joseph.olstadComment #13
joseph.olstadfor those using the media_ckeditor module, we may have to make a patch for that too. But in the media_ckeditor queue.
Comment #14
ron_s CreditAttribution: ron_s commentedI'm tempted to mark as RTBC, but technically I can't say patch #11 works for Media WYSIWYG, since I'm using Media CKEditor.
However, I used your patch to create a Media CKEditor version. Works perfectly: https://www.drupal.org/project/media_ckeditor/issues/2938748
Given there is a lot of overlap, maybe we can get both of these versions to RTBC?
Comment #15
joseph.olstadHi ron_s , so patch 11 works for you when using media_ckeditor?
If it doesn't , set this issue back to 'Needs review'
Comment #16
joseph.olstadto be extra careful could write an if module_exists
Comment #17
ron_s CreditAttribution: ron_s commentedI think the
module_exists
is an excellent idea.Comment #18
ron_s CreditAttribution: ron_s commentedHere's an update with the suggestion. Works for me.
Comment #19
ron_s CreditAttribution: ron_s commentedAlso in case it wasn't clear, this can be set to RTBC. Thanks!
Comment #22
joseph.olstadThanks @ron_s and everyone else!
committed to 7.x-2.x dev and 7.x-3.x dev
will make it into next release whenever that is.