I want to add a label to the body fields of nodes. How can I do this?

For example,

Description:
Node description goes here.

Comments

Digitalrecline’s picture

Go to the edit content -type page. admin/content/NODETYPE/edit or something close to that. Scroll down and I think theres one called "submissions" under the body textbox (forgot the name off hand) and in there you can change the "Body" label to whatever you like.

D7 admin/structure/types/manage/CONTENTTYPE/edit/fields/body and change the name of the body to whatever you want.

Hope that helps.

zazinteractive’s picture

I have set a label there but it's not displayed

Digitalrecline’s picture

That should have changed the label. Have you refreshed the cache? You may still be viewing cached pages.

m_z’s picture

I think that here is some confusion:
a) node add / edit form: body label is visible
b) node view (= themed node output): body label is missing (and I think that is the problem here!)

How can we include the body label when displaying a node?

kruser’s picture

You can set the label to be Hidden or not on the Manage Display tab for that content type: admin/structure/types/manage/page/display

-----------------------------------------------------
Bob @ Drupal Aid (https://www.drupalaid.com)

zazinteractive’s picture

Except that the body field isn't listed on the display page

m_z’s picture

@kruser:
Your suggested path looks like Drupal 7, but I think this issue is about Drupal 6...

Vinay Punyamurthy’s picture

I need to display the label in the full node view. Can anyone tell me how to do it? Or where to enable it?
There's no option in the display fields to make it visible like CCK fields.

Waiting for the replay. Thanx.

somebodysysop’s picture

Did you ever figure out how to do this? I need to be able to do the same exact thing.

anumia’s picture

The simplest way of displaying something before the body text will be to add a new field using the CCK module. Activate CCK and add a new field in your content type. After doing this arrange the fields for your content type in the order you want them to be displayed. The new field should be immediately before the body. When you create your content this new field will allow you to type any text you want. You can also use CSS to change its display. Hope this helps.

somebodysysop’s picture

Thanks for the reply. That's an excellent solution if you're starting from scratch. But, we have about two years worth of data in the existing body field. Is there anyway to get the core body field label to display?

MtnMn’s picture

If you use Views and list the body as a field you can add a label. Don't have any links to full node.
Or write a custom node-content_type.tpl.php.

eric at nrd’s picture

If you don't mind creating a new module, how about this as a kludge / solution? Create a simple module that implements hook_nodeapi(), checks for the 'view' operation, and the specific content type you want a label for. If found, output $node->content['body'] with some CCK-style markup wrapped around it.

Something sort of like this (fill in TGT_CONTENT_TYPE and TGT_LABEL as needed):

/**
 * Implementation of hook_nodeapi().
 */
function MODULENAME_nodeapi(&$node,$op,$teaser,$page) {
  if ($op == 'view' && $node->type=='CONTENT_TYPE_HERE') {
    $node->content['body']['#value'] = '<div class="field node-body">'.
      '<div class="field-label">'.t('LABEL GOES HERE').': </div>'. 
      $node->content['body']['#value']. 
      '</div>';
  }
}