-
-
Notifications
You must be signed in to change notification settings - Fork 80
Closed
Description
Got pretty much everything working. Thanks for the package!
One small issue with dropdown using UIKit. When I use ->submenuIf()
and have ->wrap('div', ['class' => 'uk-navbar-dropdown'])
, it adds it around the <a>
as well which I don't want. Any way to do that? Tried quite a few different ideas but none worked.
Menu::macro('main', function() {
$menu = Menu::new()
->addClass('uk-navbar-nav')
->setActiveClass('uk-active')
->route('home', 'Home')
->submenuIf($isAdmin, '<a href="#">Admin</a>', function (Spatie\Menu\Laravel\Menu $menu) {
$menu
//->wrap('div', ['class' => 'uk-navbar-dropdown'])
->addClass('uk-nav uk-navbar-dropdown-nav')
->route('admin.item', 'Item')
->route('admin.item2', 'Item 2')
;
})
->setActiveFromRequest()
;
return $menu;
});
Need this format;
<li>
<a href="#">Parent</a>
<div class="uk-navbar-dropdown">
<ul class="uk-nav uk-navbar-dropdown-nav">
<li><a href="#">Item</a></li>
<li><a href="#">Item</a></li>
</ul>
</div>
</li>
Metadata
Metadata
Assignees
Labels
No labels