caffeinated / menus

:pushpin: Menu generator package for the Laravel framework
https://caffeinatedpackages.com
132 stars 59 forks source link

How to handle Submenu in a different layout position #56

Closed mstaack closed 9 years ago

mstaack commented 9 years ago

lets say i have this menu:

Menu::make('main', function ($menu) {
$menu->add('Client', 'client')->prepend('<i class="fa fa-suitcase"> </i> ');
$menu->client->add('Insurance', '/client/insurance');

now i have a bootstrap list-group element in my design.. i would like to show the subitems in this list group..somethin like this:

if(currentmenu->hasChilds)
foreach($childs as $item){
{{ link for submenu item}}
}

any ideas or hints?

mstaack commented 9 years ago

any help for this?

kaidesu commented 9 years ago

I'm not sure I understand what you need. An example of how to display menu item children links is in the documentation here:

@if($item->hasChildren())
    <ul class="dropdown-menu">
        @foreach($item->children() as $child)
            <li><a href="{{ $child->url() }}">{{ $child->title }}</a></li>
        @endforeach
    </ul>
@endif