By jeff00seattle on
Hi
Is there a way to declare a form element of #type textarea
to use only plain-text editor and NOT present fckeditor?
The styling is currently as follows by default when using #type textarea
, because I do have fckeditor module installed:
<textarea class="form-textarea resizable fckeditor fckeditor-processed textarea-processed" id="edit-body" name="body" rows="2" cols="60" style="display: block;"/>
Thanks
Jeff in Seattle
Comments
Found answer...
Not documented within Form API reference:
http://api.drupal.org/api/file/developer/topics/forms_api_reference.html/6
Set form element with: '#wysiwyg' => false, and this will disable any WYSIWYG editor like FckEditor.
For example:
Cheers
Jeff in Seattle
form_alter solution
I needed to remove TinyMCE from the comments field. I couldn't get the above solution to work, but I had a custom module set up with a form_alter function.
I've posted more details and discussion on why I chose this method on my blog.
Better to use #wysiwyg
I tried your method, but then the form got too wide and couldn't fit into my panel. Instead I used this
I tried to this by overriding in template.php but that didn't work.
UPDATE:
This didn't work after all, it was just not loading the editor for some other reason. Is there a way to disable wysiwyg the way I tried, not just clearing the array completely?
Editor in Form textarea
Did u find a solution to this.
The textarea in my form shows CKEditor fields and I just want it to be a plain text area box.
Pulling my hair out over this one.
John
jebernier@gmail.com
Drupal 8 solution
For Drupal 8, you need to change "textarea" to "text_format".
For example, this changes the system email to use html email (though you still need to set up Swiftmailer or equivalent to actually send it).