Forsendelsesland: Danmark | DKK
Vælg et andet forsendelsesland
Gå til en af vores andre webshops
Error executing template "Designs/HD2412/MasterBlocks/HeaderBlocks/navigation/partials/node.cshtml"System.ArgumentException: An item with the same key has already been added.at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)at Dynamicweb.Ecommerce.Products.GroupRelation.GetGroupRelationsByChildId(String childId)at Dynamicweb.Ecommerce.Products.Group.get_IsTopGroup()at Dynamicweb.Ecommerce.Shops.Shop.GetTopLevelGroups(String languageId)at Dynamicweb.Ecommerce.Frontend.Navigation.GroupNavigationTreeNodeProvider.GetGroupsBySettings(PageNavigationSettings ecomSettings)at Dynamicweb.Ecommerce.Frontend.Navigation.GroupNavigationTreeNodeProvider.GetGroups(NavigationTreeNode parent, Page page)at Dynamicweb.Ecommerce.Frontend.Navigation.GroupNavigationTreeNodeProvider.GetNodes(NavigationContext context, NavigationSettings settings, NavigationTreeNode parent)at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)at Co3.Espresso.Website.Services.NavigationService.RenderNavItemClasses(EspressoNavigationTreeNode node) in D:\a\1\s\Co3.Espresso.Website\Services\NavigationService.cs:line 176at CompiledRazorTemplates.Dynamic.RazorEngine_e68990903b294ff6a4d24a9c55cf59ac.Execute() in E:\Solutions\HedeDanmark\Files\Templates\Designs\HD2412\MasterBlocks\HeaderBlocks\navigation\partials\node.cshtml:line 50at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)at Dynamicweb.Rendering.Template.RenderRazorTemplate() 1 @inherits ViewModelTemplate< EspressoNavigationTreeNode > 2 @using System.Linq 3 @using Co3.Espresso.Website.Models.FrontEnd 4 @using Co3.Espresso.Website.Models.FrontEnd.Settings 5 @using Co3.Espresso.Website.Services 6 @using Co3.Espresso.Website.Models.FrontEnd.Navigation 7 @using Dynamicweb.Ecommerce.Common 8 @using Dynamicweb.Ecommerce.Notifications 9 @using Dynamicweb.Frontend 10 @using Dynamicweb.Frontend.Navigation 11 @using Dynamicweb.Rendering 12 @using Dynamicweb.Security.UserManagement 13 @using Page = Dynamicweb.Content.Page 14 15 @{ 16 string navigationType = NavigationService.Instance.GetPageProperty( Model.PageId, "NavigationType" ); 17 Page page = Dynamicweb.Services.Pages.GetPage(Model.PageId); 18 string navigationTag = page.NavigationTag; 19 List<string> customClassList = new List<string>(); 20 21 switch (navigationTag) 22 { 23 case "Sale": 24 customClassList.Add("nav-link-is-sale"); 25 break; 26 case "Outlet": 27 customClassList.Add("nav-link-is-outlet"); 28 break; 29 } 30 31 string internalEcommerceGroupsOnly = Pageview.AreaSettings.GetItem("Custom").GetItem("CustomSettings").GetString("InternalEcommerceGroupsOnly"); 32 string placeholderProductGroups = Pageview.AreaSettings.GetItem("Custom").GetItem("CustomSettings").GetString("PlaceholderProductGroups"); 33 int.TryParse(Pageview.AreaSettings.GetItem("Custom").GetItem("CustomSettings").GetString("InternalGroupId"), out int internalGroupId); 34 bool hasPlaceholderGroupIdMatch = false; 35 36 if (!string.IsNullOrEmpty(Model.GroupId)) 37 { 38 hasPlaceholderGroupIdMatch = !string.IsNullOrEmpty(placeholderProductGroups) && placeholderProductGroups.IndexOf(Model.GroupId, StringComparison.Ordinal) > -1; 39 40 User currentUser = PageView.Current().User; 41 42 if ( !string.IsNullOrEmpty(internalEcommerceGroupsOnly) && internalEcommerceGroupsOnly.IndexOf(Model.GroupId, StringComparison.Ordinal) > -1) 43 { 44 if (currentUser == null || !currentUser.GroupsIds.Contains(internalGroupId)) 45 { 46 return; 47 } 48 49 } 50 } 51 } 52 53 <li class="@NavigationService.Instance.RenderNavItemClasses( Model ) @(hasPlaceholderGroupIdMatch ? "minimized-ecom-group" : string.Empty)"> 54 @if ( NavigationService.Instance.HasNodeDropdownOrMegaMenu( Model ) && NavigationService.Instance.IsNodePage( Model ) ) 55 { 56 <a class="@NavigationService.Instance.RenderNavLinkClasses( Model ) @(customClassList.Any() ? string.Join(" ", customClassList) : string.Empty)" data-bs-toggle="dropdown" data-bs-auto-close="false" href="@Model.Link"> 57 @NavigationService.Instance.RenderNavPageName( Model ) 58 </a> 59 } 60 else if ( Model.Nodes.Any() ) 61 { 62 if (!hasPlaceholderGroupIdMatch) 63 { 64 <a class="@NavigationService.Instance.RenderNavLinkClasses( Model ) @(customClassList.Any() ? string.Join(" ", customClassList) : string.Empty)" href="@Model.Link"> 65 @NavigationService.Instance.RenderNavPageName( Model ) 66 </a> 67 } 68 else 69 { 70 <a class="@NavigationService.Instance.RenderNavLinkClasses( Model ) @(customClassList.Any() ? string.Join(" ", customClassList) : string.Empty)"> 71 @NavigationService.Instance.RenderNavPageName( Model ) 72 </a> 73 } 74 75 } 76 else 77 { 78 <a class="@NavigationService.Instance.RenderNavLinkClasses( Model ) @(customClassList.Any() ? string.Join(" ", customClassList) : string.Empty)" href="@Model.Link"> 79 @NavigationService.Instance.RenderNavPageName( Model ) 80 </a> 81 } 82 @if ( Model.Nodes.Any() ) 83 { 84 if ( navigationType == NavigationService.Instance.NavigationTypeMegaMenu && NavigationService.Instance.IsNodePage( Model ) ) 85 { 86 string megaMenuPageId = NavigationService.Instance.GetPageProperty( Model.PageId, "MegamenuPageId" ); 87 int megaMenuPageIdAsInt = default( int ); 88 string megaMenuText = NavigationService.Instance.GetPageProperty( Model.PageId, "MegamenuText" ); 89 <div class="@NavigationService.Instance.RenderSubNavWrapperClasses(Model)" id="@NavigationService.Instance.RenderSubNavId(Model)"> 90 <div class="e-megamenu__inner"> 91 92 <section class="e-section e-megamenu-section"> 93 <div class="container-fluid"> 94 <div class="col-12 col-lg-9 e-megamenu-nav"> 95 <ul class="@NavigationService.Instance.RenderSubNavClasses(Model)" data-item-count="@Model.Nodes.Count()"> 96 @foreach (EspressoNavigationTreeNode subNode in Model.Nodes) 97 { 98 @RenderingService.Instance.PartialView("MasterBlocks/HeaderBlocks/navigation/partials/node.cshtml", subNode) 99 }100 </ul>101 </div>102 <div class="col-12 col-lg-3">103 @if (int.TryParse(megaMenuPageId, out megaMenuPageIdAsInt))104 {105 if (megaMenuPageIdAsInt > 0)106 {107 <div class="col-12 e-megamenu-paragraphs">108 @RenderPageContent(megaMenuPageIdAsInt)109 </div>110 }111 }112 else if (string.IsNullOrEmpty(megaMenuText) == false)113 {114 <div class="col-12 col-lg-8 col-md-10 e-megamenu-text mx-auto">115 @megaMenuText116 </div>117 }118 </div>119 </div>120 </section>121 </div>122 </div>123 }124 else125 {126 <div class="@NavigationService.Instance.RenderSubNavWrapperClasses( Model )" id="@NavigationService.Instance.RenderSubNavId( Model )">127 <ul class="@NavigationService.Instance.RenderSubNavClasses( Model )">128 @foreach ( EspressoNavigationTreeNode subNode in Model.Nodes )129 {130 @RenderingService.Instance.PartialView( "MasterBlocks/HeaderBlocks/navigation/partials/node.cshtml", subNode )131 }132 @if ( NavigationService.Instance.IsNodeEcommerceGroup( Model ) )133 {134 string viewAllNodeName = Translate( "Navigation - View all link - text", "View all {{GroupName}}" ).Replace( "{{GroupName}}", Model.Name.ToLower() );135 EspressoNavigationTreeNode viewAllNode = NavigationService.Instance.CreateViewAllEcommerceGroupNode( viewAllNodeName, Model );136 @RenderingService.Instance.PartialView("MasterBlocks/HeaderBlocks/navigation/partials/node.cshtml", viewAllNode)137 }138 </ul>139 </div>140 }141 }142 </li>143