Skip to content

Commit

Permalink
Fix navigation html code
Browse files Browse the repository at this point in the history
Add @Yled sections 'sidebar.top', 'sidebar.bottom', 'sodebar.ul.top', 'sidebar.ul.bottom' to inject custom html code to sidebar
  • Loading branch information
butschster committed Feb 21, 2016
1 parent be23dac commit d9840a9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
22 changes: 17 additions & 5 deletions resources/views/default/_partials/navigation.blade.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
<div class="navbar-default sidebar" role="navigation">

@yield('sidebar.top')

<div class="sidebar-nav navbar-collapse">
<ul class="nav" id="side-menu">
@foreach(AdminNavigation::getRootSection()->getPages() as $item)

@yield('sidebar.ul.top')

@foreach(AdminNavigation::getRootSection()->getPages() as $item)
<li @if($item->isActive())class="active"@endif>
<a href="{{ $item->getUrl() }}">
{!! $item->getIcon() !!}
<span class="mm-text">{!! $item->getName() !!}</span>
</a>
</li>
@endforeach
@endforeach

@foreach(AdminNavigation::getRootSection()->getSections() as $section)
@include(AdminTemplate::getTemplateViewPath('_partials.navigation.sections'), ['section' => $section])
@endforeach

@yield('sidebar.ul.bottom')

@foreach(AdminNavigation::getRootSection()->getSections() as $section)
@include(AdminTemplate::getTemplateViewPath('_partials.navigation.sections', ['section' => $section]))
@endforeach
</ul>

@yield('sidebar.bottom')

</div>
</div>
11 changes: 6 additions & 5 deletions resources/views/default/_partials/navigation/sections.blade.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
@if(count($section) > 0 or $section->hasSections())
<li class="mm-dropdown @if($section->isActive()) open @endif">
<li>
<a href="#">
{!! $section->getIcon() !!}
<span class="mm-text">{!! $section->getName() !!}</span>
{!! $section->getName() !!}
<span class="fa arrow"></span>
</a>
<ul>
<ul class="nav nav-second-level">
@foreach($section as $item)
<?php if($item->isHidden()) continue; ?>
<li @if ($item->isActive())class="active"@endif>
<a href="{{ $item->getUrl() }}">
{!! $item->getIcon() !!}
<span class="mm-text">{!! $item->getName() !!}</span>
{!! $item->getName() !!}
</a>
</li>
@endforeach

@foreach($section->getSections() as $sub_section )
@include(AdminTemplate::getTemplateViewPath('_partials.navigation.sections', ['section' => $sub_section])
@include(AdminTemplate::getTemplateViewPath('_partials.navigation.sections'), ['section' => $sub_section])
@endforeach
</ul>
</li>
Expand Down

0 comments on commit d9840a9

Please sign in to comment.