The following example shows one way of changing the title on add/edit pages for a specified content type. We'll accomplish this using hook_form_alter() in a custom module.
<?php
function mymodule_form_alter(&$form, $form_state, $form_id) {
if (isset($form['type']) && isset($form['#node'])) {
if ($form_id == 'mycontenttype_node_form') {
drupal_set_title('Request a Sample Note');
}
}
}
?>
I suggest using the devel module dpm() function, or just php print-ing the $form_id variable at the top of your hook_form_alter() function. This will tell you which form_id you need to target in your conditional.


Add new comment