Adding "ref" attribute to img tag gets stripped by refinery's wysiwyg.
After creating a new page and adding the following line of code:
Refinery's wysiwyg strips the ref attribute and saves everything else. Is there something I can change in settings to allow the wysiwyg to save this attribute without any issues. Or would this be considered a bug ?
Is the "ref" attribute an official attribute that should go on ?
Or could you use data-ref instead? :-)
Actually it's part of a jquery plugin I'm currently implementing (Pikachoose). Apparently they chose to use the "ref" attribute for calling in larger images. Haven't had any issues using this plugin before but today I did encounter the issue when using Refinery.
Right.. it's because it's an illegal attribute on 'img' that it's being stripped away.
wymeditor (the visual editor) has a 'whitelist' of attributes and this isn't on it so it gets stripped away.
There's some more context in this post: http://groups.google.com/group/refinery-cms/browse_thread/thread/f245fc70eac8d275/0e25e2bf3c5e1ad0?lnk=gst&q=whitelist#0e25e2bf3c5e1ad0
Here's the exact reference to the part of the file that defines attributes for "img":
https://github.com/resolve/refinerycms/blob/1-0-stable/core/public/javascripts/wymeditor/jquery.refinery.wymeditor.js#L2456
So you'd need to insert after "7": "rel" this: "8": "ref"
Then it'd stop stripping it away. To do this you need to override the editor's JS file.. I think this will work:
rake refinery:override javascript=wymeditor/jquery.refinery.wymeditor
Figured, thanks again for the post URL.