Dev / Drupal

Allowing Code in CKEditor Wysiwyg

Every used CKEditor’s WYSIWYG, inserted some code in Source view, then when you reverted to WYSIWYG the code disappeared?

The default setting of CKEditor strips the html, and extra bits of code that aren’t entered normally bu users. This is normal of course. It’s just cleaning up code the way it’s supposed to.

But there may be times when you need to enter code, like embed code or add some classes. Here’s how to do it:

Custom JavaScript configuration
Paste in:
config.allowedContent = true;





Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s