Hello, I'm a big fan of the media module, and against better judgement I've been using it on all sites I create since i discovered it about a year ago, because it is sooo the way forward. WIthout it Drupal is a cripple and of no use to anyone in the real world of developing web sites for real clients. So I'm waiting for it to mature and try to understand as much of the code as I can to find ways to help in development. I'm surprised at how slow the development is. In my view everyrone who cares about Drupal should do all they can to make this project rock solid. Drupal lacks good, standardized media handling.
So, now to my support request:
I need to allow the "usemap" attribute to be set through CKEditor (via Wysiwyg) but I just can't find the appropriate angle for attack. Does anyone have any help to offer? How do I make the usemap attribute in a <img usemap="somemap" src="img.png" /> tag stay when the page is rendered after adding it with Wysiwyg (ckeditor and imagamaps plugin) and not be filtered out by media.filter.inc.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | media-allow_usemap_attribute_with_wysiwyg-1844162-5.patch | 855 bytes | aendra |
| #2 | media-allow_usemap_attribute_with_wysiwyg-1844162-2.patch | 427.76 KB | aendra |
Comments
Comment #1
leanderl commentedfixed typo in title
Comment #1.0
leanderl commentedFixed formatting of code
Comment #2
aendra commentedHi leanderl! Note that you can edit issues and note your changes in the "Log Message" field; no need to add a separate comment! :)
I've had the same problem as you and just created a patch that allows imagemaps via the Media WYSIWYG plugin -- necessary to use the Media WYSIWYG plugin with other WYSIWYG plugins like wysiwyg_imgmap (Which is awesome if you have to deal with image maps fairly regularly).
In reality though, there should be a config option somewhere that allows attributes to be specifically white/blacklisted. Any thoughts, Media maintainers?
Comment #3
aendra commentedForgot to change status to "needs review".Edit: Don't use that patch -- it seems to have way more in it than I actually did. Reposting in a second.
Comment #5
aendra commentedDon't know how I fudged so simple a patch -- it's only one line. Regardless, here it is again.
Comment #7
aendra commentedDurr, need to update the issue to -dev for the test to work.
Comment #8
aendra commented#5: media-allow_usemap_attribute_with_wysiwyg-1844162-5.patch queued for re-testing.
Comment #9
aaron commentedI have tested it, and the patch appears to allow us to save the image map coordinates properly, but I am unable to get the map to actually work. However, when editing the node, I can see the coordinates saved, so I guess that this patch works.
Comment #10
aendra commented@aaron -- Thanks! Re: image maps not working, what about when viewing source on the actual node; does it look like it does when viewing source in WYSIWYG? You might need to use the Full HTML input format if not.
Also, any thoughts on adding an allowed attributes field somewhere in WYSIWYG config?
Comment #11
aaron commentedThis is the markup that I see. I am not familiar enough with an image map to know what this is doing. But it does not work the way that I would expect; I had placed a link to Drupal.org in a rectangular region of the image, while in WYSIWYG.
<img width="180" height="180" border="0" alt="" src="http://localhost/drupal/sites/default/files/styles/square_thumbnail/public/100_5909.JPG" typeof="foaf:Image" usemap="#imgmap201322135458" class="media-element file-preview" title=" ">Comment #12
aendra commented@aaron -- That's all of it? There's not a "map" element? I'm guessing something's stripping it out. See: https://developer.mozilla.org/en-US/docs/HTML/Element/map
Comment #13
ParisLiakos commentedtesting this now, but
wysiwyg_allowed_attributesis a variable, so it is easily overridable with sth like thisComment #14
ParisLiakos commentedi guess map element should be inserted by wysiwyg_imgmap module.attribute is correctly displayed so i went ahead and commited/pushed the patch
http://drupalcode.org/project/media.git/commit/8754c6b
thanks
Comment #15.0
(not verified) commentedFixed typos