TinyMCE 中的 Google +1 自定义标签
我正在尝试使用 TinyMCE 添加以下自定义元素...
<g:plusone size="small" callback="plusone_vote"></g:plusone>
我已将 g:plusone 添加到 Extended_valid_elements (具有两个属性)和自定义元素,但当我单击代码视图窗口上的更新时,它仍然会被删除。 TinyMCE init 现在看起来像这样..
tinyMCESettings = {
mode: "textareas",
theme: "advanced",
editor_deselector: "nomce",
plugins: "paste,iespell,table,style",
extended_valid_elements: "g:plusone[size|callback],script[type|src|defer|charset]",
custom_elements: "g:plusone,~g:plusone",
valid_children: "+p[g:plusone]",
entity_encoding: "raw",
convert_urls: false,
content_css: "{/literal}{$tinyMCEcss}{literal}",
setup: function(ed) {
ed.onSaveContent.add( tinyMCE_GWO_Decode );
ed.onBeforeSetContent.add( tinyMCE_GWO_Encode );
ed.onGetContent.add( tinyMCE_GWO_Decode );
}
};
有人有什么建议吗?
I'm trying to add the following custom element using TinyMCE...
<g:plusone size="small" callback="plusone_vote"></g:plusone>
I've added g:plusone to extended_valid_elements ( with two attributes ) and custom elements but it still gets removed when I click update on the code view window. TinyMCE init now looks like this..
tinyMCESettings = {
mode: "textareas",
theme: "advanced",
editor_deselector: "nomce",
plugins: "paste,iespell,table,style",
extended_valid_elements: "g:plusone[size|callback],script[type|src|defer|charset]",
custom_elements: "g:plusone,~g:plusone",
valid_children: "+p[g:plusone]",
entity_encoding: "raw",
convert_urls: false,
content_css: "{/literal}{$tinyMCEcss}{literal}",
setup: function(ed) {
ed.onSaveContent.add( tinyMCE_GWO_Decode );
ed.onBeforeSetContent.add( tinyMCE_GWO_Encode );
ed.onGetContent.add( tinyMCE_GWO_Decode );
}
};
Anyone have any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看 valid_children 设置。您可能需要将标签添加为那里的有效子标签。
更新:修改你的extend_valid_elements设置以使其
有效(至少使用我的tinymce编辑器)
Have a look at the valid_children setting. You might need to add your tag as valid child there.
UPDATE: Modify your extended_valid_elements setting to
this works (at least with my tinymce editor)