Does anyone know of a way to force plain text mode in comments for all roles?
Edit: is it in any way possible to do so through CSS? Thanks!
Take a look at admin/settings/ckeditor/editg
. There you can change the visibility settings by field path (something like [email protected]_id
). That should work.
admin/settings/ckeditor/editg
?! This takes me to the same page as admin
Commented
Sep 23, 2013 at 14:08
Try
function MYMODULE_form_alter (&$form, &$form_state, $form_id)
{
// comments
// http://api.drupal.org/api/drupal/modules--comment--comment.module/function/comment_form/6
if ($form['#id'] == 'comment-form') {
$form['comment_filter']['format'] = array(); // nuke wysiwyg from comments
}
}
For Drupal 6, I would recommend the Better Formats module to control this. It allows to set a default input format on comments, but also allows different defaults per role and per content type. The Drupal 7 version is in development, but its status is a bit unclear at the moment because some of the features are now in core.
I had the same problem in D7. To fix it I changed the default input format of comments to Plain Text (ckeditor did not have a profile for that input format). This removed ckeditor from comments.
To remove the input format hints I installed the better formats module.
Update: I just noticed that your question was how to force plain text mode for all roles. To simplify I would just change the way the input format process text from "filtered text" to "plain text".
I did it this way. I fixed input format to a non wysiwyg one and denied access of it.
/**
* Implements hook_comment_form_alter().
*/
function comment_form_alter(&$form, &$form_state, &$form_id) {
$form['comment_body']['#after_build'][] = 'MYMODULE_customize_comment_form';
}
/**
* Comment body after-build function.
*/
function MYMODULE_customize_comment_form(&$form) {
// Hide text-format selector in comment form and fix format to filtered_html
$form[LANGUAGE_NONE][0]['format']['format']['#value'] = 'filtered_html';
$form[LANGUAGE_NONE][0]['format']['format']['#access'] = FALSE;
}