Skip to content

Dropdown Navigation Plugin

View Plugin

The DmfDropdownNavigation plugin replaces the standard navigation bar in Shopware 6 with an accessible dropdown navigation. With full keyboard support and customizable colors, it provides an improved user experience.

On this page:


Requirements

  • Shopware 6.7.0 or higher
  • PHP 8.2 or higher

Installation

bash
composer require dmf/plugin-dropdown-navigation
bin/console plugin:install --activate DmfDropdownNavigation
bin/console cache:clear

Features

  • Accessible Navigation: Full keyboard navigation (WCAG 2.1 compliant)
  • Dropdown Menus: Clear subcategory display
  • Color Configuration: All colors customizable via Admin panel
  • Highlighted Category: First category can be visually highlighted
  • Responsive: Optimized for all screen sizes

Configuration

Path: Settings → System → Plugins → Dropdown Navigation → Configuration

OptionTypeDefaultDescription
highlightFirstCategorySelectlightenHighlight of first category
navBgColorColorpicker#0B1845Navigation bar background color
navLinkColorColorpicker#FFFFFFLink text color
navLinkBgHoverColorpicker#215AFFHover background color
navLinkHoverColorColorpicker#FFFFFFHover text color

First Category Highlight

ValueDescription
lightenFirst category displayed lighter
darkenFirst category displayed darker
noHighlightNo highlighting

Accessibility

The plugin was developed with a focus on accessibility and meets WCAG 2.1 guidelines.

Keyboard Navigation

KeyAction
TabMove to next navigation element
Shift + TabMove to previous element
Enter / SpaceOpen dropdown / activate link
EscapeClose dropdown
Arrow keysNavigate within dropdown

ARIA Attributes

The navigation uses semantic ARIA attributes for screen readers:

  • aria-haspopup="true" for elements with submenu
  • aria-expanded shows dropdown status
  • aria-current="page" marks current page
  • role="menubar" and role="menu" for menu structure

Usage

Default Configuration

After installation, the dropdown navigation automatically appears instead of the standard navigation. The default colors (dark blue background, white text) can be customized via plugin configuration.

Customize Color Scheme

  1. Open SettingsSystemPlugins
  2. Click the gear icon on Dropdown Navigation
  3. Adjust colors to match your shop design:
    • Background color: Should match the header
    • Text color: Must provide sufficient contrast (WCAG AA: 4.5:1)
    • Hover colors: Visual feedback for interaction

Example Color Configurations

Dark Theme (Default):

Background:      #0B1845
Text color:      #FFFFFF
Hover background: #215AFF
Hover text color: #FFFFFF

Light Theme:

Background:      #F8F9FA
Text color:      #212529
Hover background: #E9ECEF
Hover text color: #000000

Technical Details

CSS Custom Properties

The plugin uses CSS Custom Properties set via configuration:

css
:root {
    --dmf-nav-bg-color: #0B1845;
    --dmf-nav-link-color: #FFFFFF;
    --dmf-nav-link-bg-hover: #215AFF;
    --dmf-nav-link-hover-color: #FFFFFF;
}

JavaScript Functions

The navigation uses vanilla JavaScript for:

  • Dropdown open/close
  • Keyboard navigation
  • Touch events for mobile devices
  • Focus management

Troubleshooting

  1. Check if plugin is activated
  2. Clear cache: bin/console cache:clear
  3. Recompile theme: bin/console theme:compile

Colors not applied

  1. Save configuration again
  2. Clear cache
  3. Check browser DevTools for CSS conflicts

Keyboard navigation not working

  1. Ensure no other JavaScript is blocking events
  2. Check browser console for errors