function NavigationMenuBlock::blockForm

Same name in other branches
  1. 11.x core/modules/navigation/src/Plugin/Block/NavigationMenuBlock.php \Drupal\navigation\Plugin\Block\NavigationMenuBlock::blockForm()

Overrides SystemMenuBlock::blockForm

File

core/modules/navigation/src/Plugin/Block/NavigationMenuBlock.php, line 57

Class

NavigationMenuBlock
Provides a generic menu navigation block.

Namespace

Drupal\navigation\Plugin\Block

Code

public function blockForm($form, FormStateInterface $form_state) : array {
    $form = parent::blockForm($form, $form_state);
    unset($form['menu_levels']['expand_all_items']);
    $form['menu_levels']['depth']['#options'] = range(1, static::NAVIGATION_MAX_DEPTH);
    return $form;
}

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