One of my clients would like to add additional HTML attributes for SEO purposes as well as to keep line breaks after saving a CMS block or page in the Magento Admin.

Solution:

To do that, you must open the file js/mage/adminhtml/wysiwyg/tiny_mce/setup.js and locate the line below:

var settings = {

Right after the code plugins : plugins, add the lines highlighted in grey:

        var settings = {
            mode : (mode != undefined ? mode : 'none'),
            elements : this.id,
            theme : 'advanced',
            plugins : plugins,
            forced_root_block: false,
            extended_valid_elements: '+ul[*],+li[*],+p[*],+span[*],+div[*],+a[*]',
            remove_linebreaks : false,
            theme_advanced_buttons1 : magentoPlugins ...

Save the file and clear your cache to apply the changes.

About the author

Richard Feraro is a Magento Enterprise Certified developer from Manila, Philippines with 14 years of solid open-source development experience using Linux, Apache, MySQL & PHP.

By Richard Feraro

Richard Feraro is a Magento Enterprise Certified developer from Manila, Philippines with 14 years of solid open-source development experience using Linux, Apache, MySQL & PHP.

Leave a Reply