Needs work
Project:
CKEditor 4 - WYSIWYG HTML editor
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
3 May 2011 at 00:32 UTC
Updated:
28 Mar 2017 at 14:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dczepierga commentedHi,
For now it's impossible to do that... This option (include/exlude from textareas) will be released with version 7.x-2.x of CKEditor module.
So pls be patient.
Hint: U could try also to disable it in ckeditor.module.php by adding special peace of code, that check the field name and then exit from function - so then CKEditor library would't be attached there.
If u have any questions pls reopen this issue.
Greetings
Comment #2
davidwhthomas commentedThanks for the earlier reply, just an update on this if anyone else is looking.
In the meanwhile, in order to disable ckeditor autostart for a specific textarea, you can use javascript and go:
In this case field_subheading
To disable ckeditor entirely on a field, it looks like one could use
hook_element_info_alterand replace the ckeditor pre_render functionckeditor_pre_render_text_formatwith a clone copy that checks for specific fields. See ckeditor.module ~line 209 for more infohth,
DT
Comment #3
jcisio commented#1063986: Allow user to choose which textarea is enable by default
Comment #4
Pete B commentedThe original issue describes a use case which is not a duplicate of #1063986. Namely disabling with no option to enable (instead of disabling by default, but allowing to enable.)
I'm interested in the behaviour described here too. I have a field where I never want CKEditor to appear.
I would like to request a simple change to ckeditor_load_by_field() to add the following lines:
Then I could use:
to disable CKEditor for my field.
Comment #5
Pete B commentedComment #6
rudiedirkx commentedI think a hook is too expensive, and it misses a lot of context.
$fieldis not enough to know exactly where you are.My approach in #2530324: Allow lazy loading per-element CKEditor by element #property was the other way around: alter a form, add a property, CKEditor will read that property when it's time to decide to enable the editor. Advantage: 100% context, because custom form alter. Disadvantage: lots of form alters if you're disabling many editors in different locations.
And a tiny bit of code review: if the hook doesn't return anything (
NULL), it'll disable the field, becauseNULL == FALSE.Comment #7
rudiedirkx commentedActually, this issue might be about completely disabling CKEditor for one element. My issue was about only disabling
autostart.Comment #8
daniel.nitsche commentedIt's a bit cheeky, but if you add a class of "ckeditor-processed" to the textarea and the parent div, ckeditor won't attempt to load for that field.
Comment #9
sumanthkumarc commentedWas looking for solution to disable ckeditor for my comment body field and #2 comment above helped me.
I found that ckeditor doesn't load if the attribute #format is unset, so did following in my pre_render function. Also i did array_unshift so that my function is at top.
unset($element['#format']); // ckeditor doesn't load if this is unsetComment #10
rubenvarela commentedIn case it helps someone. Meanwhile, what I did to disable it on a field is the following.
- Things that need to be changed,
FORM_ID,FIELD_TEXT,BUNDLE_NAME- Assumption,
LANGUAGE_NONE