CKEditor allow style html

CKEditor is wysiwyg base javascript, so you can integrate it with controll panel website , you can get more info at ckeditor website

default config ckeditor not allowed you to write your own html style, unless it source view

example if you write

ckeditor config

<p style='color#c00;'>loremp</p>

 

CKEditor will replace this code become

ckeditor-strip-style

<p>loremp</p>

and you cannot get your style …

ckeditor-strip-style-view-source

solution is here http://docs.ckeditor.com/#!/guide/dev_allowed_content_rules

the dev_allowed_content_rules set default false, so the ckeditor will strip almost your code html

in config.js
add line

CKEDITOR.editorConfig = function( config ) {
	config.allowedContent = true;
};

and you will get the style enable
ckeditor-style

Published by

G3n1k

just to remember what i had known :)

One thought on “CKEditor allow style html”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s