Magento - How to allow certain tags (iframe, embed) in Magento's CMS editor?

后端 未结 3 486
情歌与酒
情歌与酒 2020-12-08 15:48

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.

Is there a model or controll

相关标签:
3条回答
  • 2020-12-08 16:04

    When editing a CMS page, you can switch to an html view.

    enter image description here

    By pressing the html button
    enter image description here

    There you are able to add the iframe onto the page right in the html

    0 讨论(0)
  • 2020-12-08 16:16

    Look in this file: js/mage/adminhtml/wysiwyg/tiny_mce/setup.js

    Find this block of code:

        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,
    

    and add this after it:

            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.

    0 讨论(0)
  • 2020-12-08 16:17

    Josh is right on target, I added this row to accept a "Find us on Faceb..."-iframe:

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

    It has an extra attribute that's within the autogenerated FB-iframe.

    0 讨论(0)
提交回复
热议问题