public class MenuItem : NavigationItem<MenuItem>
{
public string Action { get; set; }
public string Controller { get; set; }
public string Area { get; set; }
public string Icon { get; set; }
}
@model MenuItem
<li data-icon="@Model.Icon" data-id="@Model.Id">
<a href="@Url.Action(Model.Action, Model.Controller, new { area = Model.Area })" class="@(Model.IsActive ? "active" : "")">@Model.Title</a>
@if (Model.HasChildren)
{
<ul>
@foreach (var menuItem in Model.Children)
{
<partial name="_MenuItem" model="menuItem" />
}
</ul>
}
</li>
@using Structr.Navigation
@model INavigation<MenuItem>
<div class="navigation">
<h4 class="navigation-title">Menu:</h4>
<ul class="navigation-content">
@foreach (var menuItem in Model)
{
<partial name="_MenuItem" model="menuItem" />
}
</ul>
</div>
@using Structr.Navigation
@inject INavigation<MenuItem> menu
<partial name="_Menu" model="menu" />