2

How can I change the 'Title' Label in creating a specific event using Drupal 5. I am using the event module . Do I need to hack the core codes of Drupal?

My current URL add event node is:

http://cec5/bhutan/?q=en/node/add/event

Screenshot: alt text http://i29.tinypic.com/2s9oaz7.jpg

Thanks in advance

Cheers, Mark alt text

Glorfindel
  • 21,988
  • 13
  • 81
  • 109
marknt15
  • 5,047
  • 14
  • 59
  • 67

4 Answers4

1

You can change the title and body labels from the admin interface.

Go to yoursite.com/admin/content/types/event

Heather Gaye
  • 1,118
  • 1
  • 11
  • 19
1

Go to Content type, you will have a list of content types of your site. Under Operations click on edit for the content type you want to change the title. Under Submission form settings you can change the "Title field label"

Yuseferi
  • 7,931
  • 11
  • 67
  • 103
0

Solved it, thanks to Sir Eumir hehe :D

function event_form_alter($form_id, &$form) {
    $node = isset($form['#node']) ? $form['#node'] : NULL;

    $form['venue'] = array(
        '#type' => 'textfield',
        '#title' => t('Venue'),
        '#default_value' => $node->venue
    );
    if (($form_id == "event_node_form") && isset($form['title']['#title'])) {
        // Change title to Name
        $form['title']['#title'] = t('Name');
        $form['body']['#body'] = t('Description');
    }
}
marknt15
  • 5,047
  • 14
  • 59
  • 67
0

You can also use Automatic Nodetitles to get rid of the title field altogether if that fits your use case. Here is an excerpt from its project page:

... a small and efficient module that allows hiding of the content title field in the form. To prevent empty content title fields one can configure it to generate the title by a given pattern.

When the Token module is installed it's possible to use various node data for the auto generated title - e.g. use the text of a CCK field (since 5.x).

Advanced users can also provide some PHP code, that is used for automatically generating an appropriate title.

Community
  • 1
  • 1
Mike Crittenden
  • 5,779
  • 6
  • 47
  • 74