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

标签 iframe magento tinymce embed

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

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

最佳答案

查看这个文件: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,

并在其后添加:
        extended_valid_elements : 'iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder],style,script',

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

关于iframe - Magento - 如何在 Magento 的 CMS 编辑器中允许某些标签(iframe、嵌入)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5163518/

相关文章:

javascript - 如何使 IFrame 链接打开到新窗口?

php - 如何在 Magento 中使用扩展/模块创建自定义订单状态

javascript - TinyMCE 将 HREF 从 “/category/product-name” 更改为 “../../../../category/product-name”

javascript - TinyMCE - 颜色选择器为空

tinymce - 我应该如何使用 tiny_mce_popup.js 为版本 4 更新 TinyMCE 插件?

javascript - 浏览器缩小时 iFrame 页脚被 chop

jquery - 从 iFrame 打开模态窗口到父窗口

javascript - 在 IE 中打印隐藏的 iFrame

Magento,如何在点击数据库之前从 Redis 查询集合

Magento:数以千计的相似产品,改变价格的两个属性