How to increase rows and change post body size in Drupal 6

Drupal 6 is no doubt is the king of CMS (Content Management System) but it can sometimes give you a headache if you want to perform a simple thing like changing or increasing the size of your post body box. There is no setting available in Drupal 6 to increase the number of rows and make the post body box bigger. There is one module available but you do not want to add a module and increase overhead for this one basic task. You can increase the number of rows of post body by following these steps:

1.    Go to your theme folder and open template.php

2.    Copy and Paste this code on the bottom of your template.php file

function phptemplate_textarea($element) {
  if ($element[‘#name’] ==’body’){
      $element[‘#rows’] = 5;
  }
  return theme_textarea($element);
}

3.    Change the value in the “row $element[‘#rows’] = 5;” to your desired value you want to have as rows.

4.    Clear your cache under admin/settings/performance

Now you can see that your post body box size will be increased according to your entered value for rows.

You can also change the number of rows of the comment box by following procedure by pasting the following code at the bottom of template.php :

function phptemplate_textarea($element) {
  if ($element[‘#name’] ==’comment’){
      $element[‘#rows’] = 5;
  }
  return theme_textarea($element);
}


Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.