Rotary Bar Lock 922, ø16,5x22mm, RH, Black NPL, CK SISO, W/ Black Accessories, No Bars, 3-Way, 15mm Backset
Item number: 14.05.275-0
Delivery to 80 countries
We speak 13 languages
10.000 different products
B2B sales
70 years experience
Error compiling template "Designs/Swift/Navigation/MegaMenu.cshtml" Line 70: The name 'rootPageId' does not exist in the current context Line 773: 'User.GetCurrentSecondaryUser()' is obsolete: 'Use UserContext.Current.ImpersonatingUser instead.'
1 // <auto-generated/> 2 #pragma warning disable 1591 3 namespace CompiledRazorTemplates.Dynamic 4 { 5 #line hidden 6 using System.Threading.Tasks; 7 using System; 8 using System.Collections.Generic; 9 using System.Linq; 10 using Dynamicweb; 11 using Dynamicweb.Ecommerce.Orders; 12 using System.IO; 13 using Dynamicweb.Ecommerce.ProductCatalog; 14 using Dynamicweb.Ecommerce.Common; 15 using System.Text; 16 internal class RazorEngine_df908c01e5e249f5bb4df2035f46c4e5 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.Navigation.NavigationTreeViewModel> 17 { 18 #pragma warning disable 1998 19 public async override global::System.Threading.Tasks.Task ExecuteAsync() 20 { 21 WriteLiteral("\n"); 22 WriteLiteral("\n"); 23 string theme = !string.IsNullOrEmpty(Model.Parameters["theme"].ToString()) ? Model.Parameters["theme"].ToString() : string.Empty; string navAlignment = !string.IsNullOrEmpty(Model.Parameters["NavAlignment"].ToString()) ? Model.Parameters["NavAlignment"].ToString() : string.Empty; string linkFontWeight = !string.IsNullOrEmpty(Model.Parameters["LinkFontWeight"].ToString()) ? Model.Parameters["LinkFontWeight"].ToString() : string.Empty; string linkCasing = !string.IsNullOrEmpty(Model.Parameters["LinkCasing"].ToString()) ? Model.Parameters["LinkCasing"].ToString() : string.Empty; string linkFontSize = !string.IsNullOrEmpty(Model.Parameters["LinkFontSize"].ToString()) ? Model.Parameters["LinkFontSize"].ToString() : string.Empty; string layout = !string.IsNullOrEmpty(Model.Parameters["Layout"].ToString()) ? Model.Parameters["Layout"].ToString() : string.Empty; string iconSize = "icon-3"; if (linkFontSize == "fs-7") { iconSize = "icon-2"; } if (linkFontSize == "fs-5") { iconSize = "icon-4"; } string dropdownAlignment = Model.Parameters["DropdownAlignment"] != null ? Model.Parameters["DropdownAlignment"].ToString() : string.Empty; string dropdownLinkHeaderFontWeight = Model.Parameters["DropdownLinkHeaderFontWeight"] != null ? Model.Parameters["DropdownLinkHeaderFontWeight"].ToString() : string.Empty; string dropdownLinkHeaderCasing = Model.Parameters["DropdownLinkHeaderCasing"] != null ? Model.Parameters["DropdownLinkHeaderCasing"].ToString() : string.Empty; string dropdownLinkHeaderFontSize = Model.Parameters["DropdownLinkHeaderFontSize"] != null ? Model.Parameters["DropdownLinkHeaderFontSize"].ToString() : string.Empty; string dropdownLinkFontWeight = Model.Parameters["DropdownLinkFontWeight"] != null ? Model.Parameters["DropdownLinkFontWeight"].ToString() : string.Empty; string dropdownLinkCasing = Model.Parameters["DropdownLinkCasing"] != null ? Model.Parameters["DropdownLinkCasing"].ToString() : string.Empty; string dropdownLinkFontSize = Model.Parameters["DropdownLinkFontSize"] != null ? Model.Parameters["DropdownLinkFontSize"].ToString() : string.Empty; string productGroupImagePlacement = Model.Parameters["ProductGroupImagePlacement"] != null ? Model.Parameters["ProductGroupImagePlacement"].ToString() : string.Empty; string imageAlignment = ""; imageAlignment = dropdownAlignment == "justify-content-start text-start" && productGroupImagePlacement == "flex-row" ? "align-items-center" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-start text-start" && productGroupImagePlacement == "flex-row-reverse" ? "align-items-center" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-start text-start" && productGroupImagePlacement == "flex-column" ? "align-items-start" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-center text-center" && productGroupImagePlacement == "flex-row" ? "align-items-center" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-center text-center" && productGroupImagePlacement == "flex-row-reverse" ? "align-items-center" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-center text-center" && productGroupImagePlacement == "flex-column" ? "align-items-center" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-end text-end" && productGroupImagePlacement == "flex-row" ? "align-items-center" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-end text-end" && productGroupImagePlacement == "flex-row-reverse" ? "align-items-center" : imageAlignment; bool showProductGroupPromotionImage = Model.Parameters.ContainsKey("ShowProductGroupPromotionImage") ? Convert.ToBoolean(Model.Parameters["ShowProductGroupPromotionImage"].ToString()) : false; string menuId = Model.Parameters.ContainsKey("menu-id") ? $"menu_{Model.Parameters["menu-id"].ToString().ToLower()}" : string.Empty; int currentParagraphId = Pageview.CurrentParagraph.ID; var area = Pageview.Page.Area; WriteLiteral("\n<nav"); 24 BeginWriteAttribute("class", " class=\"", 8199, "\"", 8232, 3); 25 WriteAttributeValue("", 8207, "d-flex", 8207, 6, true); 26 WriteAttributeValue(" ", 8213, "py-0", 8214, 5, true); 27 WriteAttributeValue(" ", 8218, navAlignment, 8219, 13, false); 28 EndWriteAttribute(); 29 BeginWriteAttribute("t", " t=\"", 8233, "\"", 8248, 1); 30 WriteAttributeValue("", 8237, rootPageId, 8237, 11, false); 31 EndWriteAttribute(); 32 WriteLiteral(">\n\t<ul"); 33 BeginWriteAttribute("class", " class=\"", 8255, "\"", 8286, 3); 34 WriteAttributeValue("", 8263, "nav", 8263, 3, true); 35 WriteAttributeValue(" ", 8266, "flex-nowrap", 8267, 12, true); 36 WriteAttributeValue(" ", 8278, menuId, 8279, 7, false); 37 EndWriteAttribute(); 38 WriteLiteral(">\n"); 39 foreach (var node in Model.Nodes) { var page = Dynamicweb.Content.Services.Pages.GetPage(node.PageId); var pageType = !string.IsNullOrEmpty(page.ItemType) ? page.ItemType : "Swift_Page"; string submenuType = "auto"; if (page.PropertyItem is object && page.PropertyItem.TryGetValue("SubmenuType", out object submenuTypeValue)) { submenuType = Dynamicweb.Core.Converter.ToString(submenuTypeValue); } string pageIcon = string.Empty; if (page.PropertyItem is object && page.PropertyItem.TryGetValue("Icon", out object pageIconValue)) { pageIcon = Dynamicweb.Core.Converter.ToString(pageIconValue); } var hasChildren = node.Nodes.Count() > 0; string dropdownAttributes = hasChildren ? " role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\" data-bs-toggle=\"dropdown\" data-bs-offset=\"0,0\"" : ""; bool hasManyChildren = false; foreach (var subnode in node.Nodes) { if (subnode.Nodes.Any()) { hasManyChildren = true; } } submenuType = submenuType == "auto" && hasManyChildren ? "megamenu" : submenuType; submenuType = submenuType == "auto" && !hasManyChildren ? "dropdown" : submenuType; string submenuTypeCss = submenuType == "dropdown" ? " dropdown" : ""; submenuTypeCss = submenuType == "megamenu" ? " dropdown position-static" : submenuTypeCss; string nodeId = !string.IsNullOrEmpty(node.GroupId) ? "Megamenu_" + node.GroupId + "_" + currentParagraphId : "Megamenu_Page_" + node.PageId.ToString() + "_" + currentParagraphId; string dataType = !string.IsNullOrEmpty(node.GroupId) ? "group" : "page"; WriteLiteral("\t\t\t<li"); 40 BeginWriteAttribute("id", " id=\"", 9905, "\"", 9919, 1); 41 WriteAttributeValue("", 9910, nodeId, 9910, 9, false); 42 EndWriteAttribute(); 43 WriteLiteral(" data-type=\""); 44 Write(dataType); 45 WriteLiteral("\""); 46 BeginWriteAttribute("class", " class=\"", 9942, "\"", 10006, 3); 47 WriteAttributeValue("", 9950, "nav-item", 9950, 8, true); 48 WriteAttributeValue("", 9958, node.IsActive ? " active" : "", 9958, 33, false); 49 WriteAttributeValue("", 9991, submenuTypeCss, 9991, 15, false); 50 EndWriteAttribute(); 51 WriteLiteral(">\n"); 52 if (node.IsClickable) { WriteLiteral("\t\t\t\t\t"); 53 WriteLiteral("<a class=\"nav-link p-2 text-decoration-underline-hover "); 54 Write(linkFontWeight); 55 WriteLiteral(" "); 56 Write(linkCasing); 57 WriteLiteral(" "); 58 Write(linkFontSize); 59 Write(node.IsActive ? " active" : ""); 60 Write(hasChildren ? " dropdown-toggle" : ""); 61 WriteLiteral("\" href=\""); 62 Write(node.Link); 63 WriteLiteral("\" "); 64 Write(dropdownAttributes); 65 WriteLiteral(" id=\"NavLink_"); 66 Write(nodeId); 67 WriteLiteral("\" t=\""); 68 Write(node.Level); 69 WriteLiteral("\">\n"); 70 } else { WriteLiteral("\t\t\t\t\t"); 71 WriteLiteral("<span class=\"nav-link p-2 "); 72 Write(linkFontWeight); 73 WriteLiteral(" "); 74 Write(linkCasing); 75 WriteLiteral(" "); 76 Write(linkFontSize); 77 WriteLiteral(" "); 78 Write(dropdownAlignment); 79 Write(hasChildren ? " dropdown-toggle" : ""); 80 WriteLiteral("\" "); 81 Write(dropdownAttributes); 82 WriteLiteral(" id=\"NavLink_"); 83 Write(nodeId); 84 WriteLiteral("\">\n"); 85 } WriteLiteral("\n\t\t\t\t"); 86 Write(RenderNavigationItem(node, pageType, pageIcon, iconSize, layout)); 87 WriteLiteral("\n\n"); 88 if (node.IsClickable) { WriteLiteral("\t\t\t\t\t"); 89 WriteLiteral("</a>\n"); 90 } else { WriteLiteral("\t\t\t\t"); 91 WriteLiteral("</span>\n"); 92 } WriteLiteral("\n"); 93 if (hasChildren) { if (submenuType == "megamenu") { WriteLiteral("\t\t\t\t\t\t<div"); 94 BeginWriteAttribute("class", " class=\"", 10742, "\"", 10785, 4); 95 WriteAttributeValue("", 10750, "dropdown-menu", 10750, 13, true); 96 WriteAttributeValue(" ", 10763, "megamenu", 10764, 9, true); 97 WriteAttributeValue(" ", 10772, "py-4", 10773, 5, true); 98 WriteAttributeValue("", 10777, theme, 10777, 8, false); 99 EndWriteAttribute(); 100 BeginWriteAttribute("aria-labelledby", " aria-labelledby=\"", 10786, "\"", 10811, 1); 101 WriteAttributeValue("", 10804, nodeId, 10804, 7, false); 102 EndWriteAttribute(); 103 BeginWriteAttribute("id", " id=\"", 10812, "\"", 10834, 2); 104 WriteAttributeValue("", 10817, "NavGroup", 10817, 8, true); 105 WriteAttributeValue("", 10825, nodeId, 10825, 9, false); 106 EndWriteAttribute(); 107 WriteLiteral(">\n\t\t\t\t\t\t\t<div class=\"container-xl overflow-y-auto\">\n"); 108 if (showProductGroupPromotionImage && !string.IsNullOrEmpty(node.GroupId)) { WriteLiteral("\t\t\t\t\t\t\t\t\t<div class=\"grid gap-4\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"g-col-9 g-col-xxl-10\">\n\t\t\t\t\t\t\t\t\t\t\t<div"); 109 BeginWriteAttribute("class", " class=\"", 11075, "\"", 11124, 4); 110 WriteAttributeValue("", 11083, "d-flex", 11083, 6, true); 111 WriteAttributeValue(" ", 11089, "flex-wrap", 11090, 10, true); 112 WriteAttributeValue(" ", 11099, "gap-3", 11100, 6, true); 113 WriteAttributeValue(" ", 11105, dropdownAlignment, 11106, 18, false); 114 EndWriteAttribute(); 115 WriteLiteral(">\n"); 116 foreach (var subnode in node.Nodes) { nodeId = !string.IsNullOrEmpty(subnode.GroupId) ? "Megamenu_" + subnode.GroupId + "_" + currentParagraphId : "Megamenu_Page_" + subnode.PageId.ToString() + "_" + currentParagraphId; dataType = !string.IsNullOrEmpty(subnode.GroupId) ? "group" : "page"; WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-4 col-xl-3 col-xxl-2\">\n"); 117 if (subnode.IsClickable) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); 118 WriteLiteral("<a id=\""); 119 Write(nodeId); 120 WriteLiteral("\" data-type=\""); 121 Write(dataType); 122 WriteLiteral("\" href=\""); 123 Write(subnode.Link); 124 WriteLiteral("\" class=\"nav-link px-0 text-decoration-underline-hover lh-sm text-break\">\n"); 125 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); 126 WriteLiteral("<div id=\""); 127 Write(nodeId); 128 WriteLiteral("\" data-type=\""); 129 Write(dataType); 130 WriteLiteral("\" class=\"nav-link px-0 lh-sm text-break\">\n"); 131 } if (productGroupImagePlacement != "none") { Dictionary<string, object> groupImageParams = GetGroupImageParams(); WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div"); 132 BeginWriteAttribute("class", " class=\"", 12071, "\"", 12135, 4); 133 WriteAttributeValue("", 12079, "d-flex", 12079, 6, true); 134 WriteAttributeValue(" ", 12085, productGroupImagePlacement, 12086, 27, false); 135 WriteAttributeValue(" ", 12113, imageAlignment, 12114, 15, false); 136 WriteAttributeValue(" ", 12129, "gap-3", 12130, 6, true); 137 EndWriteAttribute(); 138 WriteLiteral(">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); 139 Write(RenderPartial("Navigation/MegaMenu/GroupImage.cshtml", subnode, groupImageParams)); 140 WriteLiteral("\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h6"); 141 BeginWriteAttribute("class", " class=\"", 12256, "\"", 12357, 5); 142 WriteAttributeValue("", 12264, "m-0", 12264, 3, true); 143 WriteAttributeValue(" ", 12267, "w-100", 12268, 6, true); 144 WriteAttributeValue(" ", 12273, dropdownLinkHeaderFontWeight, 12274, 29, false); 145 WriteAttributeValue(" ", 12303, dropdownLinkHeaderCasing, 12304, 25, false); 146 WriteAttributeValue(" ", 12329, dropdownLinkHeaderFontSize, 12330, 27, false); 147 EndWriteAttribute(); 148 WriteLiteral(">"); 149 Write(subnode.Name); 150 WriteLiteral("</h6>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n"); 151 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h6"); 152 BeginWriteAttribute("class", " class=\"", 12469, "\"", 12564, 4); 153 WriteAttributeValue("", 12477, "m-0", 12477, 3, true); 154 WriteAttributeValue(" ", 12480, dropdownLinkHeaderFontWeight, 12481, 29, false); 155 WriteAttributeValue(" ", 12510, dropdownLinkHeaderCasing, 12511, 25, false); 156 WriteAttributeValue(" ", 12536, dropdownLinkHeaderFontSize, 12537, 27, false); 157 EndWriteAttribute(); 158 WriteLiteral(">"); 159 Write(subnode.Name); 160 WriteLiteral("</h6>\n"); 161 } WriteLiteral("\n"); 162 if (subnode.IsClickable) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); 163 WriteLiteral("</a>\n"); 164 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); 165 WriteLiteral("</div>\n"); 166 } WriteLiteral("\n"); 167 if (subnode.Nodes.Any()) { foreach (var subsubnode in subnode.Nodes) { nodeId = !string.IsNullOrEmpty(subsubnode.GroupId) ? "Megamenu_" + subsubnode.GroupId + "_" + currentParagraphId : "Megamenu_Page_" + subsubnode.PageId.ToString() + "_" + currentParagraphId; dataType = !string.IsNullOrEmpty(subsubnode.GroupId) ? "group" : "page"; if (subsubnode.IsClickable) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a class=\"nav-link px-0 text-decoration-underline-hover lh-sm text-break\""); 168 BeginWriteAttribute("href", " href=\"", 13419, "\"", 13442, 1); 169 WriteAttributeValue("", 13426, subsubnode.Link, 13426, 16, false); 170 EndWriteAttribute(); 171 WriteLiteral(" "); 172 Write(subnode.IsActive ? " aria-current='page'" : ""); 173 WriteLiteral(">\n"); 174 if (productGroupImagePlacement != "none") { Dictionary<string, object> groupImageParams = GetGroupImageParams(); WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div"); 175 BeginWriteAttribute("class", " class=\"", 13688, "\"", 13752, 4); 176 WriteAttributeValue("", 13696, "d-flex", 13696, 6, true); 177 WriteAttributeValue(" ", 13702, productGroupImagePlacement, 13703, 27, false); 178 WriteAttributeValue(" ", 13730, imageAlignment, 13731, 15, false); 179 WriteAttributeValue(" ", 13746, "gap-3", 13747, 6, true); 180 EndWriteAttribute(); 181 WriteLiteral(">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); 182 Write(RenderPartial("Navigation/MegaMenu/GroupImage.cshtml", subsubnode, groupImageParams)); 183 WriteLiteral("\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span"); 184 BeginWriteAttribute("class", " class=\"", 13886, "\"", 13965, 4); 185 WriteAttributeValue("", 13894, "w-100", 13894, 5, true); 186 WriteAttributeValue(" ", 13899, dropdownLinkFontWeight, 13900, 23, false); 187 WriteAttributeValue(" ", 13923, dropdownLinkCasing, 13924, 19, false); 188 WriteAttributeValue(" ", 13943, dropdownLinkFontSize, 13944, 21, false); 189 EndWriteAttribute(); 190 WriteLiteral(">"); 191 Write(subsubnode.Name); 192 WriteLiteral("</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n"); 193 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span"); 194 BeginWriteAttribute("class", " class=\"", 14104, "\"", 14177, 3); 195 WriteAttributeValue("", 14112, dropdownLinkFontWeight, 14112, 23, false); 196 WriteAttributeValue(" ", 14135, dropdownLinkCasing, 14136, 19, false); 197 WriteAttributeValue(" ", 14155, dropdownLinkFontSize, 14156, 21, false); 198 EndWriteAttribute(); 199 WriteLiteral(">"); 200 Write(subsubnode.Name); 201 WriteLiteral("</span>\n"); 202 } WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n"); 203 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"nav-link px-0 text-decoration-underline-hover lh-sm text-break\" "); 204 Write(subnode.IsActive ? " aria-current='page'" : ""); 205 WriteLiteral(">\n"); 206 if (productGroupImagePlacement != "none") { Dictionary<string, object> groupImageParams = GetGroupImageParams(); WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div"); 207 BeginWriteAttribute("class", " class=\"", 14639, "\"", 14703, 4); 208 WriteAttributeValue("", 14647, "d-flex", 14647, 6, true); 209 WriteAttributeValue(" ", 14653, productGroupImagePlacement, 14654, 27, false); 210 WriteAttributeValue(" ", 14681, imageAlignment, 14682, 15, false); 211 WriteAttributeValue(" ", 14697, "gap-3", 14698, 6, true); 212 EndWriteAttribute(); 213 WriteLiteral(">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); 214 Write(RenderPartial("Navigation/MegaMenu/GroupImage.cshtml", subsubnode, groupImageParams)); 215 WriteLiteral("\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span"); 216 BeginWriteAttribute("class", " class=\"", 14837, "\"", 14916, 4); 217 WriteAttributeValue("", 14845, "w-100", 14845, 5, true); 218 WriteAttributeValue(" ", 14850, dropdownLinkFontWeight, 14851, 23, false); 219 WriteAttributeValue(" ", 14874, dropdownLinkCasing, 14875, 19, false); 220 WriteAttributeValue(" ", 14894, dropdownLinkFontSize, 14895, 21, false); 221 EndWriteAttribute(); 222 WriteLiteral(">"); 223 Write(subsubnode.Name); 224 WriteLiteral("</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n"); 225 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span"); 226 BeginWriteAttribute("class", " class=\"", 15055, "\"", 15128, 3); 227 WriteAttributeValue("", 15063, dropdownLinkFontWeight, 15063, 23, false); 228 WriteAttributeValue(" ", 15086, dropdownLinkCasing, 15087, 19, false); 229 WriteAttributeValue(" ", 15106, dropdownLinkFontSize, 15107, 21, false); 230 EndWriteAttribute(); 231 WriteLiteral(">"); 232 Write(subsubnode.Name); 233 WriteLiteral("</span>\n"); 234 } WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n"); 235 } } } WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n"); 236 } WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"g-col-3 g-col-xxl-2\""); 237 BeginWriteAttribute("id", " id=\"", 15360, "\"", 15391, 2); 238 WriteAttributeValue("", 15365, "NavGroupPromotion", 15365, 17, true); 239 WriteAttributeValue("", 15382, nodeId, 15382, 9, false); 240 EndWriteAttribute(); 241 WriteLiteral(">\n"); 242 ProductGroupViewModel promotionImageGroup = node.GetProductGroup(); string link = node.Link; IList<FieldValueViewModel> promotionImageGroupFields = promotionImageGroup.GroupFields != null ? promotionImageGroup.GroupFields : null; if (promotionImageGroupFields != null) { var groupName = promotionImageGroup.Name; string ratio = Model.Parameters["ImageAspectRatio"].ToString(); ratio = ratio != "0" ? ratio : string.Empty; string ratioCssClass = ratio != string.Empty ? " ratio" : ""; string ratioVariable = ratio != "" ? "style=\"--bs-aspect-ratio: " + ratio + "\"" : string.Empty; string productGroupPromotionImage = string.Empty; string productGroupPromotionImageSrc = string.Empty; string productGroupPromotionImagePath = string.Empty; string productGroupPromotionDescription = string.Empty; string productGroupPromotionLinkLabel = string.Empty; string productGroupPromotionLink = string.Empty; string productGroupPromotionImageTheme = Model.Parameters.ContainsKey("ProductGroupPromotionImageTheme") ? Model.Parameters["ProductGroupPromotionImageTheme"].ToString().ToLower() : string.Empty; string gridGap = !string.IsNullOrEmpty(productGroupPromotionImageTheme) ? "gap-0" : "gap-3"; string themePadding = !string.IsNullOrEmpty(productGroupPromotionImageTheme) ? "p-3" : "p-0"; foreach (FieldValueViewModel field in promotionImageGroupFields) { if (field.SystemName == "GroupOverviewImage") { productGroupPromotionImage = field.Value != null ? field.Value.ToString() : string.Empty; productGroupPromotionImageSrc = Dynamicweb.Context.Current.Server.UrlEncode(GetImagePathSanitized(productGroupPromotionImage)); productGroupPromotionImagePath = $"/Admin/Public/GetImage.ashx?Image={productGroupPromotionImageSrc}&Width=480&Crop=0"; } if (field.SystemName == "ProductGroupPromotionDescription") { productGroupPromotionDescription = field.Value != null ? field.Value.ToString() : string.Empty; } if (field.SystemName == "ProductGroupPromotionLinkLabel") { productGroupPromotionLinkLabel = field.Value != null ? field.Value.ToString() : string.Empty; } if (field.SystemName == "ProductGroupPromotionLink") { productGroupPromotionLink = field.Value != null ? field.Value.ToString() : string.Empty; } } WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t<div"); 243 BeginWriteAttribute("class", " class=\"", 18167, "\"", 18229, 4); 244 WriteAttributeValue("", 18175, "grid", 18175, 4, true); 245 WriteAttributeValue(" ", 18179, "grid-1", 18180, 7, true); 246 WriteAttributeValue(" ", 18186, gridGap, 18187, 8, false); 247 WriteAttributeValue("", 18195, productGroupPromotionImageTheme, 18195, 34, false); 248 EndWriteAttribute(); 249 WriteLiteral(">\n"); 250 if (productGroupPromotionImage != string.Empty) { productGroupPromotionLink = !string.IsNullOrEmpty(productGroupPromotionLink) ? productGroupPromotionLink : link; WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a"); 251 BeginWriteAttribute("href", " href=\"", 18457, "\"", 18490, 1); 252 WriteAttributeValue("", 18464, productGroupPromotionLink, 18464, 26, false); 253 EndWriteAttribute(); 254 BeginWriteAttribute("title", " title=\"", 18491, "\"", 18509, 1); 255 WriteAttributeValue("", 18499, groupName, 18499, 10, false); 256 EndWriteAttribute(); 257 BeginWriteAttribute("id", " id=\"", 18510, "\"", 18567, 2); 258 WriteAttributeValue("", 18515, "NavGroupPromotionFigureLink", 18515, 27, true); 259 WriteAttributeValue("", 18542, promotionImageGroup.Id, 18542, 25, false); 260 EndWriteAttribute(); 261 WriteLiteral(">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<figure"); 262 BeginWriteAttribute("class", " class=\"", 18593, "\"", 18620, 2); 263 WriteAttributeValue("", 18601, "m-0", 18601, 3, true); 264 WriteAttributeValue("", 18604, ratioCssClass, 18604, 16, false); 265 EndWriteAttribute(); 266 WriteLiteral(" "); 267 Write(ratioVariable); 268 WriteLiteral(">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img class=\"img-fluid\""); 269 BeginWriteAttribute("src", " src=\"", 18677, "\"", 18714, 1); 270 WriteAttributeValue("", 18683, productGroupPromotionImagePath, 18683, 31, false); 271 EndWriteAttribute(); 272 BeginWriteAttribute("alt", " alt=\"", 18715, "\"", 18731, 1); 273 WriteAttributeValue("", 18721, groupName, 18721, 10, false); 274 EndWriteAttribute(); 275 WriteLiteral(" style=\"object-fit:cover\" loading=\"lazy\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</figure>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</a>\n"); 276 } if (!string.IsNullOrEmpty(productGroupPromotionDescription) || !string.IsNullOrEmpty(productGroupPromotionLinkLabel)) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div"); 277 BeginWriteAttribute("class", " class=\"", 19004, "\"", 19038, 4); 278 WriteAttributeValue("", 19012, "grid", 19012, 4, true); 279 WriteAttributeValue(" ", 19016, "grid-1", 19017, 7, true); 280 WriteAttributeValue(" ", 19023, themePadding, 19024, 13, false); 281 WriteAttributeValue(" ", 19037, "", 19038, 1, true); 282 EndWriteAttribute(); 283 WriteLiteral(">\n\n"); 284 if (!string.IsNullOrEmpty(productGroupPromotionDescription)) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h6 class=\"m-0\">"); 285 Write(productGroupPromotionDescription); 286 WriteLiteral("</h6>\n"); 287 } if (!string.IsNullOrEmpty(productGroupPromotionLinkLabel)) { productGroupPromotionLink = !string.IsNullOrEmpty(productGroupPromotionLink) ? productGroupPromotionLink : link; WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a"); 288 BeginWriteAttribute("href", " href=\"", 19472, "\"", 19505, 1); 289 WriteAttributeValue("", 19479, productGroupPromotionLink, 19479, 26, false); 290 EndWriteAttribute(); 291 BeginWriteAttribute("title", " title=\"", 19506, "\"", 19545, 1); 292 WriteAttributeValue("", 19514, productGroupPromotionLinkLabel, 19514, 31, false); 293 EndWriteAttribute(); 294 WriteLiteral(" class=\"btn btn-link text-start border-0 p-0\""); 295 BeginWriteAttribute("id", " id=\"", 19591, "\"", 19646, 2); 296 WriteAttributeValue("", 19596, "NavGroupPromotionTextLink", 19596, 25, true); 297 WriteAttributeValue("", 19621, promotionImageGroup.Id, 19621, 25, false); 298 EndWriteAttribute(); 299 WriteLiteral(">"); 300 Write(productGroupPromotionLinkLabel); 301 WriteLiteral("</a>\n"); 302 } WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n"); 303 } WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n"); 304 } WriteLiteral("\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n"); 305 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t<div"); 306 BeginWriteAttribute("class", " class=\"", 19870, "\"", 19913, 3); 307 WriteAttributeValue("", 19878, "d-flex", 19878, 6, true); 308 WriteAttributeValue(" ", 19884, "flex-wrap", 19885, 10, true); 309 WriteAttributeValue(" ", 19894, dropdownAlignment, 19895, 18, false); 310 EndWriteAttribute(); 311 WriteLiteral(">\n\n"); 312 foreach (var subnode in node.Nodes) { nodeId = !string.IsNullOrEmpty(subnode.GroupId) ? "Megamenu_" + subnode.GroupId + "_" + currentParagraphId : "Megamenu_Page_" + subnode.PageId.ToString() + "_" + currentParagraphId; dataType = !string.IsNullOrEmpty(subnode.GroupId) ? "group" : "page"; WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-4 col-xl-3 col-xxl-2\">\n\n"); 313 if (subnode.IsClickable) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t"); 314 WriteLiteral("<a id=\""); 315 Write(nodeId); 316 WriteLiteral("\" data-type=\""); 317 Write(dataType); 318 WriteLiteral("\" href=\""); 319 Write(subnode.Link); 320 WriteLiteral("\" class=\"nav-link px-0 text-decoration-underline-hover lh-sm text-break\">\n"); 321 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t"); 322 WriteLiteral("<div id=\""); 323 Write(nodeId); 324 WriteLiteral("\" data-type=\""); 325 Write(dataType); 326 WriteLiteral("\" class=\"nav-link px-0 lh-sm text-break\">\n"); 327 } WriteLiteral("\n"); 328 if (productGroupImagePlacement != "none") { Dictionary<string, object> groupImageParams = GetGroupImageParams(); WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t<div"); 329 BeginWriteAttribute("class", " class=\"", 20804, "\"", 20868, 4); 330 WriteAttributeValue("", 20812, "d-flex", 20812, 6, true); 331 WriteAttributeValue(" ", 20818, productGroupImagePlacement, 20819, 27, false); 332 WriteAttributeValue(" ", 20846, imageAlignment, 20847, 15, false); 333 WriteAttributeValue(" ", 20862, "gap-3", 20863, 6, true); 334 EndWriteAttribute(); 335 WriteLiteral(">\n"); 336 Write(RenderPartial("Navigation/MegaMenu/GroupImage.cshtml", subnode, groupImageParams)); 337 WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h6"); 338 BeginWriteAttribute("class", " class=\"", 20988, "\"", 21089, 5); 339 WriteAttributeValue("", 20996, "m-0", 20996, 3, true); 340 WriteAttributeValue(" ", 20999, "w-100", 21000, 6, true); 341 WriteAttributeValue(" ", 21005, dropdownLinkHeaderFontWeight, 21006, 29, false); 342 WriteAttributeValue(" ", 21035, dropdownLinkHeaderCasing, 21036, 25, false); 343 WriteAttributeValue(" ", 21061, dropdownLinkHeaderFontSize, 21062, 27, false); 344 EndWriteAttribute(); 345 WriteLiteral(">"); 346 Write(subnode.Name); 347 WriteLiteral("</h6>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n"); 348 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t<h6"); 349 BeginWriteAttribute("class", " class=\"", 21191, "\"", 21286, 4); 350 WriteAttributeValue("", 21199, "m-0", 21199, 3, true); 351 WriteAttributeValue(" ", 21202, dropdownLinkHeaderFontWeight, 21203, 29, false); 352 WriteAttributeValue(" ", 21232, dropdownLinkHeaderCasing, 21233, 25, false); 353 WriteAttributeValue(" ", 21258, dropdownLinkHeaderFontSize, 21259, 27, false); 354 EndWriteAttribute(); 355 WriteLiteral(">"); 356 Write(subnode.Name); 357 WriteLiteral("</h6>\n"); 358 } WriteLiteral("\n"); 359 if (subnode.IsClickable) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t"); 360 WriteLiteral("</a>\n"); 361 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t"); 362 WriteLiteral("</div>\n"); 363 } WriteLiteral("\n"); 364 if (subnode.Nodes.Any()) { foreach (var subsubnode in subnode.Nodes) { nodeId = !string.IsNullOrEmpty(subsubnode.GroupId) ? "Megamenu_" + subsubnode.GroupId + "_" + currentParagraphId : "Megamenu_Page_" + subsubnode.PageId.ToString() + "_" + currentParagraphId; dataType = !string.IsNullOrEmpty(subsubnode.GroupId) ? "group" : "page"; if (subsubnode.IsClickable) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); 365 WriteLiteral("<a id=\""); 366 Write(nodeId); 367 WriteLiteral("\" data-type=\""); 368 Write(dataType); 369 WriteLiteral("\" class=\"nav-link px-0 text-decoration-underline-hover lh-sm text-break\" href=\""); 370 Write(subsubnode.Link); 371 WriteLiteral("\" "); 372 Write(subnode.IsActive ? " aria-current='page'" : ""); 373 WriteLiteral(">\n"); 374 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); 375 WriteLiteral("<div id=\""); 376 Write(nodeId); 377 WriteLiteral("\" data-type=\""); 378 Write(dataType); 379 WriteLiteral("\" class=\"nav-link px-0 lh-sm text-break\" "); 380 Write(subnode.IsActive ? " aria-current='page'" : ""); 381 WriteLiteral(">\n"); 382 } if (productGroupImagePlacement != "none") { Dictionary<string, object> groupImageParams = GetGroupImageParams(); WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div"); 383 BeginWriteAttribute("class", " class=\"", 22505, "\"", 22569, 4); 384 WriteAttributeValue("", 22513, "d-flex", 22513, 6, true); 385 WriteAttributeValue(" ", 22519, productGroupImagePlacement, 22520, 27, false); 386 WriteAttributeValue(" ", 22547, imageAlignment, 22548, 15, false); 387 WriteAttributeValue(" ", 22563, "gap-3", 22564, 6, true); 388 EndWriteAttribute(); 389 WriteLiteral(">\n"); 390 Write(RenderPartial("Navigation/MegaMenu/GroupImage.cshtml", subsubnode, groupImageParams)); 391 WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span"); 392 BeginWriteAttribute("class", " class=\"", 22698, "\"", 22777, 4); 393 WriteAttributeValue("", 22706, "w-100", 22706, 5, true); 394 WriteAttributeValue(" ", 22711, dropdownLinkFontWeight, 22712, 23, false); 395 WriteAttributeValue(" ", 22735, dropdownLinkCasing, 22736, 19, false); 396 WriteAttributeValue(" ", 22755, dropdownLinkFontSize, 22756, 21, false); 397 EndWriteAttribute(); 398 WriteLiteral(">"); 399 Write(subsubnode.Name); 400 WriteLiteral("</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n"); 401 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span"); 402 BeginWriteAttribute("class", " class=\"", 22896, "\"", 22969, 3); 403 WriteAttributeValue("", 22904, dropdownLinkFontWeight, 22904, 23, false); 404 WriteAttributeValue(" ", 22927, dropdownLinkCasing, 22928, 19, false); 405 WriteAttributeValue(" ", 22947, dropdownLinkFontSize, 22948, 21, false); 406 EndWriteAttribute(); 407 WriteLiteral(">"); 408 Write(subsubnode.Name); 409 WriteLiteral("</span>\n"); 410 } if (subsubnode.IsClickable) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); 411 WriteLiteral("</a>\t\n"); 412 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"); 413 WriteLiteral("</div>\n"); 414 } } } WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t</div>\n"); 415 } WriteLiteral("\t\t\t\t\t\t\t\t\t\t</div>\n"); 416 } WriteLiteral("\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n"); 417 } else { WriteLiteral("\t\t\t\t\t\t\t\t<ul"); 418 BeginWriteAttribute("class", " class=\"", 23341, "\"", 23370, 2); 419 WriteAttributeValue("", 23349, "dropdown-menu", 23349, 13, true); 420 WriteAttributeValue("", 23362, theme, 23362, 8, false); 421 EndWriteAttribute(); 422 BeginWriteAttribute("aria-labelledby", " aria-labelledby=\"", 23371, "\"", 23396, 1); 423 WriteAttributeValue("", 23389, nodeId, 23389, 7, false); 424 EndWriteAttribute(); 425 WriteLiteral(">\n"); 426 if (pageType == "Swift_SignIn") { if (Pageview.User == null) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t<a"); 427 BeginWriteAttribute("href", " href=\"", 23531, "\"", 23548, 1); 428 WriteAttributeValue("", 23538, node.Link, 23538, 10, false); 429 EndWriteAttribute(); 430 BeginWriteAttribute("class", " class=\"", 23549, "\"", 23654, 7); 431 WriteAttributeValue("", 23557, "px-3", 23557, 4, true); 432 WriteAttributeValue(" ", 23561, "py-2", 23562, 5, true); 433 WriteAttributeValue(" ", 23566, "dropdown-item", 23567, 14, true); 434 WriteAttributeValue(" ", 23580, "text-decoration-underline-hover", 23581, 32, true); 435 WriteAttributeValue(" ", 23612, linkFontWeight, 23613, 15, false); 436 WriteAttributeValue(" ", 23628, linkCasing, 23629, 11, false); 437 WriteAttributeValue(" ", 23640, linkFontSize, 23641, 13, false); 438 EndWriteAttribute(); 439 WriteLiteral(" "); 440 Write(node.IsActive ? " aria-current='page'" : ""); 441 WriteLiteral(">"); 442 Write(node.Name); 443 WriteLiteral("</a>\n\t\t\t\t\t\t\t\t\t\t\t</li>\n"); 444 } } WriteLiteral("\n"); 445 foreach (var subnode in node.Nodes) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t<li>\n"); 446 if (subnode.IsClickable) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t<a"); 447 BeginWriteAttribute("class", " class=\"", 23895, "\"", 24000, 7); 448 WriteAttributeValue("", 23903, "px-3", 23903, 4, true); 449 WriteAttributeValue(" ", 23907, "py-2", 23908, 5, true); 450 WriteAttributeValue(" ", 23912, "dropdown-item", 23913, 14, true); 451 WriteAttributeValue(" ", 23926, "text-decoration-underline-hover", 23927, 32, true); 452 WriteAttributeValue(" ", 23958, linkFontWeight, 23959, 15, false); 453 WriteAttributeValue(" ", 23974, linkCasing, 23975, 11, false); 454 WriteAttributeValue(" ", 23986, linkFontSize, 23987, 13, false); 455 EndWriteAttribute(); 456 BeginWriteAttribute("href", " href=\"", 24001, "\"", 24021, 1); 457 WriteAttributeValue("", 24008, subnode.Link, 24008, 13, false); 458 EndWriteAttribute(); 459 WriteLiteral(" "); 460 Write(node.IsActive ? " aria-current='page'" : ""); 461 WriteLiteral(">"); 462 Write(subnode.Name); 463 WriteLiteral("</a>\n"); 464 } else { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t<span"); 465 BeginWriteAttribute("class", " class=\"", 24147, "\"", 24220, 6); 466 WriteAttributeValue("", 24155, "px-3", 24155, 4, true); 467 WriteAttributeValue(" ", 24159, "py-2", 24160, 5, true); 468 WriteAttributeValue(" ", 24164, "dropdown-item", 24165, 14, true); 469 WriteAttributeValue(" ", 24178, linkFontWeight, 24179, 15, false); 470 WriteAttributeValue(" ", 24194, linkCasing, 24195, 11, false); 471 WriteAttributeValue(" ", 24206, linkFontSize, 24207, 13, false); 472 EndWriteAttribute(); 473 WriteLiteral(" "); 474 Write(node.IsActive ? " aria-current='page'" : ""); 475 WriteLiteral(">"); 476 Write(subnode.Name); 477 WriteLiteral("</span>\n"); 478 } WriteLiteral("\t\t\t\t\t\t\t\t\t\t</li>\n"); 479 } WriteLiteral("\n"); 480 if (pageType == "Swift_SignIn") { if (Pageview.User != null) { string link = "/Admin/Public/ExtranetLogoff.aspx?redirect=no"; WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t<li><hr class=\"dropdown-divider\"></li>\n"); 481 if (Dynamicweb.Security.UserManagement.User.GetCurrentSecondaryUser() != null) { WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a"); 482 BeginWriteAttribute("href", " href=\"", 24694, "\"", 24763, 3); 483 WriteAttributeValue("", 24701, "Default.aspx?ID=", 24701, 16, true); 484 WriteAttributeValue("", 24717, Pageview.ID, 24717, 14, false); 485 WriteAttributeValue("", 24731, "&DwExtranetRemoveSecondaryUser=1", 24731, 32, true); 486 EndWriteAttribute(); 487 BeginWriteAttribute("class", " class=\"", 24764, "\"", 24901, 8); 488 WriteAttributeValue("", 24772, "px-3", 24772, 4, true); 489 WriteAttributeValue(" ", 24776, "py-2", 24777, 5, true); 490 WriteAttributeValue(" ", 24781, "dropdown-item", 24782, 14, true); 491 WriteAttributeValue(" ", 24795, "text-decoration-underline-hover", 24796, 32, true); 492 WriteAttributeValue(" ", 24827, "swift_sign-out-as-customer-link", 24828, 32, true); 493 WriteAttributeValue(" ", 24859, linkFontWeight, 24860, 15, false); 494 WriteAttributeValue(" ", 24875, linkCasing, 24876, 11, false); 495 WriteAttributeValue(" ", 24887, linkFontSize, 24888, 13, false); 496 EndWriteAttribute(); 497 WriteLiteral(" "); 498 Write(node.IsActive ? " aria-current='page'" : ""); 499 WriteLiteral(">"); 500 Write(Translate("Sign out as a customer")); 501 WriteLiteral("</a>\n\t\t\t\t\t\t\t\t\t\t\t\t</li>\n"); 502 } WriteLiteral("\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t<a"); 503 BeginWriteAttribute("href", " href=\"", 25052, "\"", 25064, 1); 504 WriteAttributeValue("", 25059, link, 25059, 5, false); 505 EndWriteAttribute(); 506 BeginWriteAttribute("class", " class=\"", 25065, "\"", 25190, 8); 507 WriteAttributeValue("", 25073, "px-3", 25073, 4, true); 508 WriteAttributeValue(" ", 25077, "py-2", 25078, 5, true); 509 WriteAttributeValue(" ", 25082, "dropdown-item", 25083, 14, true); 510 WriteAttributeValue(" ", 25096, "text-decoration-underline-hover", 25097, 32, true); 511 WriteAttributeValue(" ", 25128, "swift_sign-out-link", 25129, 20, true); 512 WriteAttributeValue(" ", 25148, linkFontWeight, 25149, 15, false); 513 WriteAttributeValue(" ", 25164, linkCasing, 25165, 11, false); 514 WriteAttributeValue(" ", 25176, linkFontSize, 25177, 13, false); 515 EndWriteAttribute(); 516 WriteLiteral(" "); 517 Write(node.IsActive ? " aria-current='page'" : ""); 518 WriteLiteral(">"); 519 Write(Translate("Sign out")); 520 WriteLiteral("</a>\n\t\t\t\t\t\t\t\t\t\t\t</li>\n"); 521 } } WriteLiteral("\t\t\t\t\t\t\t\t</ul>\n"); 522 } } WriteLiteral("\t\t\t</li>\n"); 523 } WriteLiteral("\t</ul>\n</nav>\n"); 524 } 525 #pragma warning restore 1998 526 string RenderNavigationItem(Dynamicweb.Frontend.Navigation.NavigationTreeNodeViewModel node, string pageType, string pageIcon, string iconSize, string layout) { var page = Dynamicweb.Content.Services.Pages.GetPage(node.PageId); string totalProductsRender = string.Empty; bool pageTypeSwiftCart = pageType == "Swift_Cart"; if(pageTypeSwiftCart) { string cartId = !string.IsNullOrEmpty(page.Item["ContextCart"].ToString()) ? $"ID=\"Cart_{page.Item["ContextCart"].ToString()}\"" : string.Empty; string jsCartClass = string.IsNullOrEmpty(cartId) ? "js-cart-qty" : string.Empty; double totalProducts = 0; Dynamicweb.Ecommerce.Common.Context.CartContext = null; if (page.Item["ContextCart"] != null) { var orderContext = Dynamicweb.Ecommerce.Services.OrderContexts.GetOrderContextById(page.Item["ContextCart"].ToString()); Dynamicweb.Ecommerce.Common.Context.CartContext = orderContext; } if (Dynamicweb.Ecommerce.Common.Context.Cart != null && pageTypeSwiftCart) { bool renderOrderlineCountInsteadOfProductCount = page.Item["RenderOrderlineCountInsteadOfProductCount"] != null ? Convert.ToBoolean(page.Item["RenderOrderlineCountInsteadOfProductCount"]) : false; if (!renderOrderlineCountInsteadOfProductCount) { totalProducts = Dynamicweb.Ecommerce.Common.Context.Cart.GetParentProductLineQuantityCount(Dynamicweb.Ecommerce.Common.Context.Cart.OrderLines); } else { foreach (var orderline in Dynamicweb.Ecommerce.Common.Context.Cart.OrderLines) { if (orderline.HasType(new[] { OrderLineType.Product, OrderLineType.Fixed, OrderLineType.PointProduct, OrderLineType.GiftCard })) { totalProducts++; } } totalProducts = Math.Round(totalProducts, 2); } } totalProductsRender = $"<span class=\"{jsCartClass} mini-cart-quantity pe-none\" {cartId} data-order-context=\"{page.Item["ContextCart"]}\">{totalProducts}</span>"; } bool iconValid = pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase); string iconPath = iconValid ? Dynamicweb.Context.Current.Server.MapPath(pageIcon) : string.Empty; string iconRender = iconValid ? $"<span class=\"{iconSize}\">{ReadFile(iconPath)}</span>" : string.Empty; string nameRender = $"<span class=\"text-wrap-nowrap\">{node.Name}</span>"; List<string> navigationItemBuilder = new List<string>(); navigationItemBuilder.Add(layout.ToLower().StartsWith("link") ? nameRender : iconRender); navigationItemBuilder.Add(totalProductsRender); navigationItemBuilder.Add(layout.ToLower().EndsWith("icons") ? iconRender : layout.ToLower().EndsWith("links") ? nameRender : string.Empty); return string.Join(" ", navigationItemBuilder); } Dictionary<string, object> GetGroupImageParams() { Dictionary<string, object> groupImageParams = new Dictionary<string, object>(); string productGroupImageShape = Model.Parameters["ProductGroupImageShape"] != null ? Model.Parameters["ProductGroupImageShape"].ToString() : string.Empty; string productGroupImageSize = Model.Parameters["ProductGroupImageSize"] != null ? Model.Parameters["ProductGroupImageSize"].ToString() : string.Empty; string ratio = productGroupImageSize.Contains("%") ? Model.Parameters["ProductGroupImageSize"].ToString() : string.Empty; groupImageParams.Add("ProductGroupImageShape", productGroupImageShape); groupImageParams.Add("ProductGroupImageSize", productGroupImageSize); groupImageParams.Add("Ratio", ratio); return groupImageParams; } public string GetImagePathSanitized(string imagePath) { if (!imagePath.StartsWith("/Files", StringComparison.OrdinalIgnoreCase)) { if (!imagePath.StartsWith("Files/", StringComparison.OrdinalIgnoreCase)) { imagePath = $"/Files/Images/{imagePath}"; } } return imagePath; } } 527 } 528 #pragma warning restore 1591 529
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.Navigation.NavigationTreeViewModel> @using Dynamicweb @using Dynamicweb.Ecommerce.Orders @using System.IO @using Dynamicweb.Ecommerce.ProductCatalog @using Dynamicweb.Ecommerce.Common @using System.Text @functions { string RenderNavigationItem(Dynamicweb.Frontend.Navigation.NavigationTreeNodeViewModel node, string pageType, string pageIcon, string iconSize, string layout) { var page = Dynamicweb.Content.Services.Pages.GetPage(node.PageId); string totalProductsRender = string.Empty; bool pageTypeSwiftCart = pageType == "Swift_Cart"; if(pageTypeSwiftCart) { string cartId = !string.IsNullOrEmpty(page.Item["ContextCart"].ToString()) ? $"ID=\"Cart_{page.Item["ContextCart"].ToString()}\"" : string.Empty; string jsCartClass = string.IsNullOrEmpty(cartId) ? "js-cart-qty" : string.Empty; double totalProducts = 0; Dynamicweb.Ecommerce.Common.Context.CartContext = null; if (page.Item["ContextCart"] != null) { var orderContext = Dynamicweb.Ecommerce.Services.OrderContexts.GetOrderContextById(page.Item["ContextCart"].ToString()); Dynamicweb.Ecommerce.Common.Context.CartContext = orderContext; } if (Dynamicweb.Ecommerce.Common.Context.Cart != null && pageTypeSwiftCart) { bool renderOrderlineCountInsteadOfProductCount = page.Item["RenderOrderlineCountInsteadOfProductCount"] != null ? Convert.ToBoolean(page.Item["RenderOrderlineCountInsteadOfProductCount"]) : false; if (!renderOrderlineCountInsteadOfProductCount) { totalProducts = Dynamicweb.Ecommerce.Common.Context.Cart.GetParentProductLineQuantityCount(Dynamicweb.Ecommerce.Common.Context.Cart.OrderLines); } else { foreach (var orderline in Dynamicweb.Ecommerce.Common.Context.Cart.OrderLines) { if (orderline.HasType(new[] { OrderLineType.Product, OrderLineType.Fixed, OrderLineType.PointProduct, OrderLineType.GiftCard })) { totalProducts++; } } totalProducts = Math.Round(totalProducts, 2); } } totalProductsRender = $"<span class=\"{jsCartClass} mini-cart-quantity pe-none\" {cartId} data-order-context=\"{page.Item["ContextCart"]}\">{totalProducts}</span>"; } bool iconValid = pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase); string iconPath = iconValid ? Dynamicweb.Context.Current.Server.MapPath(pageIcon) : string.Empty; string iconRender = iconValid ? $"<span class=\"{iconSize}\">{ReadFile(iconPath)}</span>" : string.Empty; string nameRender = $"<span class=\"text-wrap-nowrap\">{node.Name}</span>"; List<string> navigationItemBuilder = new List<string>(); navigationItemBuilder.Add(layout.ToLower().StartsWith("link") ? nameRender : iconRender); navigationItemBuilder.Add(totalProductsRender); navigationItemBuilder.Add(layout.ToLower().EndsWith("icons") ? iconRender : layout.ToLower().EndsWith("links") ? nameRender : string.Empty); return string.Join(" ", navigationItemBuilder); } Dictionary<string, object> GetGroupImageParams() { Dictionary<string, object> groupImageParams = new Dictionary<string, object>(); string productGroupImageShape = Model.Parameters["ProductGroupImageShape"] != null ? Model.Parameters["ProductGroupImageShape"].ToString() : string.Empty; string productGroupImageSize = Model.Parameters["ProductGroupImageSize"] != null ? Model.Parameters["ProductGroupImageSize"].ToString() : string.Empty; string ratio = productGroupImageSize.Contains("%") ? Model.Parameters["ProductGroupImageSize"].ToString() : string.Empty; groupImageParams.Add("ProductGroupImageShape", productGroupImageShape); groupImageParams.Add("ProductGroupImageSize", productGroupImageSize); groupImageParams.Add("Ratio", ratio); return groupImageParams; } public string GetImagePathSanitized(string imagePath) { if (!imagePath.StartsWith("/Files", StringComparison.OrdinalIgnoreCase)) { if (!imagePath.StartsWith("Files/", StringComparison.OrdinalIgnoreCase)) { imagePath = $"/Files/Images/{imagePath}"; } } return imagePath; } } @{ string theme = !string.IsNullOrEmpty(Model.Parameters["theme"].ToString()) ? Model.Parameters["theme"].ToString() : string.Empty; string navAlignment = !string.IsNullOrEmpty(Model.Parameters["NavAlignment"].ToString()) ? Model.Parameters["NavAlignment"].ToString() : string.Empty; string linkFontWeight = !string.IsNullOrEmpty(Model.Parameters["LinkFontWeight"].ToString()) ? Model.Parameters["LinkFontWeight"].ToString() : string.Empty; string linkCasing = !string.IsNullOrEmpty(Model.Parameters["LinkCasing"].ToString()) ? Model.Parameters["LinkCasing"].ToString() : string.Empty; string linkFontSize = !string.IsNullOrEmpty(Model.Parameters["LinkFontSize"].ToString()) ? Model.Parameters["LinkFontSize"].ToString() : string.Empty; string layout = !string.IsNullOrEmpty(Model.Parameters["Layout"].ToString()) ? Model.Parameters["Layout"].ToString() : string.Empty; string iconSize = "icon-3"; if (linkFontSize == "fs-7") { iconSize = "icon-2"; } if (linkFontSize == "fs-5") { iconSize = "icon-4"; } string dropdownAlignment = Model.Parameters["DropdownAlignment"] != null ? Model.Parameters["DropdownAlignment"].ToString() : string.Empty; string dropdownLinkHeaderFontWeight = Model.Parameters["DropdownLinkHeaderFontWeight"] != null ? Model.Parameters["DropdownLinkHeaderFontWeight"].ToString() : string.Empty; string dropdownLinkHeaderCasing = Model.Parameters["DropdownLinkHeaderCasing"] != null ? Model.Parameters["DropdownLinkHeaderCasing"].ToString() : string.Empty; string dropdownLinkHeaderFontSize = Model.Parameters["DropdownLinkHeaderFontSize"] != null ? Model.Parameters["DropdownLinkHeaderFontSize"].ToString() : string.Empty; string dropdownLinkFontWeight = Model.Parameters["DropdownLinkFontWeight"] != null ? Model.Parameters["DropdownLinkFontWeight"].ToString() : string.Empty; string dropdownLinkCasing = Model.Parameters["DropdownLinkCasing"] != null ? Model.Parameters["DropdownLinkCasing"].ToString() : string.Empty; string dropdownLinkFontSize = Model.Parameters["DropdownLinkFontSize"] != null ? Model.Parameters["DropdownLinkFontSize"].ToString() : string.Empty; string productGroupImagePlacement = Model.Parameters["ProductGroupImagePlacement"] != null ? Model.Parameters["ProductGroupImagePlacement"].ToString() : string.Empty; string imageAlignment = ""; imageAlignment = dropdownAlignment == "justify-content-start text-start" && productGroupImagePlacement == "flex-row" ? "align-items-center" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-start text-start" && productGroupImagePlacement == "flex-row-reverse" ? "align-items-center" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-start text-start" && productGroupImagePlacement == "flex-column" ? "align-items-start" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-center text-center" && productGroupImagePlacement == "flex-row" ? "align-items-center" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-center text-center" && productGroupImagePlacement == "flex-row-reverse" ? "align-items-center" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-center text-center" && productGroupImagePlacement == "flex-column" ? "align-items-center" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-end text-end" && productGroupImagePlacement == "flex-row" ? "align-items-center" : imageAlignment; imageAlignment = dropdownAlignment == "justify-content-end text-end" && productGroupImagePlacement == "flex-row-reverse" ? "align-items-center" : imageAlignment; bool showProductGroupPromotionImage = Model.Parameters.ContainsKey("ShowProductGroupPromotionImage") ? Convert.ToBoolean(Model.Parameters["ShowProductGroupPromotionImage"].ToString()) : false; string menuId = Model.Parameters.ContainsKey("menu-id") ? $"menu_{Model.Parameters["menu-id"].ToString().ToLower()}" : string.Empty; int currentParagraphId = Pageview.CurrentParagraph.ID; var area = Pageview.Page.Area; } <nav class="d-flex py-0 @navAlignment" t="@rootPageId"> <ul class="nav flex-nowrap @menuId"> @foreach (var node in Model.Nodes) { var page = Dynamicweb.Content.Services.Pages.GetPage(node.PageId); var pageType = !string.IsNullOrEmpty(page.ItemType) ? page.ItemType : "Swift_Page"; string submenuType = "auto"; if (page.PropertyItem is object && page.PropertyItem.TryGetValue("SubmenuType", out object submenuTypeValue)) { submenuType = Dynamicweb.Core.Converter.ToString(submenuTypeValue); } string pageIcon = string.Empty; if (page.PropertyItem is object && page.PropertyItem.TryGetValue("Icon", out object pageIconValue)) { pageIcon = Dynamicweb.Core.Converter.ToString(pageIconValue); } var hasChildren = node.Nodes.Count() > 0; string dropdownAttributes = hasChildren ? " role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\" data-bs-toggle=\"dropdown\" data-bs-offset=\"0,0\"" : ""; bool hasManyChildren = false; foreach (var subnode in node.Nodes) { if (subnode.Nodes.Any()) { hasManyChildren = true; } } submenuType = submenuType == "auto" && hasManyChildren ? "megamenu" : submenuType; submenuType = submenuType == "auto" && !hasManyChildren ? "dropdown" : submenuType; string submenuTypeCss = submenuType == "dropdown" ? " dropdown" : ""; submenuTypeCss = submenuType == "megamenu" ? " dropdown position-static" : submenuTypeCss; string nodeId = !string.IsNullOrEmpty(node.GroupId) ? "Megamenu_" + node.GroupId + "_" + currentParagraphId : "Megamenu_Page_" + node.PageId.ToString() + "_" + currentParagraphId; string dataType = !string.IsNullOrEmpty(node.GroupId) ? "group" : "page"; <li id="@(nodeId)" data-type="@dataType" class="nav-item@(node.IsActive ? " active" : "")@submenuTypeCss"> @if (node.IsClickable) { @:<a class="nav-link p-2 text-decoration-underline-hover @linkFontWeight @linkCasing @linkFontSize@(node.IsActive ? " active" : "")@(hasChildren ? " dropdown-toggle" : "")" href="@node.Link" @dropdownAttributes id="NavLink_@nodeId" t="@node.Level"> } else { @:<span class="nav-link p-2 @linkFontWeight @linkCasing @linkFontSize @dropdownAlignment@(hasChildren ? " dropdown-toggle" : "")" @dropdownAttributes id="NavLink_@nodeId"> } @RenderNavigationItem(node, pageType, pageIcon, iconSize, layout) @if (node.IsClickable) { @:</a> } else { @:</span> } @if (hasChildren) { if (submenuType == "megamenu") { <div class="dropdown-menu megamenu py-4@(theme)" aria-labelledby="@nodeId" id="NavGroup@(nodeId)"> <div class="container-xl overflow-y-auto"> @if (showProductGroupPromotionImage && !string.IsNullOrEmpty(node.GroupId)) { <div class="grid gap-4"> <div class="g-col-9 g-col-xxl-10"> <div class="d-flex flex-wrap gap-3 @dropdownAlignment"> @foreach (var subnode in node.Nodes) { nodeId = !string.IsNullOrEmpty(subnode.GroupId) ? "Megamenu_" + subnode.GroupId + "_" + currentParagraphId : "Megamenu_Page_" + subnode.PageId.ToString() + "_" + currentParagraphId; dataType = !string.IsNullOrEmpty(subnode.GroupId) ? "group" : "page"; <div class="col-4 col-xl-3 col-xxl-2"> @if (subnode.IsClickable) { @:<a id="@(nodeId)" data-type="@dataType" href="@subnode.Link" class="nav-link px-0 text-decoration-underline-hover lh-sm text-break"> } else { @:<div id="@(nodeId)" data-type="@dataType" class="nav-link px-0 lh-sm text-break"> } @if (productGroupImagePlacement != "none") { Dictionary<string, object> groupImageParams = GetGroupImageParams(); <div class="d-flex @productGroupImagePlacement @imageAlignment gap-3"> @RenderPartial("Navigation/MegaMenu/GroupImage.cshtml", subnode, groupImageParams) <h6 class="m-0 w-100 @dropdownLinkHeaderFontWeight @dropdownLinkHeaderCasing @dropdownLinkHeaderFontSize">@subnode.Name</h6> </div> } else { <h6 class="m-0 @dropdownLinkHeaderFontWeight @dropdownLinkHeaderCasing @dropdownLinkHeaderFontSize">@subnode.Name</h6> } @if (subnode.IsClickable) { @:</a> } else { @:</div> } @* copy paste group image og lav clickable løsning *@ @if (subnode.Nodes.Any()) { foreach (var subsubnode in subnode.Nodes) { nodeId = !string.IsNullOrEmpty(subsubnode.GroupId) ? "Megamenu_" + subsubnode.GroupId + "_" + currentParagraphId : "Megamenu_Page_" + subsubnode.PageId.ToString() + "_" + currentParagraphId; dataType = !string.IsNullOrEmpty(subsubnode.GroupId) ? "group" : "page"; if (subsubnode.IsClickable) { <a class="nav-link px-0 text-decoration-underline-hover lh-sm text-break" href="@subsubnode.Link" @(subnode.IsActive ? " aria-current='page'" : "")> @if (productGroupImagePlacement != "none") { Dictionary<string, object> groupImageParams = GetGroupImageParams(); <div class="d-flex @productGroupImagePlacement @imageAlignment gap-3"> @RenderPartial("Navigation/MegaMenu/GroupImage.cshtml", subsubnode, groupImageParams) <span class="w-100 @dropdownLinkFontWeight @dropdownLinkCasing @dropdownLinkFontSize">@subsubnode.Name</span> </div> } else { <span class="@dropdownLinkFontWeight @dropdownLinkCasing @dropdownLinkFontSize">@subsubnode.Name</span> } </a> } else { <div class="nav-link px-0 text-decoration-underline-hover lh-sm text-break" @(subnode.IsActive ? " aria-current='page'" : "")> @if (productGroupImagePlacement != "none") { Dictionary<string, object> groupImageParams = GetGroupImageParams(); <div class="d-flex @productGroupImagePlacement @imageAlignment gap-3"> @RenderPartial("Navigation/MegaMenu/GroupImage.cshtml", subsubnode, groupImageParams) <span class="w-100 @dropdownLinkFontWeight @dropdownLinkCasing @dropdownLinkFontSize">@subsubnode.Name</span> </div> } else { <span class="@dropdownLinkFontWeight @dropdownLinkCasing @dropdownLinkFontSize">@subsubnode.Name</span> } </div> } } } </div> } </div> </div> <div class="g-col-3 g-col-xxl-2" id="NavGroupPromotion@(nodeId)"> @{ ProductGroupViewModel promotionImageGroup = node.GetProductGroup(); string link = node.Link; IList<FieldValueViewModel> promotionImageGroupFields = promotionImageGroup.GroupFields != null ? promotionImageGroup.GroupFields : null; if (promotionImageGroupFields != null) { var groupName = promotionImageGroup.Name; string ratio = Model.Parameters["ImageAspectRatio"].ToString(); ratio = ratio != "0" ? ratio : string.Empty; string ratioCssClass = ratio != string.Empty ? " ratio" : ""; string ratioVariable = ratio != "" ? "style=\"--bs-aspect-ratio: " + ratio + "\"" : string.Empty; string productGroupPromotionImage = string.Empty; string productGroupPromotionImageSrc = string.Empty; string productGroupPromotionImagePath = string.Empty; string productGroupPromotionDescription = string.Empty; string productGroupPromotionLinkLabel = string.Empty; string productGroupPromotionLink = string.Empty; string productGroupPromotionImageTheme = Model.Parameters.ContainsKey("ProductGroupPromotionImageTheme") ? Model.Parameters["ProductGroupPromotionImageTheme"].ToString().ToLower() : string.Empty; string gridGap = !string.IsNullOrEmpty(productGroupPromotionImageTheme) ? "gap-0" : "gap-3"; string themePadding = !string.IsNullOrEmpty(productGroupPromotionImageTheme) ? "p-3" : "p-0"; foreach (FieldValueViewModel field in promotionImageGroupFields) { if (field.SystemName == "GroupOverviewImage") { productGroupPromotionImage = field.Value != null ? field.Value.ToString() : string.Empty; productGroupPromotionImageSrc = Dynamicweb.Context.Current.Server.UrlEncode(GetImagePathSanitized(productGroupPromotionImage)); productGroupPromotionImagePath = $"/Admin/Public/GetImage.ashx?Image={productGroupPromotionImageSrc}&Width=480&Crop=0"; } if (field.SystemName == "ProductGroupPromotionDescription") { productGroupPromotionDescription = field.Value != null ? field.Value.ToString() : string.Empty; } if (field.SystemName == "ProductGroupPromotionLinkLabel") { productGroupPromotionLinkLabel = field.Value != null ? field.Value.ToString() : string.Empty; } if (field.SystemName == "ProductGroupPromotionLink") { productGroupPromotionLink = field.Value != null ? field.Value.ToString() : string.Empty; } } <div class="grid grid-1 @gridGap@(productGroupPromotionImageTheme)"> @if (productGroupPromotionImage != string.Empty) { productGroupPromotionLink = !string.IsNullOrEmpty(productGroupPromotionLink) ? productGroupPromotionLink : link; <a href="@productGroupPromotionLink" title="@groupName" id="NavGroupPromotionFigureLink@(promotionImageGroup.Id)"> <figure class="m-0@(ratioCssClass)" @ratioVariable> <img class="img-fluid" src="@productGroupPromotionImagePath" alt="@groupName" style="object-fit:cover" loading="lazy"> </figure> </a> } @if (!string.IsNullOrEmpty(productGroupPromotionDescription) || !string.IsNullOrEmpty(productGroupPromotionLinkLabel)) { <div class="grid grid-1 @themePadding "> @if (!string.IsNullOrEmpty(productGroupPromotionDescription)) { <h6 class="m-0">@productGroupPromotionDescription</h6> } @if (!string.IsNullOrEmpty(productGroupPromotionLinkLabel)) { productGroupPromotionLink = !string.IsNullOrEmpty(productGroupPromotionLink) ? productGroupPromotionLink : link; <a href="@productGroupPromotionLink" title="@productGroupPromotionLinkLabel" class="btn btn-link text-start border-0 p-0" id="NavGroupPromotionTextLink@(promotionImageGroup.Id)">@productGroupPromotionLinkLabel</a> } </div> } </div> } } </div> </div> } else { <div class="d-flex flex-wrap @dropdownAlignment"> @foreach (var subnode in node.Nodes) { nodeId = !string.IsNullOrEmpty(subnode.GroupId) ? "Megamenu_" + subnode.GroupId + "_" + currentParagraphId : "Megamenu_Page_" + subnode.PageId.ToString() + "_" + currentParagraphId; dataType = !string.IsNullOrEmpty(subnode.GroupId) ? "group" : "page"; <div class="col-4 col-xl-3 col-xxl-2"> @if (subnode.IsClickable) { @:<a id="@(nodeId)" data-type="@dataType" href="@subnode.Link" class="nav-link px-0 text-decoration-underline-hover lh-sm text-break"> } else { @:<div id="@(nodeId)" data-type="@dataType" class="nav-link px-0 lh-sm text-break"> } @if (productGroupImagePlacement != "none") { Dictionary<string, object> groupImageParams = GetGroupImageParams(); <div class="d-flex @productGroupImagePlacement @imageAlignment gap-3"> @{@RenderPartial("Navigation/MegaMenu/GroupImage.cshtml", subnode, groupImageParams)} <h6 class="m-0 w-100 @dropdownLinkHeaderFontWeight @dropdownLinkHeaderCasing @dropdownLinkHeaderFontSize">@subnode.Name</h6> </div> } else { <h6 class="m-0 @dropdownLinkHeaderFontWeight @dropdownLinkHeaderCasing @dropdownLinkHeaderFontSize">@subnode.Name</h6> } @if (subnode.IsClickable) { @:</a> } else { @:</div> } @if (subnode.Nodes.Any()) { foreach (var subsubnode in subnode.Nodes) { nodeId = !string.IsNullOrEmpty(subsubnode.GroupId) ? "Megamenu_" + subsubnode.GroupId + "_" + currentParagraphId : "Megamenu_Page_" + subsubnode.PageId.ToString() + "_" + currentParagraphId; dataType = !string.IsNullOrEmpty(subsubnode.GroupId) ? "group" : "page"; if (subsubnode.IsClickable) { @:<a id="@(nodeId)" data-type="@dataType" class="nav-link px-0 text-decoration-underline-hover lh-sm text-break" href="@subsubnode.Link" @(subnode.IsActive ? " aria-current='page'" : "")> } else { @:<div id="@(nodeId)" data-type="@dataType" class="nav-link px-0 lh-sm text-break" @(subnode.IsActive ? " aria-current='page'" : "")> } if (productGroupImagePlacement != "none") { Dictionary<string, object> groupImageParams = GetGroupImageParams(); <div class="d-flex @productGroupImagePlacement @imageAlignment gap-3"> @{@RenderPartial("Navigation/MegaMenu/GroupImage.cshtml", subsubnode, groupImageParams)} <span class="w-100 @dropdownLinkFontWeight @dropdownLinkCasing @dropdownLinkFontSize">@subsubnode.Name</span> </div> } else { <span class="@dropdownLinkFontWeight @dropdownLinkCasing @dropdownLinkFontSize">@subsubnode.Name</span> } if (subsubnode.IsClickable) { @:</a> } else { @:</div> } } } </div> } </div> } </div> </div> } else { <ul class="dropdown-menu@(theme)" aria-labelledby="@nodeId"> @if (pageType == "Swift_SignIn") { if (Pageview.User == null) { <li> <a href="@node.Link" class="px-3 py-2 dropdown-item text-decoration-underline-hover @linkFontWeight @linkCasing @linkFontSize" @(node.IsActive ? " aria-current='page'" : "")>@node.Name</a> </li> } } @foreach (var subnode in node.Nodes) { <li> @if (subnode.IsClickable) { <a class="px-3 py-2 dropdown-item text-decoration-underline-hover @linkFontWeight @linkCasing @linkFontSize" href="@subnode.Link" @(node.IsActive ? " aria-current='page'" : "")>@subnode.Name</a> } else { <span class="px-3 py-2 dropdown-item @linkFontWeight @linkCasing @linkFontSize" @(node.IsActive ? " aria-current='page'" : "")>@subnode.Name</span> } </li> } @if (pageType == "Swift_SignIn") { if (Pageview.User != null) { string link = "/Admin/Public/ExtranetLogoff.aspx?redirect=no"; <li><hr class="dropdown-divider"></li> if (Dynamicweb.Security.UserManagement.User.GetCurrentSecondaryUser() != null) { <li> <a href="Default.aspx?ID=@(Pageview.ID)&DwExtranetRemoveSecondaryUser=1" class="px-3 py-2 dropdown-item text-decoration-underline-hover swift_sign-out-as-customer-link @linkFontWeight @linkCasing @linkFontSize" @(node.IsActive ? " aria-current='page'" : "")>@Translate("Sign out as a customer")</a> </li> } <li> <a href="@link" class="px-3 py-2 dropdown-item text-decoration-underline-hover swift_sign-out-link @linkFontWeight @linkCasing @linkFontSize" @(node.IsActive ? " aria-current='page'" : "")>@Translate("Sign out")</a> </li> } } </ul> } } </li> } </ul> </nav>