title as optional in content types
Published by onlinehuna on May 6th, 2009 in Drupal Modules
I just wanna make the title in page or story content type as optional, right now its mandatory.
How can I do that?
any help is grately appreciated. :-)
drupal_developer on May 07th 2009
May Be the below code helps you.
/*
* Function to make title as optional*/
function hook_form_alter(& $form, $form_state, $form_id) {
if ($form['type']['#value'] == "page" || $form['type']['#value'] == "story") {
$form['title']['#required'] = FALSE;
}
}