function seven_form_node_form_alter

Same name and namespace in other branches
  1. 8.9.x core/themes/seven/seven.theme \seven_form_node_form_alter()

Implements hook_form_BASE_FORM_ID_alter() for \Drupal\node\NodeForm.

Changes vertical tabs to container.

File

core/themes/seven/seven.theme, line 156

Code

function seven_form_node_form_alter(&$form, FormStateInterface $form_state) {
    $form['#theme'] = [
        'node_edit_form',
    ];
    $form['#attached']['library'][] = 'seven/node-form';
    $form['advanced']['#type'] = 'container';
    $form['meta']['#type'] = 'container';
    $form['meta']['#access'] = TRUE;
    $form['meta']['changed']['#wrapper_attributes']['class'][] = 'container-inline';
    $form['meta']['author']['#wrapper_attributes']['class'][] = 'container-inline';
    $form['revision_information']['#type'] = 'container';
    $form['revision_information']['#group'] = 'meta';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.