Magento - 如何在Magento的CMS编辑器中允许某些标签(iframe,嵌入)?

Moo*_*oon 20 embed iframe tinymce magento

我想允许输入某些html标签,如iframe,并嵌入Magento的CMS编辑器中.Magento不允许这些标签.

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

Jos*_*osh 37

查看此文件:js/mage/adminhtml/wysiwyg/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,
Run Code Online (Sandbox Code Playgroud)

并在它之后添加:

        extended_valid_elements : 'iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder],style,script',
Run Code Online (Sandbox Code Playgroud)

这是一个简单的逗号分隔的标记列表,您希望允许.