2

Is there a way to make the summary field required by default in the node form?

1

3 Answers 3

2

It might be easier to create a new field for the summary and just manage it that way, you will then have to remove the summary option from the body field. Otherwise I think you will have to write some code and use hook_form_alter.

0

in a custom module, hook into the the form alter hook

MYMODULE_form_FORM_ID_alter(&$form, &$form_state, $form_id) {
   $form['body'][LANGUAGE_NONE][0]['summary']['#required'] = TRUE;
}

or

MYMODULE_form_alter(&$form, &$form_state, $form_id) {
   if ($form_id = 'MY_FORM_ID') {
       $form['body'][LANGUAGE_NONE][0]['summary']['#required'] = TRUE;
   }
}
-1

Go to admin/structure/types/manage/your_content_type_name/fields; there, you have the option to make this field required.

screenshot

1
  • that option is make body field required, not summary.
    – gilzero
    Commented Mar 16, 2012 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.