简体   繁体   中英

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]", }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM