File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1818$ wa ->getRegistry ()->addExtensionRegistryFile ('mod_menu ' );
1919$ wa ->usePreset ('mod_menu.menu ' );
2020
21- $ tagId = $ params ->get ('tag_id ' , '' ) ?: 'mod-menu ' . $ module ->id ;
22- $ id = ' id=" ' . htmlspecialchars ($ tagId , ENT_QUOTES , 'UTF-8 ' ) . '" ' ;
21+ $ tagId = $ params ->get ('tag_id ' , '' ) ?: 'mod-menu ' . $ module ->id ;
22+ $ id = ' id=" ' . htmlspecialchars ($ tagId , ENT_QUOTES , 'UTF-8 ' ) . '" ' ;
23+ $ startLevel = (int ) $ params ->get ('startLevel ' , 1 );
2324
2425// The menu class is deprecated. Use mod-menu instead
2526?>
6364 echo '<li class=" ' . $ class . '"> ' ;
6465
6566 // The next item is deeper - add toggle only here it is a heading or separator
66- if ($ item ->deeper && $ item ->level === 1 && in_array ($ item ->type , ['separator ' , 'heading ' ])) {
67+ if ($ item ->deeper && ( int ) $ item ->level === $ startLevel && in_array ($ item ->type , ['separator ' , 'heading ' ])) {
6768 // Add a toggle button.
6869 echo '<button class="mod-menu__toggle-sub" aria-expanded="false"> ' ;
6970 }
8586 if ($ item ->deeper ) {
8687 // Check type - add only on first level
8788 // @todo aria-label - set in menu item ???
88- if ($ item ->level === 1 ) {
89+ if (( int ) $ item ->level === $ startLevel ) {
8990 switch ($ item ->type ) {
9091 case 'heading ' :
9192 case 'separator ' :
You can’t perform that action at this time.
0 commit comments