2011-03-02 84 views
20

我想允许输入某些html标记,例如iframe并嵌入Magento的CMS编辑器中。 Magento不允许这些标签。Magento - 如何允许Magento的CMS编辑器中的某些标签(iframe,嵌入)?

是否有我可以编辑的模型或控制器,以允许iframe和嵌入标签?

+0

只是想指出,该编辑器是TinyMCE的,可能已经有用于控制允许的元素的选项。我已经标记了这个问题,以便其他人可以帮助更好。 – clockworkgeek 2011-03-02 12:17:08

回答

37

查找该文件中:JS /法师/ adminhtml /所见即所得/ tiny_mce/setup.js

找到这段代码:

var settings = { 
     mode : (mode != undefined ? mode : 'none'), 
     elements : this.id, 
     theme : 'advanced', 
     plugins : plugins, 
     theme_advanced_buttons1 : magentoPlugins + 'magentowidget,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect', 
     theme_advanced_buttons2 : 'cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,forecolor,backcolor', 
     theme_advanced_buttons3 : 'tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,iespell,media,advhr,|,ltr,rtl,|,fullscreen', 
     theme_advanced_buttons4 : 'insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,pagebreak', 
     theme_advanced_toolbar_location : 'top', 
     theme_advanced_toolbar_align : 'left', 
     theme_advanced_statusbar_location : 'bottom', 
     theme_advanced_resizing : true, 

,并在其后补充一点:

 extended_valid_elements : 'iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder],style,script', 

这是一个简单的以逗号分隔的想要允许的标签列表。

+0

这对Magento EE 1.13不起作用;还有什么要考虑的吗? – feeela 2014-06-26 13:45:39

3

乔希是正确的目标,我添加了该行接受了“关于Faceb找到我们......” - IFRAME:

extended_valid_elements : 'iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder|allowTransparency],style,script', 

它有一个额外的属性自动生成的FB-iframe中那。

-5

编辑CMS页面时,可以切换到HTML视图。

enter image description here

通过按HTML按钮
enter image description here

在那里,您能在iframe添加到页面上,就在HTML

+0

这不启用任何额外的HTML标签 - 新的编辑和切换到HTML编辑模式,它被删除。 – tomis 2013-03-20 16:35:07

+0

@tomis当我回答这个问题时,我正在使用magentogo。我不喜欢它,没有ftp,因此没有完全控制网站。我发现在cms切换到html模式是一个很好的解决方案,因为没有ftp – 2013-03-20 17:24:12

+0

了解。顺便说一句,我讨厌Magento和所有想要我在那里做任何事的客户...... – tomis 2013-03-20 17:38:36