]> _ Git - cubist_cms-back.git/commitdiff
fix #2922
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 6 Sep 2019 14:13:30 +0000 (16:13 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 6 Sep 2019 14:13:30 +0000 (16:13 +0200)
src/app/Magic/Menu/Menu.php

index 729077721781c89a8b073a222e39c908d3dc5b3d..73ddd9ba64160d479c0e3c5619a6d71ee20d664d 100644 (file)
@@ -148,11 +148,11 @@ class Menu extends BaseMenu
             if (!$child->isMenuDesktop()) {
                 continue;
             }
-            $parent = $menu->add($child->getTitle(), $child->getHref());
+            $parent = $menu->add($child->getTitle(), $child->getHref())->attr('data-name', $child->getName());
             // Handle items with submenus
             if ($child->isMenuDesktopChildren()) {
                 foreach ($child->getChildren() as $subitem) {
-                    $parent->add($subitem->getTitle(), $subitem->getHref());
+                    $parent->add($subitem->getTitle(), $subitem->getHref())->attr('data-name', $subitem->getName());
                 }
             }
         }
@@ -169,9 +169,9 @@ class Menu extends BaseMenu
                 continue;
             }
             if ($child->isNavigable()) {
-                $parent = $menu->add($child->getTitle(), $child->getHref());
+                $parent = $menu->add($child->getTitle(), $child->getHref())->attr('data-name', $child->getName());
             } else {
-                $parent = $menu->raw('<span>' . $child->getTitle() . '</span>');
+                $parent = $menu->raw('<span>' . $child->getTitle() . '</span>')->attr('data-name', $child->getName());
             }
             if ($child->isMenuMobileChildren()) {
                 $this->makeMobileMenu($parent, $child);