Counter addon not working as expected

Created on 6 November 2023, 8 months ago

Problem/Motivation

Can't add counters to mmenu items

Steps to reproduce

I have installed the module and the correct mmenu library. Most of the addons are working (search, breadcrumbs), but the counters are not working as expected. The mm-counter div is there, but empty. You can see the mmenu here: https://bookstores9-dev.umn.edu/

Drupal 10.1.6
Responsive Menu 5.0.0-alpha1
mmenu library 8.5.24

Here is the theme function:

function bookstores_preprocess_page(&$variables) {
  $variables['#attached']['drupalSettings']['responsive_menu']['custom'] = [
    'options' => [
      'counters' => [
        'add' => TRUE,
      ],
        'searchfield' => [
          'add' => TRUE,
          'placeholder' => 'Search menu items',
        ],
        'navbar' => [
          // nothing here
        ],
        'navbars' => [
          [
            'position' => 'top',
            'content' => [
              '<div class="mm-bks-menu-logo"><img src="https://umn-bookstores9-drupal.s3.us-east-2.amazonaws.com/2023-10/bks-d10-logo.png" alt="University of Minnesota Bookstores Logo" class="logo-image"></div>',
            ],
          ],
          [
            'position' => 'top',
            'content' => [
              'searchfield',
            ],
          ],
          [
            'position' => 'top',
            'content' => [
              'breadcrumbs',
            ],
          ],
        ],
      ],
    'config' => [
      'searchfield' => [
        'clear' => TRUE,
      ]

    ]
  ];
}
πŸ’¬ Support request
Status

Active

Version

5.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States thalemn

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024