Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

divide() in sub items #65

Open
vedmant opened this issue Sep 7, 2015 · 1 comment
Open

divide() in sub items #65

vedmant opened this issue Sep 7, 2015 · 1 comment

Comments

@vedmant
Copy link

vedmant commented Sep 7, 2015

Here is a bug I think, when I try to add divide() between sub items http://screencast.com/t/uKugE0SmG4O it appears not inside dropdown but at top level menu http://screencast.com/t/5b2LXRwLF05s

@johnhearfield
Copy link

johnhearfield commented Mar 22, 2017

Have you tried adding this in your menu items @foreach($item->children() as $child) loop, like this:

@foreach($items as $item)
        ...
            @if($item->hasChildren())
                <ul class="dropdown-menu" role="menu">
                    @foreach($item->children() as $child)
                        <li>
                            <a href="{{ $child->url() }}{!! $child->attribute('query') !!}">
                                {{ $child->title }}
                            </a>
                        </li>
                        @if ($child->divider)
                            <li {{ \Html::attributes($child->divider) }}></li>
                        @endif
                    @endforeach
                </ul>
            @endif
        ...
@endforeach

The code for when making the submenu:

$dropdown = $menu->add('Dropdown');
$dropdown->add('First Item', ['routes' => 'route.index']);
$dropdown->add('Second Item', ['routes' => 'route.index'])->divide();
$dropdown->add('Action 1, ['routes' => 'route.index'])->divide();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants