function claro_form_node_form_alter

Same name in other branches
  1. 9 core/themes/claro/claro.theme \claro_form_node_form_alter()
  2. 8.9.x core/themes/claro/claro.theme \claro_form_node_form_alter()
  3. 11.x core/themes/claro/claro.theme \claro_form_node_form_alter()

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

Changes vertical tabs to container.

File

core/themes/claro/claro.theme, line 660

Code

function claro_form_node_form_alter(&$form, FormStateInterface $form_state) {
    $form['#theme'] = [
        'node_edit_form',
    ];
    $form['#attached']['library'][] = 'claro/form-two-columns';
    $form['advanced']['#type'] = 'container';
    $form['advanced']['#accordion'] = TRUE;
    $form['meta']['#type'] = 'container';
    $form['meta']['#access'] = TRUE;
    $form['revision_information']['#type'] = 'container';
    $form['revision_information']['#group'] = 'meta';
    $form['revision_information']['#attributes']['class'][] = 'entity-meta__revision';
}

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