2

When you attempt to delete a node in Drupal, you're taken to a confirmation page whose title is...

Are you sure you want to delete {title of node}?

I'm attempting to alter the title of this page and have had no luck at all. I've tried the following at theme and module levels to no avail:

hook_form_node_delete_confirm_alter(...)
template_preprocess_html(&$vars)
template_preprocess_page(&$vars)
template_preprocess_region(&$vars)
template_confirm_form(&$vars)

I was additionally unable to find anything useful in devel themer.

Drupal 7, please.

Clive
  • 36,918
  • 8
  • 87
  • 113
Eric Peterson
  • 25
  • 1
  • 4

2 Answers2

5

This works like a charm for me:

function mymodule_form_node_delete_confirm_alter(&$form, &$form_state, $form_id) {
  drupal_set_title('New Title');
}

Make sure you clear Drupal's caches after you've implemented the hook or it might not be picked up.

Clive
  • 36,918
  • 8
  • 87
  • 113
-1

I have a module for Drupal 8 that lets you set this in config from the node type edit form. https://www.drupal.org/project/node_form_overrides