A menu module can be both used to display a horizontal menu (usually on top of the page) and a vertical menu (usually in a sidebar, left or right). In a horizontal (top) menu it is not desirable to keep the submenu open. That's why the default behaviour of a menu module is to close the submenus on page load. 

Toggle status "open" behavior

However, in a vertical (sidebar) menu, it is often desirable to leave a submenu open when it contains the active menu item. In Joomla 6.0 a new CSS class nav-active-open was introduced specifically to allow control over whether submenus are automatically opened on page load for the active menu item. Setting this class now makes it possible to achieve this. The class can be conveniently set in the module via the backend.

menu class setting in backend for nav-active-open for toggle stay open on active menu

 

How to make a sidebar menu without dropdown toggle

If you want to keep all submenus open, you don't need a dropdown toggle. In order to accomplish that you have to make a so called template override. See the article about template overrides.

This is how this particular template override is done:

  1. Start by selecting System → Templates → Site Templates in the Administrator menu and then select the Cassiopeia Details and Files item. That will open the Templates: Customise (Cassiopeia) form.

  2. Switch to tab Create Overrides and and select by clicking mod_menu

    module menu template override selection

  3. Go back to the editor tab and expand the entries under HTML → mod_menu.  Here you will find the entry default.php. Open the file and start editing your override.

    mod_menu override edit tab - open default.php

  4. To display the menu as a plain list - without the toggle function and without the associated accessibility buttons - we need to remove the code lines listed here.

    Diff view after removing the code lines for the toggle functionality.

    Remove lines 15 - 20

     
    /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
    $wa = $app->getDocument()->getWebAssetManager();
    $wa->getRegistry()->addExtensionRegistryFile('mod_menu');
    $wa->usePreset('mod_menu.menu');

    Remove lines 66-71

        // The next item is deeper - add toggle only here it is a heading or separator
        if ($item->deeper && (int) $item->level === $startLevel && in_array($item->type, ['separator', 'heading'])) {
            // Add a toggle button.
            echo '<button class="mod-menu__toggle-sub" aria-expanded="false">';
        }
     

    Remove lines 93 - 94

                        echo '<span class="icon-chevron-down" aria-hidden="true">' .
                            '</span></button>';
     

    Replace lines 98 - 101 with `break`

                        echo '<button class="mod-menu__toggle-sub" aria-expanded="false">' .
                     break;
                        '<span class="icon-chevron-down" aria-hidden="true"></span>' .
                        '<span class="visually-hidden">' . Text::sprintf('MOD_MENU_TOGGLE_SUBMENU_LABEL', $item->title) . '</span>' .
                        '</button>';
     

Result

As a result, we get a plain list, without toggle functionality for our menu module.

result with template override - plain list without toggle buttons and functionality

Best Pratice Tip

Before you start creating overrides in your template, first create a child template. Do not edit the original template that comes with Joomla!, as this may be overwritten during the next update. The changes in your child template will be preserved.