- Issue created by @thalemn
Can't add counters to mmenu items
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,
]
]
];
}
Active
5.0
Code