I needed to change the body label of image node types from "Body" to something like "image description".

The same way this hook is implemented in the blog module. Maybe this is a dupe. If not maybe someone wants to make a patch...

/**
 * Implementation of hook_form
 */
function image_form(&$node, &$param) {
  _image_check_settings();
  // new line 
  $type = node_get_types('type', $node);
  // ...
  // changed line
  $form['body'] = array('#type' => 'textarea', '#title' => check_plain($type->body_label), '#rows' => 20, '#default_value' => $node->body);
  // ...

btw, great module :-)

Comments

drewish’s picture

StatusFileSize
new3.18 KB

here's a patch that does this and cleans up some formatting.

drewish’s picture

Status: Needs review » Fixed
StatusFileSize
new3.19 KB

davidstrauss pointed out that the has_title check might not be the best idea. i'll skip that for now. if people start demanding it i reserve the right to change my mind. i'm gonna commit the attached.

drewish’s picture

Status: Fixed » Active

according to http://drupal.org/node/152626 this isn't fixed...

drewish’s picture

well i guess i committed the fix but i need to do a new release.

schnizZzla’s picture

thanks for taking on this issue!

drewish’s picture

Status: Active » Fixed

i'm calling it fixed since it's in CVS. i'm going to give it a week and if there's no new bug reports i'll create a new release.

coldfly’s picture

yes, it works.
but i have found that you have removed " '#rows' => 20, " in line 475 in the latest release 1.3.
Is there anything missing?

drewish’s picture

yes i pulled that out. it was causing a huge body field to be displayed. images aren't blog posts so they usually don't need as large a description.

coldfly’s picture

It's OK.
But If someone use WYSIWYG editor (like tinymce), this body field would be too short to be edit.

schnizZzla’s picture

oh, I just saw this was taken in to the 1.3 version.
thank you, another custom patch I don't need to remember... ^_^

drewish’s picture

coldfly, eh, maybe we could increase the default... but it seems like a feature request for the WYSIWYG editor, it should ensure that all textfields it edits should be larger than x rows.

Hetta’s picture

Just a heads-up:
Put some text in the "body" field under admin/content/types/image .
If that field is empty, you'll have no body field on your image node editing form (node/$number/edit).

Anonymous’s picture

Status: Fixed » Closed (fixed)