diff --git a/core/modules/views/config/schema/views.display.schema.yml b/core/modules/views/config/schema/views.display.schema.yml index 16b0d1d2fb28ee1ef6a38c946b47d49446f7ab6c..511b0b93343cc1beef79230b2212a3693426da3d 100644 --- a/core/modules/views/config/schema/views.display.schema.yml +++ b/core/modules/views/config/schema/views.display.schema.yml @@ -43,6 +43,9 @@ views.display.page: context: type: string label: 'Context' + expanded: + type: boolean + label: 'Expanded' tab_options: type: mapping label: 'Tab options' diff --git a/core/modules/views/src/Plugin/Menu/ViewsMenuLink.php b/core/modules/views/src/Plugin/Menu/ViewsMenuLink.php index 85c2350af22b2ce49bed1223386e39d8f8147c4f..f307ceeeb91b260752173aa591bcd057b6c1c466 100644 --- a/core/modules/views/src/Plugin/Menu/ViewsMenuLink.php +++ b/core/modules/views/src/Plugin/Menu/ViewsMenuLink.php @@ -127,6 +127,14 @@ public function getDescription() { return $this->loadView()->display_handler->getOption('menu')['description']; } + /** + * {@inheritdoc} + */ + public function isExpanded() { + return (bool) $this->loadView()->display_handler->getOption('menu')['expanded']; + } + + /** * {@inheritdoc} */ diff --git a/core/modules/views/src/Plugin/views/display/Page.php b/core/modules/views/src/Plugin/views/display/Page.php index 77f1b770a0ef8a2224360006fd750c6d9f5bf5ed..c23b26e1071777e64d8c5b766aebc42305ed4bb6 100644 --- a/core/modules/views/src/Plugin/views/display/Page.php +++ b/core/modules/views/src/Plugin/views/display/Page.php @@ -132,6 +132,7 @@ protected function defineOptions() { 'menu_name' => array('default' => 'main'), 'parent' => array('default' => ''), 'context' => array('default' => ''), + 'expanded' => array('default' => FALSE), ), ); $options['tab_options'] = array( @@ -239,7 +240,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ); $menu = $this->getOption('menu'); if (empty($menu)) { - $menu = array('type' => 'none', 'title' => '', 'weight' => 0); + $menu = array('type' => 'none', 'title' => '', 'weight' => 0, 'expanded' => FALSE); } $form['menu']['type'] = array( '#prefix' => '