Hello,
I needed a rich text editor for drupal v5.2 , so I and installed these two packages:

http://ftp.drupal.org/files/projects/tinymce-5.x-1.x-dev.tar.gz

http://tinymce.moxiecode.com/ [v 2.1 for drupal]

The editor seems to work fine except that the text area is rather small...

I´ve searched the forum but found no direct solution for this. BTW, if there is supposed to be a width/height option in the editor´s settings it´s not showing here).

Any suggestions?

If there is no 5.2-compatible version, what would be you second choice.

Thanks in advance!.

Comments

Rowanw’s picture

TinyMCE uses the height of the textarea it's applied to, so if you made a textfield with CCK you could set the height to 20 'rows', or you could just use CSS.

jdsaward’s picture

You can use the TinyMCE:Configuration/height option. See http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/height

First, if you have not done so already, and assuming you are using a PHPTemplate theme, you have to override the TinyMCE theme function. To do that, follow the instructions at: http://drupal.org/node/53296#comment-385655.

Find this code towards the bottom of your phptemplate_tinymce_theme:

if (isset($init)) {
    switch ($theme_name) {
     case 'advanced':
   $init['width'] = '100%';
       break;
  
    }
  }

After "$init['width'] = '100%';" add the height option as:

eg
$init['height'] = "480"; //pixels

or eg

$init['height'] = "200%"; //percentage of height of the underlying textarea.

Thus you might end up with:

if (isset($init)) {
    switch ($theme_name) {
     case 'advanced':
   $init['width'] = '100%';
   $init['height'] = '300%'; 
       break;
  
    }
  }

The disadvantage is that the height configuration will apply to all text areas that TinyMCE is enabled for. Thus if you use "$init['height'] = '300%';" all TinyMCE edit boxes will be 3 times as high as the underlying textarea. I found that worked for my site, but ... play around till you find what specification works.

kingandy’s picture

Cheers, just what I was looking for :D

FWIW, in case it's not immediately apparent, if you want to apply a size change to a specifically-named element you can slip this into the switch($textarea_name) clause. For example:

  switch ($textarea_name) {
    case 'my_text_area':
      if ($theme_name == 'advanced') {
        $init['height'] = "300";
      }
      break;
    // ... other cases here ...
  }

--Andy
Developing Drupal websites for Livelink New Media

++Andy

Anonymous’s picture

In case you want a CSS-only solution to change the editor's height for specific node-types, you can use this

body.node-type-page textarea#edit-body.form-textarea { height: 690px; }

to change the height only for page nodes. Only works with fixed heights as far as I can see.