Skip to content

Add "Expand active trail" option for Dropdown menu style in menu blocks #7138

@juanolalla

Description

@juanolalla

Description of the need:

When using the Dropdown menu the menu always starts fully collapsed. This is not ideal for non-horizontal menu blocks like in a sidebar. When a user is navigating a deep section of the site, they lose the context of their location within the menu hierarchy. Even though Backdrop correctly identifies the active-trail classes, the SmartMenus library initializes by hiding all submenus.

Proposed solution:

Add a new checkbox to the Menu block configuration form (specifically when "Dropdown menu" style is selected) called "Expand active trail".

  • UI: This checkbox should only be visible when the style is set to "Dropdown".
  • Functionality: When enabled, the menu should initialize with any <li> elements that have the .active-trail class already expanded.

Draft of feature description for Press Release:

Backdrop now includes an "Expand active trail" option for menu blocks using the Dropdown style. This allows site builders to ensure that the current section of a menu remains visible on page load, providing better navigation context for users and making it easier to create functional accordion-style sidebars without custom code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions