Add fonts to WYSIWYG in MW?

twisted1919

Administrator
Staff member
Yes, from an extension you can do this:
PHP:
Yii::app()->hooks->addFilter('wysiwyg_editor_global_options', function($defaultWysiwygOptions){
    $defaultWysiwygOptions['contentsCss'] = array(
        'http://www.some-fonts.com/the/path/to/whatever/css/that/loads/fonts.css',
   );
    return $defaultWysiwygOptions;
});
Additionally, you can hack the ckeditor extension and add your own css files, see /apps/common/extensions/ckeditor/CkeditorExt.php at line 185, though doing it from another extension is the recommended way.
 
Top