CodeIgniter Forums
CKEditor and problems with change background color - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CKEditor and problems with change background color (/showthread.php?tid=52995)



CKEditor and problems with change background color - El Forum - 07-06-2012

[eluser]nahalem[/eluser]
HI,

I have a similar problem with change background color of textarea CKEditor. My Code:

Code:
$this->data['ckeditor'] = array(

   //ID of the textarea that will be replaced
   'id'  =>  'post',
   'path' => 'assets/js/ckeditor',
    
   /* ograniczony panel CMS editor */
   //Optionnal values
  
   'config' => array(
    'width'  =>  "690px", //Setting a custom width
    'height'  =>  '100px', //Setting a custom height,
    'stylesSet' => 'my_styles',
    'toolbar'  =>  array( //Setting a custom toolbar
     array('Bold', 'Italic'),
     array('Underline', 'Strike', 'FontSize'),
     array('Smiley','NumberedList','BulletedList','-','Outdent','Indent','Blockquote','Image'),
     array('Bold','Italic','Underline','Strike','-','Subscript','Superscript'),
     '/'
    )
   ),
  
   //Replacing styles from the "Styles tool"
  
   'styles' => array(
  
    //Creating a new style named "style 1"
    'my_styles' => array (
     'name'   =>  'Blue Title',
     'element'  =>  'h2',
     'background-color' => 'Yellow',
    
     'styles' => array(
      'color'  =>  'Blue',
      'font-weight'  =>  'bold',
      'background-color' => 'black'
     )
    ),    
   )
  
  );

Toolbar is changed but how can I change background color with these styles? I tried to use 'background-color' => 'black' but no effect.

PLS help me




CKEditor and problems with change background color - El Forum - 07-06-2012

[eluser]Zaher Ghaibeh[/eluser]
you should use the class not the style attribute since the xss_global will remove the style from your submitted data ..
this is something new in 2.1.2, i had to remove the xss_global to resolve this, or you should use the class attribute ..


CKEditor and problems with change background color - El Forum - 07-06-2012

[eluser]nahalem[/eluser]
Doesn't work, global_filtering have to FALSE. I'm trying to do this and still nothing:

Code:
//Replacing styles from the "Styles tool"  
   '.field' => array(
  
    //Creating a new style named "style 1"
    '.field' => array (
     'name'   =>  'Blue Title',
     'element'  =>  'h2',
     'background-color' => 'Yellow',
    
    '.field' => array(
      'color'  =>  'Blue',
      'font-weight'  =>  'bold',
      'background-color' => 'black'
     )
    ),    
   )