Webiant Logo Webiant Logo
  1. No results found.

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

Default.cshtml

@model TopMenuModel

@using Nop.Core.Domain.Catalog
@using Nop.Core.Domain.Topics

@functions {
    async Task CategoryLine(TopMenuModel.CategoryLineModel lineModel)
    {
        
  • @lineModel.Category.Name @if (lineModel.Category.NumberOfProducts.HasValue) { @T("Categories.TotalProducts", lineModel.Category.NumberOfProducts.Value) } @{ //subcategories var subCategories = lineModel.ResponsiveMobileMenu ? //responsive (all categories) lineModel.Category.SubCategories : //standard design (only categories with "IncludeInTopMenu") lineModel.Category.SubCategories.Where(x => x.IncludeInTopMenu).ToList(); var levelClass = ""; if (lineModel.Level == 0) { levelClass = "first-level"; } if (subCategories.Count > 0) {
      @foreach (var subCategory in subCategories) { var categoryLineModel = new TopMenuModel.CategoryLineModel { Category = subCategory, Level = lineModel.Level + 1, ResponsiveMobileMenu = lineModel.ResponsiveMobileMenu }; await CategoryLine(categoryLineModel); }
    } }
  • } }
      @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.HeaderMenuBefore, additionalData = Model }) @if (Model.DisplayHomepageMenuItem) {
    • @T("Homepage")
    • } @if (!Model.UseAjaxMenu) { var rootCategories = Model.Categories.Where(x => x.IncludeInTopMenu).ToList(); @foreach (var category in rootCategories) { var categoryLineModel = new TopMenuModel.CategoryLineModel { Category = category }; await CategoryLine(categoryLineModel); } } @foreach (var topic in Model.Topics) {
    • @topic.Name
    • } @if (Model.NewProductsEnabled && Model.DisplayNewProductsMenuItem) {
    • @T("Products.NewProducts")
    • } @if (Model.DisplayProductSearchMenuItem) {
    • @T("Search")
    • } @if (Model.DisplayCustomerInfoMenuItem) {
    • @T("Account.MyAccount")
    • } @if (Model.BlogEnabled && Model.DisplayBlogMenuItem) {
    • @T("Blog")
    • } @if (Model.ForumEnabled && Model.DisplayForumsMenuItem) {
    • @T("Forum.Forums")
    • } @if (Model.DisplayContactUsMenuItem) {
    • @T("ContactUs")
    • } @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.HeaderMenuAfter, additionalData = Model })
    @{ var rootCategoriesResponsive = Model.Categories.ToList(); //name it "Categories" if we have only categories. Otherwise, "Menu" var responsiveMenuTitle = Model.HasOnlyCategories ? T("Categories") : T("Menu");
      @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.MobHeaderMenuBefore, additionalData = Model }) @if (Model.DisplayHomepageMenuItem) {
    • @T("Homepage")
    • } @if (!Model.UseAjaxMenu) { @foreach (var category in rootCategoriesResponsive) { var categoryLineModel = new TopMenuModel.CategoryLineModel { Category = category, ResponsiveMobileMenu = true }; await CategoryLine(categoryLineModel); } } @foreach (var topic in Model.Topics) {
    • @topic.Name
    • } @if (Model.NewProductsEnabled && Model.DisplayNewProductsMenuItem) {
    • @T("Products.NewProducts")
    • } @if (Model.DisplayProductSearchMenuItem) {
    • @T("Search")
    • } @if (Model.DisplayCustomerInfoMenuItem) {
    • @T("Account.MyAccount")
    • } @if (Model.BlogEnabled && Model.DisplayBlogMenuItem) {
    • @T("Blog")
    • } @if (Model.ForumEnabled && Model.DisplayForumsMenuItem) {
    • @T("Forum.Forums")
    • } @if (Model.DisplayContactUsMenuItem) {
    • @T("ContactUs")
    • } @await Component.InvokeAsync(typeof(WidgetViewComponent), new { widgetZone = PublicWidgetZones.MobHeaderMenuAfter, additionalData = Model })
    @if (Model.UseAjaxMenu) { } else { } }