RSS

Change title from node add form in Drupal

12 Aug

Changing title from node add/edit form in Drupal is pretty simple. You can do that with Drupal hooks from your custom module. Here is the simplest way to do that

function mymodule_form_alter(&$form, $form_state, $form_id) {
if($form_id == ‘mynodetype_node_form’){
if($form[‘nid’][‘#value’]){
drupal_set_title(t(“Edit My new title”));
}
else{
drupal_set_title(‘My new title’);
}
}
}

Advertisements
 
Leave a comment

Posted by on August 12, 2012 in Drupal, PHP, Uncategorized

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: