Skip to content

Commit f20bac1

Browse files
committed
[Docs] Collapse menu items
1 parent ee84863 commit f20bac1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

docs/cookbook/admin_panel/menu.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,18 @@ final readonly class MenuBuilder implements MenuBuilderInterface
8888
}
8989
}
9090
```
91+
92+
{% hint style="success" %}
93+
**🧠 Collapse your custom menu by default**
94+
95+
It's possible to expand your parent menu category on page load by default. For that, you have to set the `setExtra` attribute like this:
96+
97+
```php
98+
$newSubmenu = $menu
99+
->addChild('new')
100+
->setLabel('Custom Admin Menu')
101+
->setExtra('always_open', true);
102+
```
103+
104+
However, ensure that you set the attribute in the parent menu, not in one of the child menu items.
105+
{% endhint %}

0 commit comments

Comments
 (0)