How change/manage the default height, ser for the editor-window of the wysiwyg-text-area ?

Comments

Status:Active» Fixed

There's currently no GUI setting for this, but it can be changed via code by implementing hook_wysiwyg_editor_settings_alter() in a small module:

<?php
function MYMODLENAME_wysiwyg_editor_settings_alter(&$settings, $context) {
  if (
$context['profile']->editor == 'ckeditor') {
   
$settings['height'] = 500;
   }
}
?>

Please also see #964978: Document hook_wysiwyg_editor_settings_alter() and #507696: Allow individual width/height per field.

Status:Fixed» Closed (fixed)

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

subscribe

I know this is an old thread but I have just stumbled across it and wanted to say thanks to TwoD.

I have managed to follow your simple instructions to create a new module that works.

Can you please let me know how to alter it so as it checks if the ckeditor is being used for comments and only adjust the height if it is.

Is this possible? I think would be a simple if statement but I am only beginning to pick up programming so I'm not sure.

Many thanks

TwoD -- thanks. I've been banging my head trying to do this through CSS.

Babymaggie, you probably figured it out by now but one way is to check the URL to see if you're currently on a comment. Eg.

function MYMODLENAME_wysiwyg_editor_settings_alter(&$settings, $context) {
  if ($context['profile']->editor == 'ckeditor') {
    // check if currently viewing a comment
    if (arg(0) == 'comment') {
      $settings['height'] = 200;
    }
    else {
      $settings['height'] = 500;
    }
  }
}

Thanks to jienckebd for your helpful reply.

I had actually given up on this until I saw your post.

After a little bit of tinkering now works for me aswell :)

Thank you

I use the following in my theme's css to change the default height of the ckeditor textarea window

.cke_contents {
height: 200px !important;
}

Hope this helps

Stuart

Thanks, Stuart.

Thank you all,
I have been following and created the module but no success. I activate the module but the height remain.
Is it because I am using the admin seven layout and not the theme layout for editing pages?

@amirtaiar Have you tried clearing your cache? I believe Drupal caches information about what modules implement what hooks.

Amirtaiar,

The module should run on all of your themes so the Seven theme shouldn't be causing your problem. Can you post the code you're using?

Also, try adding the below code to the MYMODLENAME_wysiwyg_editor_settings_alter and load the page with the ckeditor you're trying to change. If you don't see the contents of $context above the ckeditor, the function isn't running so the problem would be with the way you set up your module.

drupal_set_message(print_r($context));

Hi,

I tried CSS and a custom module but no one worked. The solution was to go in the Drupal's configuration > CKEditor > your_profile > Advanced options > Custom JavaScript configuration and add the following command :

config.height = '600px';

And don't forget the ; at the end or it'll not work ! thx to Olivier for the trick.. damn.

I was searching for quick and simple solution and this one really worked.
tnx

Thanks for sharing @rbulle.

Issue summary:View changes

It would be great if there were some way to control the editor's height through GUI. For example, there's the row settings in the body's content type fields settings that have no effect when the editor is enabled. It seems to me that, specifically this setting, is the perfect one available in GUI to control the editor's height, because also it is rather intuitive to suppose that this options is designed to this and too, allow by field control over the height. But, how bind this field value with the editor's height? All the above solutions seems to be somewhat dirty an counter-intuitive...