By zoon_unit on
The body text edit box when editing a node is only big enough to display three lines of text and I have to drag the box down every time before editing. How can one change the default size of the edit box to something more "practical?"
Comments
same question
I have asked the same thing and would love to know! Anyone?
Drupal 6 Answer
So far, the best way I've found is to edit modules/node/node.pages.inc - of course I'm sure this affects all content-types :(.
Look for $form['body'] around line 290 and change the rows below.
The drupal way to do this
The drupal way to do this (if you're using a phptemplate based theme) would be to use the theme_textarea theme function by adding the following to the template.php file for your theme and altering as you wish:
===
"Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime." -- Lao Tzu
"God helps those who help themselves." -- Benjamin Franklin
"Search is your best friend." -- Worldfallz
Hi Worldfallz. Thanks for
Hi Worldfallz. Thanks for this pointer. I am trying to apply this to a d6 theme. Here is the relevant code from the API link you provided above. My question is, where would I add the code that limits the number of rows in the default body field to, say 5 rows/ And can I make the field not resizeable? Thanks for your kind assistance.
----------------------------------------------------------------------
http://classicvinyl.biz
http://music.classicvinyl.biz
http://association.drupal.org/user/1207
_
Hmmm... just a guess, but try this:
Post back if you have any problems.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Thank you... unfortunately,
Thank you... unfortunately, it does not appear to work (I changed "theme_textarea" in line one to "name-of-my-theme_textarea"). After inserting the code in template.php, the body field did not change size. Any other suggestions?
I would prefer to create a CCK textarea for this purpose, and would be able to size that as I wanted. But I need to use the maxlength module for the description field to limit to 500 characters the amount of text a user can input. Maxlength does not, from what I can tell, work with CCK textfields, however. So I am, for stylistic purposes, trying to reduce the size of the body field.
Its not critical, just for the sake of appearance. Thanks for your help. regards, david
----------------------------------------------------------------------
http://classicvinyl.biz
http://music.classicvinyl.biz
http://association.drupal.org/user/1207
_
No worries-- that was just a guess. This was tested and worked for me on d6:
Give it a shot and let me know...
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
Wonderful! Thank you, it
Wonderful! Thank you, it works perfectly.
(But not when combined with the maxlength module, for some reason. When maxlength is activated, the body field resorts to its original size and becomes resizeable.)
best, david
----------------------------------------------------------------------
http://classicvinyl.biz
http://music.classicvinyl.biz
http://association.drupal.org/user/1207
thanks
I had similar problem, related with number of cols per textarea.
With help of your post it works for me now!
many thanks, Andrew
Many thanks for this. I'd
Many thanks for this. I'd been puzzling over making modules and analyzing arrays in order to change the width of my description field...this has worked straight away!
subscribing
subscribing
In D6, creating a module works (also with maxlength)
For example, create a dummy module (e.g. customsite, in this case) and use code like this to limit the height (# of rows) of the body:
Hope this helps.
thanks for sharing this. it
thanks for sharing this. it works
Edit just the comment field
Thanks for sharing this, all. I think using CSS to control the size of these fields is kind of a hack because that doesn't change the actual value for "rows" in the html. The template.php method seems more correct to me somehow. Thanks for helping us newbies.
I wanted to change just the size of just the add comment field. Here's the code for that:
Remember that you may need to refresh the cache at http://www.your-site-name.com/admin/settings/performance for these changes to take effect.
--
http://www.mormonshare.com/ - LDS Clipart, Object Lessons, & Activity Ideas for LDS Primary, Relief Society, and Young Women leaders
Try the node form settings module
http://drupal.org/project/nodeformsettings