开发者

Tiny MCE stripping out facebook tags

Tiny MCE version 3, minor 4.3.2 of 6/30/2011 is stripping out the following when I开发者_如何学运维 click update within the source code window:

    <div class="fb-like" data-href="http://www.facebook.com/pages/pagename/12234568990" data-send="true" data-layout="button_count" data-width="200" data-show-faces="true"></div>

as well as the XFBML version:

     <fb:like href="http://www.facebook.com/pages/pagename/12234568990" send="true" layout="button_count" width="200" show_faces="true"></fb:like>

anyone know what to edit in tiny_mce_src.js to allow custom tags?


It should be possible to add the <fb:*> tags to your tinyMCE.init call:

tinyMCE.init({
    valid_elements: "fb:like"
});

You have to add every other valid element to that string as well. See the default ruleset here: http://www.tinymce.com/wiki.php/Configuration:valid_elements

However, in my experience it's never been a good idea to allow anything else than some very few elements in a RTE. I've always used another way to add elements like Facebook Like buttons etc..


found it in my admin/app/view, pages edit. tinyMCE.init({ extended_valid_elements : "+fb:like[href|send|layout|width|show_faces]", }

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜