Currently, the "enable/disable by default" option is sitewide. However, sometimes it should be customizable per textarea level. For example, I want the comment text area is CKEditor-disable by default, but the node edit textarea enable by default.

I can already do this with the following code at the page bottom:

<script type="text/javascript">
if (typeof(Drupal.settings.ckeditor.autostart) != 'undefined' && typeof(Drupal.settings.ckeditor.autostart['edit-comment']) != 'undefined') {
  delete Drupal.settings.ckeditor.autostart['edit-comment'];
}
</script>

However, the "Switch to richtext/plaintext mode" is hard coded in the module and is side wide, so I can't change it when I override the disable/enable status of an textarea. I'd love to see an option to choose which element is enable/disable by default, like with the current simplified toolbar feature.

CommentFileSizeAuthor
#9 ckeditor-1063986-enable-default-9.patch3.72 KBjcisio
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dczepierga’s picture

U want to remove editor from this textarea, or u want only disable it but can enable by pressing "Switch to rich text editor" ?

Greetings

jcisio’s picture

I want to disable it, and user can enable by pressing "Switch to rich text editor". Something like the Default state in the CKEditor settings (the first element of "Editor appearance"), but this option will be more granular, per textarea instead of per profile.

Thinking about it more, I see that in Force simplified toolbar on the following fields (in Visibility settings), we should have more control. The hierarchy will be:

- Global profile
- - Profile 1: for role 1a, role 1b...
- - - Default settings (what we currently have)
- - - Textarea 1.1: exception for element id 1.1a, 1.1b... (a list)
- - - * those textareas have a few more settings that override the default settings, such as: simplified toolbar, default state, rich text editor toggle, toolbar expanded (generally, settings in the "visibility" section).
- - - Textarea 1.2: exception for element id 1.2a,...
- - Profile 2: for role 2a

What we add here is the 1.1, 1.2... settings.

dczepierga’s picture

Status: Active » Postponed
Issue tags: +6.x-2.0

Ok i mark it as work to do... i try to do this with version 2.x of CKEditor module where I want to add support for input formats...

Greetings

jcisio’s picture

This feature should be profile-dependant, not format-dependant. In 2.x can a format have two or more profiles? This issue is about to have many profiles in a format. Differently saying, multiple textareas with the same format, can have different CKEditor settings, which is currently available, even fairly minimal (full toolbar and "force simple toolbar").

DudleyDooRight’s picture

Has this been addressed as of yet? We'd like to allow users to toggle between either but currently, base content contributors cannot enable Full HTML (to edit table data for instance), if they are limited to Filtered. I would like their default to be filtered but if necessary to be able to select Full.

bkosborne’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Issue summary: View changes

I'm interested in this behavior, being able to change the default state on a field-by-field basis. My use case is that I'm using the faq field module which allows an arbitrary amount of textareas be added with multi value field. If there are more than ~10 fields populated and I go to edit the node, the page loads very slowly because 10 CKEditors have to start up. I'd rather make the user click the button to enable the editor.

bkosborne’s picture

Eh, here's a workaround I found that I'm OK with: https://drupal.org/comment/5601364#comment-5601364.

jcisio’s picture

Status: Postponed » Active

Reopen because I don't think there will be 6.x-2.x or 7.x-2.x. New features will still be added in the 1.x branches.

jcisio’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Active » Needs review
FileSize
3.72 KB

Almost 4 years pass and I happen to need it again. Here is a patch for the 6.x branch.

jcisio’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)
Issue tags: -6.x-2.0

Committed #9 on 6.x-1.x.

  • jcisio committed 09301ad on 6.x-1.x
    Issue #1063986 by jcisio: Added Allow user to choose which textarea is...
jcisio’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Patch (to be ported) » Fixed

In D7 it would be per text format. I don't know to add a per-element or per-field setting without messing everything up. So it won't get into 7.x branch.

Maybe we can add an attribute to the element to override the settings (similar to '#wysiwyg'), but I have no plan now.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.