Welcome Guest, Not a member yet? Register   Sign In
CKEditor and problems with change background color
#1

[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

#2

[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 ..
#3

[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'
     )
    ),    
   )




Theme © iAndrew 2016 - Forum software by © MyBB