Custom styles in text editor
In this chapter you will learn how to add additional classes to text editor. You can do that globaly for all widgets.
Add new style to all ImpressPages CMS widgets
We will add new style called my_style. To do so, we need to copy file ip_cms/modules/standard/content_management/config.php to ip_configs/standard/content_management/config.php.
In new file we need to add new item into configuration array:
<?php
...
static function getMceStyles()
{
//default styles
$tinyMceStyles = array();
$tinyMceStyles[] = array('translation'=>'Text', 'css_style'=>'');
$tinyMceStyles[] = array('translation'=>'Caption', 'css_style'=>'caption');
$tinyMceStyles[] = array('translation'=>'Signature', 'css_style'=>'signature');
$tinyMceStyles[] = array('translation'=>'Note', 'css_style'=>'note');
//your custom style
$tinyMceStyles[] = array('translation'=>'My style', 'css_style'=>'my_style');
return $tinyMceStyles;
}
...
?>
Comments (2)
Miro
Is the path p_cms/modules/standard/content_management/config.php the same in version 2.6? I can't find the file! Thanks.
Mangirdas
No. Here are described several ways how TinyMCE config could be overridden in ImpressPages 2.x
Write a comment
You must be logged in to comment.