Custom HTML tags are missing in Magento wysiwyg editor


If you have encountered this issue,

for ex:- When you add custom html code  and it’s not visible in the admin and often not rendered in the front end, there is a simple hack for this.

Goto,

js\mage\adminhtml\wysiwyg\tiny_mce\setup.js

and add “extended_valid_elements : ‘i[class]'” , code to var = settings

 var settings = {
schema : ‘html5’,
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 : ‘i[class]’,
convert_urls : false,
relative_urls : false,
content_css: this.config.content_css,
custom_popup_css: this.config.popup_css,
magentowidget_url: this.config.widget_window_url,
magentoPluginsOptions: magentoPluginsOptions,

This will resolve your issue, but remember you are editing a Magento core file. So, please extend the file using the correct method.

S.S.Niranga

Senior Tech Lead at Netstarter PTY ltd. Magento Certified Front End Developer, Certified ScrumMaster, Microsoft Certified Professional, Member of British Computer Society

Leave a Reply

  • (will not be published)