In Drupal 6, this module supported including and excluding fields for which to enable or disable CKEditor. In Drupal 7, this is based on text formats. By default, there are three text formats and so I am restricted to at most three profiles.

I wanted to enable CKEditor just on a single field and learned that this is not possible anymore. I had three options:
- enable it for all fields with the same text format (Full HTML in my case),
- create a new text format for just this field and use the same format for all other fields I want to use the same CKEditor configuration for, or
- not use CKEditor.

As I don't like any of these options, I went for the fourth and patched this module to support a basic version of what was possible in Drupal 6.

With the patch, you can now configure CKEditor profiles for the fields you like it to be enabled. To do this, create a new profile and enter the field ID's in the new "Fields" textarea of the "Basic Setup" fieldset. You can choose to either restrict that profile to text formats like before or fields (independent of their text format), not both.

How does it work? When a profile is configured for specific fields, it is saved with a fake text format, named like the profile with an underscore prepended. E.g. for a profile "Basic", a text format "_Basic" is saved for this profile in the ckeditor_input_format table. If you then open a form, e.g. to edit a node, each field with a text format is checked for a profile with that format, like this module does by default. However, this is new, if there is no such profile, all profiles are checked if they are configured for the respective field and if yes, CKEditor is enabled for the field as configured in that specific profile.

An example field ID is "edit-body-und-0-value" of the page content type. This is not the full configuration with theme, content type and path as in the Drupal 6 version, but this is a start and works great for me. I thought I just share this here.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Ronino’s picture

FileSize
5.6 KB

My updated patch adds features compatibility.

Ronino’s picture

FileSize
5.58 KB

Rerolled patch so it applies cleanly to 7.x-1.19.

Ronino’s picture

Version: 7.x-1.14 » 7.x-1.19
Status: Active » Needs review
Ronino’s picture

Avoid "Notice: Undefined index: fields in ckeditor_profile_features_export_render() (line 80 of /.../ckeditor/includes/ckeditor.features.inc)." on features pages.