(Article contents added) |
(Template link changed) |
||
Line 1: | Line 1: | ||
{{#CUSTOMTITLE:HTML Filters and Inline Styling in CKEditor for Drupal 7 (Enterprise Version)}} | {{#CUSTOMTITLE:HTML Filters and Inline Styling in CKEditor for Drupal 7 (Enterprise Version)}} | ||
− | {{Drupal | + | {{Drupal Inline Styles|path=Configuration''' > '''Content Authoring''' > '''Text formats}} |
Latest revision as of 14:23, 30 May 2012
In the Administration panel > Configuration > Content Authoring > Text formats section Filtered HTML is the default filter. Due to security reasons enabling Full HTML is only an option for trusted users.
To take full advantage of using CKEditor you can extend the list of allowed tags in the HTML filter that is enabled in the Filtered HTML input format. If you do not do this, you may notice that a page created in CKEditor looks different after saving.
Unfortunately, even if you extend the list of allowed tags, one problem still remains: Filtered HTML not only strips disallowed tags, but also strips inline style definitions. It basically means that you are unable to apply a different font color, size or family, align images etc. using CKEditor out of the box.
You can solve this problem by creating another input format that will work in a similar way as Filtered HTML (will only allow specified tags), but in a much better way — i.e. it will not strip inline styles that CKEditor is using when formatting text or images after the page is saved. To create such an input format, you will need an HTML filter. The list below presents three modules that provide HTML filters:
- HTML Purifier – http://drupal.org/project/htmlpurifier
- htmLawed – http://drupal.org/project/htmLawed
- WYSIWYG Filter – http://drupal.org/project/wysiwyg_filter
It is up to you to decide which one to use. Just make sure that you will only allow to use proper inline styles, tags, and attributes.