Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

_MenuItem.cshtml

@model SiteMapNode
@using Nop.Core.Domain.Localization
@inject IWorkContext workContext
@inject LocalizationSettings localizationSettings
@{
    var supportRtl = (await workContext.GetWorkingLanguageAsync()).Rtl && !localizationSettings.IgnoreRtlPropertyForAdminArea;
    string url = null;
    if (!string.IsNullOrEmpty(Model.ControllerName) && !string.IsNullOrEmpty(Model.ActionName))
    {
        url = Url.Action(Model.ActionName, Model.ControllerName, Model.RouteValues, null, null);
    }
    else if (!string.IsNullOrEmpty(Model.Url))
    {
        url = Model.Url.StartsWith("~/", StringComparison.Ordinal) ? Url.Content(Model.Url) : Model.Url;
    }
    var isActive = Model.ContainsSystemName(NopHtml.GetActiveMenuItemSystemName());
}
@if (!string.IsNullOrEmpty(url))
{
    
}
else
{
    var childNodes = Model.ChildNodes.Where(x => x.Visible).ToList();
    var hasChildNodes = childNodes.Any();
    var liCssClass = "";


    if (hasChildNodes)
    {
        liCssClass = "nav-item has-treeview";
    }

    if (isActive)
    {
        if (!String.IsNullOrEmpty(liCssClass))
        {
            liCssClass += " ";
        }
        liCssClass += "menu-open";
    }

    
  • @if (!string.IsNullOrEmpty(Model.IconClass)) { }

    @Model.Title @if (supportRtl) { } else { }

    @if (hasChildNodes) { }
  • }