Dominique De Cooman
Published on Dominique De Cooman (https://dominiquedecooman.com)

Home > Change title on node/add form drupal6

Dominique De Cooman
Tuesday, April 29, 2008 - 23:02
drupal6 [1]
theming [2]

Use the old drupal_set_title('') function to set the title and put it in hook_form_alter. Why in a hook_form_alter? If you do it in preprocess page your 're to late, if you want it to do with drupal_set_title(). But what you can do in the preprocess page is set $vars['title'] (thanks to Davy [3] aka the drupalcoder [4] to point this out). Using hook form_alter has the advantage that it's independent of the theme.

Example:

function your_module_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'aanvraag_node_form') {
    drupal_set_title(t('Schrijf je in als actievoerder'));
  }
}


Source URL: https://dominiquedecooman.com/blog/change-title-nodeadd-form-drupal6

Links
[1] https://dominiquedecooman.com/blog-topics/drupal6
[2] https://dominiquedecooman.com/blog-topics/theming
[3] http://davyvandenbremt.be
[4] http://drupalcoder.com