Magento Enterprise version 1.14.0.1
Problem:
The Magento rich text editor tinymce removes style, script, and html5 tags when CMS pages, static block etc. are saved.
Solution:
Warning – requires a source code change and is NOT upgrade friendly.
- Edit file \js\mage\adminhtml\wysiwyg\tiny_mce\setup.js
- Find the section starting with: var settings = {
- Add a new parameter e.g. paste the following code (to allow style, script, html5 tags) after the line: theme_advanced_resizing : true,
extended_valid_elements : 'style,script,section,article,aside',
Note that the tinymce version number can be found in this file: \js\tiny_mce\tiny_mce_src.js
Magento Community version 1.7.0.2
Problem:
The Magento rich text editor tinymce removes style tags when CMS pages, static block etc. are saved.
Solution:
Warning – requires a source code change and is NOT upgrade friendly.
- Edit file \js\mage\adminhtml\wysiwyg\tiny_mce\setup.js
- Find the section starting with: var settings = {
- Add a new parameter e.g. paste the following code (to allow style tags) after the line: theme_advanced_resizing : true,
valid_children : '+body[style]',
And to allow both style and script tags:
valid_children : '+body[style|script]',
Note that the tinymce version number can be found in this file: \js\tiny_mce\tiny_mce_src.js
Nice tutorial, btw is there any upgrade safe way to achieve this?
ReplyDeleteA simple way to make it upgrade friendly is to redefine the getSettings method by adding your own script. See : http://alanstorm.com/magento_html5_tinymce
ReplyDeleteMarvelous and fascinating article. Incredible things you've generally imparted to us. Much obliged. Simply keep making this kind out of the post.
ReplyDeletecustom magento development