Magento - 如何在 Magento 的 CMS 编辑器中允许某些标签(iframe、嵌入)? [英] Magento - How to allow certain tags (iframe, embed) in Magento's CMS editor?

查看:24
本文介绍了Magento - 如何在 Magento 的 CMS 编辑器中允许某些标签(iframe、嵌入)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I would like to allow to enter certain html tags such as iframe and embed in Magento's CMS editor. Magento does not allow those tags.

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

Is there a model or controller that I can edit to allow iframe and embed tags?

推荐答案

查看这个文件:js/mage/adminhtml/wysiwyg/tiny_mce/setup.js

Look in this file: 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',

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

It's a simple comma delimited list of tags you want to allow.

这篇关于Magento - 如何在 Magento 的 CMS 编辑器中允许某些标签(iframe、嵌入)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆