Browse Source

Do not render empty menus

pull/279/head
Halil İbrahim Kalkan 9 years ago
parent
commit
d2180f2723
  1. 9
      src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Views/Shared/Components/Theme/MainNavbar/Menu/Default.cshtml

9
src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic/Views/Shared/Components/Theme/MainNavbar/Menu/Default.cshtml

@ -1,11 +1,16 @@
@using Volo.Abp.UI.Navigation
@using System
@using Volo.Abp.UI.Navigation
@model ApplicationMenu
@foreach (var menuItem in Model.Items)
{
if (menuItem.IsLeaf)
{
if (menuItem.Url.IsNullOrEmpty())
{
continue;
}
<li class="nav-item @(menuItem.IsDisabled ? "disabled" : "")">
<!-- active -->
<a class="nav-link" href="@(menuItem.Url ?? "#")">@menuItem.DisplayName</a> @*<span class="sr-only">(current)</span>*@
</li>
}

Loading…
Cancel
Save