WYSIWYG Custom Styles in Magento

wysiwyg

Is it possible to add custom styles and classes in drop down menu in wysiwyg editor in magento! I have enclosed the picture for better explanation.
enter image description here

Best Answer

Sometimes it is not always necessary to extend Magento as per The Correct Way. In this case, if you simply want to customise the editor and get back to being focused on the product catalogue, you can simply edit js/mage/adminhtml/wysiwyg/tiny_mce/setup.js and add your style selection in var settings (line 97):

    var settings = {
        mode : (mode != undefined ? mode : 'none'),
        style_formats:[
            {title : 'Source Code', block : 'code', classes : 'prettyprint', exact: true}
        ],

        ...

This will now mean you have one style, 'Source Code'.

http://www.tinymce.com/wiki.php/Configuration:style_formats

Next time that Magento is upgraded you will lose your customisations. When you upgrade you can simply put the styles back in or you can put together a whole module load of stuff to do this The Proper Magento Way.