Error executing template "Designs/Swift/Navigation/Navigation.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 CompiledRazorTemplates.Dynamic.RazorEngine_295b719ae856446ea919bbe63f7aa299.Execute() in F:\Domains\Sites\uat-hos.mydwsite.com\Files\Templates\Designs\Swift\Navigation\Navigation.cshtml:line 31 at 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 Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.Navigation.NavigationTreeViewModel> 2 @using Dynamicweb 3 @using Dynamicweb.Ecommerce.Orders 4 @using System.Text.RegularExpressions 5 6 @{ 7 string theme = !string.IsNullOrEmpty(Model.Parameters["Theme"].ToString()) ? Model.Parameters["Theme"].ToString() : string.Empty; 8 string navOrientation = !string.IsNullOrEmpty(Model.Parameters["NavOrientation"].ToString()) ? Model.Parameters["NavOrientation"].ToString() : string.Empty; 9 string navAlignment = !string.IsNullOrEmpty(Model.Parameters["NavAlignment"].ToString()) ? Model.Parameters["NavAlignment"].ToString() : string.Empty; 10 string linkFontWeight = !string.IsNullOrEmpty(Model.Parameters["LinkFontWeight"].ToString()) ? Model.Parameters["LinkFontWeight"].ToString() : string.Empty; 11 string linkCasing = !string.IsNullOrEmpty(Model.Parameters["LinkCasing"].ToString()) ? Model.Parameters["LinkCasing"].ToString() : string.Empty; 12 string linkFontSize = !string.IsNullOrEmpty(Model.Parameters["LinkFontSize"].ToString()) ? Model.Parameters["LinkFontSize"].ToString() : string.Empty; 13 string layout = !string.IsNullOrEmpty(Model.Parameters["Layout"].ToString()) ? Model.Parameters["Layout"].ToString() : string.Empty; 14 string iconSize = linkFontSize == "fs-7" ? "icon-2" : "icon-3"; 15 iconSize = linkFontSize == "fs-5" ? "icon-4" : iconSize; 16 17 int currentParagraphId = Pageview.CurrentParagraph.ID; 18 19 bool showOnlyFirstNavLevel = Model.Parameters.ContainsKey("ShowOnlyFirstNavLevel") ? Convert.ToBoolean(Model.Parameters["ShowOnlyFirstNavLevel"].ToString()) : false; 20 string menuId = Model.Parameters.ContainsKey("menu-id") ? $"menu_{Model.Parameters["menu-id"].ToString().ToLower()}" : string.Empty; 21 22 string groupId = Dynamicweb.Context.Current.Request["GroupID"] != null ? Dynamicweb.Context.Current.Request["GroupID"].ToString() : string.Empty; 23 string productId = Dynamicweb.Context.Current.Request["ProductID"] != null ? Dynamicweb.Context.Current.Request["ProductID"].ToString() : string.Empty; 24 string variantId = Dynamicweb.Context.Current.Request["VariantID"] != null ? Dynamicweb.Context.Current.Request["VariantID"].ToString() : string.Empty; 25 26 string navItemVisuallyHidden = layout == "iconsOnly" ? "visually-hidden" : null; 27 } 28 29 <nav class="d-flex py-0 @navOrientation @navAlignment"> 30 <ul class="nav flex-nowrap @(navOrientation == "vertical" ? "flex-column" : navOrientation)"> 31 @foreach (var node in Model.Nodes) 32 { 33 var page = Dynamicweb.Content.Services.Pages.GetPage(node.PageId); 34 var pageType = !string.IsNullOrEmpty(page.ItemType) ? page.ItemType : "Swift_Page"; 35 string pageIcon = string.Empty; 36 if (page.PropertyItem is object && page.PropertyItem.TryGetValue("Icon", out object pageIconValue)) 37 { 38 pageIcon = Dynamicweb.Core.Converter.ToString(pageIconValue); 39 } 40 string iconPath = Dynamicweb.Context.Current.Server.MapPath(pageIcon); 41 42 string preferencesLayout = page.Item?["PreferencesLayout"] != null ? page.Item["PreferencesLayout"].ToString() : string.Empty; 43 string preferencesType = "language"; 44 45 bool countrySelector = page.Item?["CountrySelector"] != null ? Convert.ToBoolean(page.Item["CountrySelector"].ToString()) : false; 46 bool languageSelector = page.Item?["LanguageSelector"] != null ? Convert.ToBoolean(page.Item["LanguageSelector"].ToString()) : false; 47 bool currencySelector = page.Item?["CurrencySelector"] != null ? Convert.ToBoolean(page.Item["CurrencySelector"].ToString()) : false; 48 49 var hasChildren = node.Nodes.Count() > 0 || pageType == "Swift_SignIn"; 50 string nodeId = !string.IsNullOrEmpty(node.GroupId) ? "Navigation_" + node.GroupId + "_" + currentParagraphId : "Navigation_Page_Desktop_" + node.PageId.ToString() + "_" + currentParagraphId; 51 52 string dropdownAttributes = hasChildren && !showOnlyFirstNavLevel ? " role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\" data-bs-toggle=\"dropdown\" data-bs-offset=\"0,0\"" : string.Empty; 53 string dropdownClasses = string.Empty; 54 55 if (pageType != "Swift_Preferences") 56 { 57 <li class="nav-item@(hasChildren ? " dropdown" : string.Empty)"> 58 @if (node.IsClickable) 59 { 60 @:<a href="@node.Link" class="p-2 nav-link text-nowrap text-decoration-underline-hover @linkFontSize @linkFontWeight @linkCasing@(node.IsActive ? " active" : "")@(hasChildren ? " dropdown-toggle" : string.Empty)" @dropdownAttributes @(node.IsActive ? " aria-current='page'" : "") id="@nodeId"> 61 } 62 else 63 { 64 @:<span class="p-2 nav-link text-nowrap @linkFontSize @linkFontWeight @linkCasing@(hasChildren ? " dropdown-toggle " : string.Empty)" @dropdownAttributes id="@nodeId"> 65 } 66 67 @if (pageType == "Swift_Cart") //Mini cart 68 { 69 string cartId = page.Item["ContextCart"] != null && page.Item["ContextCart"] != string.Empty ? $"ID=\"Cart_{page.Item["ContextCart"].ToString()}\"" : string.Empty; 70 string jsCartClass = string.IsNullOrEmpty(cartId) ? "js-cart-qty" : string.Empty; 71 double totalProducts = 0; 72 73 Dynamicweb.Ecommerce.Common.Context.CartContext = null; 74 if (page.Item["ContextCart"] != null) 75 { 76 var orderContext = Dynamicweb.Ecommerce.Services.OrderContexts.GetOrderContextById(page.Item["ContextCart"].ToString()); 77 Dynamicweb.Ecommerce.Common.Context.CartContext = orderContext; 78 } 79 80 if (Dynamicweb.Ecommerce.Common.Context.Cart != null) 81 { 82 bool renderOrderlineCountInsteadOfProductCount = page.Item["RenderOrderlineCountInsteadOfProductCount"] != null ? Convert.ToBoolean(page.Item["RenderOrderlineCountInsteadOfProductCount"]) : false; 83 if (!renderOrderlineCountInsteadOfProductCount) 84 { 85 totalProducts = Dynamicweb.Ecommerce.Common.Context.Cart.GetParentProductLineQuantityCount(Dynamicweb.Ecommerce.Common.Context.Cart.OrderLines); 86 } 87 else 88 { 89 foreach (var orderline in Dynamicweb.Ecommerce.Common.Context.Cart.OrderLines) 90 { 91 if (orderline.HasType(new[] { OrderLineType.Product, OrderLineType.Fixed, OrderLineType.PointProduct, OrderLineType.GiftCard })) 92 { 93 totalProducts++; 94 } 95 } 96 97 totalProducts = Math.Round(totalProducts, 2); 98 } 99 } 100 101 if (layout == "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 102 { 103 <span class="@iconSize pe-none">@ReadFile(iconPath)</span> 104 } 105 106 <span class="@(navItemVisuallyHidden)">@node.Name</span> 107 <span class="@jsCartClass mini-cart-quantity pe-none" @cartId data-order-context="@page.Item["ContextCart"]">@totalProducts</span> 108 109 if (layout != "linksOnly" && layout != "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 110 { 111 <span class="@iconSize pe-none">@ReadFile(iconPath)</span> 112 } 113 } 114 else 115 { 116 if (layout == "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 117 { 118 <span class="@iconSize pe-none">@ReadFile(iconPath)</span> 119 } 120 121 <span class="@(navItemVisuallyHidden)">@node.Name</span> 122 123 if (layout != "linksOnly" && layout != "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 124 { 125 <span class="@iconSize pe-none">@ReadFile(iconPath)</span> 126 } 127 } 128 129 @if (node.IsClickable) 130 { 131 @:</a> 132 } 133 else 134 { 135 @:</span> 136 } 137 138 @if (hasChildren && !showOnlyFirstNavLevel) 139 { 140 <ul class="dropdown-menu @(theme)" aria-labelledby="@nodeId"> 141 @foreach (var subnode in node.Nodes)//Standard pages 142 { 143 nodeId = !string.IsNullOrEmpty(subnode.GroupId) ? "Navigation_" + subnode.GroupId + "_" + currentParagraphId : "Navigation_Page_" + subnode.PageId.ToString() + "_" + currentParagraphId; 144 145 <li> 146 @if (subnode.IsClickable) 147 { 148 <a href="@subnode.Link" class="dropdown-item py-2 text-decoration-underline-hover @linkFontSize @linkFontWeight @linkCasing" @(subnode.IsActive ? " aria-current='page'" : string.Empty) id="@nodeId">@subnode.Name</a> 149 } 150 else 151 { 152 <span class="dropdown-item py-2 @linkFontSize @linkFontWeight @linkCasing" @(subnode.IsActive ? " aria-current='page'" : string.Empty) id="@nodeId">@subnode.Name</span> 153 } 154 </li> 155 } 156 @if (pageType == "Swift_SignIn") //Sign out link 157 { 158 if (Pageview.User != null) 159 { 160 string signOutLink = "/Admin/Public/ExtranetLogoff.aspx?redirect=no"; 161 162 <li><hr class="dropdown-divider"></li> 163 if (Dynamicweb.Security.UserManagement.User.GetCurrentSecondaryUser() != null && Dna.AutoImpersonate.Helpers.AmountOfUserICanSetAsSecondary > 1) 164 { 165 int stopManagingPageId = GetPageIdByNavigationTag("Impersonation") != 0 ? GetPageIdByNavigationTag("Impersonation") : Pageview.ID; 166 <li> 167 <a href="Default.aspx?ID=@(stopManagingPageId)&DwExtranetRemoveSecondaryUser=1" class="dropdown-item py-2 text-decoration-underline-hover swift_sign-out-as-customer-link @linkFontSize @linkFontWeight @linkCasing" id="SignInButton_@currentParagraphId">@Translate("Stop managing")</a> 168 </li> 169 } 170 <li> 171 <a href="@signOutLink" class="dropdown-item py-2 text-decoration-underline-hover swift_sign-out-link @linkFontSize @linkFontWeight @linkCasing">@Translate("Sign out")</a> 172 </li> 173 } 174 } 175 </ul> 176 } 177 </li> 178 } 179 else 180 { 181 string name = node.Name; 182 183 if (preferencesLayout == "modal") 184 { 185 if (languageSelector) { 186 string iconFolder = "/Files/FlagIcons/"; 187 var region = new System.Globalization.RegionInfo(Pageview.Area.CultureInfo.LCID); 188 189 iconPath = $"{iconFolder}{region.Name}.svg"; 190 name = region.DisplayName; 191 } 192 193 <li class="nav-item@(hasChildren ? " dropdown" : string.Empty)"> 194 <form action="/Default.aspx?ID=@node.PageId" data-response-target-element="PreferencesModalContent" data-layout-template="Swift_Preferences.cshtml" data-preloader="inline"> 195 <input type="hidden" name="CurrentPageID" value="@Pageview.ID"> 196 <input type="hidden" name="GroupID" value="@groupId"> 197 <input type="hidden" name="ProductID" value="@productId"> 198 <input type="hidden" name="VariantID" value="@variantId"> 199 <button type="button" onmouseover="swift.PageUpdater.Update(event)" onclick="swift.PageUpdater.Update(event)" class="btn border-0 nav-link p-2 text-nowrap border-0 swift_open-preferences-modal @linkFontSize @linkFontWeight @linkCasing" data-bs-toggle="modal" data-bs-target="#PreferencesModal" id="OpenPreferences_@currentParagraphId"> 200 @if (layout == "iconsAndLinks" && iconPath.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !iconPath.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 201 { 202 <span class="@iconSize">@ReadFile(iconPath)</span> 203 } 204 205 <span class="@(navItemVisuallyHidden)">@name</span> 206 207 @if (layout != "linksOnly" && layout != "iconsAndLinks" && iconPath.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !iconPath.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 208 { 209 <span class="@iconSize">@ReadFile(iconPath)</span> 210 } 211 </button> 212 </form> 213 </li> 214 } 215 else 216 { 217 var ecomCountries = Dynamicweb.Ecommerce.Services.Countries.GetCountries(); 218 var currencies = Dynamicweb.Ecommerce.Services.Currencies.GetAllCurrencies(); 219 List<Dynamicweb.Content.Page> languages = new List<Dynamicweb.Content.Page>(); 220 221 if (languageSelector) 222 { 223 if (Pageview.Page.Area.IsMaster) 224 { 225 languages.Add(Pageview.Page); 226 if (Pageview.Page.Languages != null) 227 { 228 foreach (var language in Pageview.Page.Languages) 229 { 230 if (language.Area.Active == true) 231 { 232 languages.Add(language); 233 } 234 } 235 } 236 } 237 else 238 { 239 languages.Add(Pageview.Page.MasterPage); 240 if (Pageview.Page.MasterPage != null) 241 { 242 if (Pageview.Page.MasterPage.Languages != null) 243 { 244 foreach (var language in Pageview.Page.MasterPage.Languages) 245 { 246 if (language.Area.Active == true) 247 { 248 languages.Add(language); 249 } 250 } 251 } 252 } 253 } 254 } 255 256 if (languageSelector && languages.Count > 1) 257 { 258 string iconFolder = "/Files/FlagIcons/"; 259 pageIcon = iconFolder + Pageview.Area.CultureInfo.Name.ToLower() + ".svg"; 260 Regex reg = new Regex(@"\(([^\)]+)\)"); 261 name = reg.Replace(Pageview.Area.CultureInfo.DisplayName, ""); 262 263 string linkElementId = $"{preferencesType}Selector_{Pageview.CurrentParagraph.ID}_{node.PageId}"; 264 265 <li class="nav-item dropdown"> 266 <form class="d-none d-lg-block" action="/Default.aspx?ID=@node.PageId" data-response-target-element="@(preferencesType)Dropdown_@currentParagraphId" data-layout-template="Swift_Preferences.cshtml" data-preloader="inline"> 267 <input type="hidden" name="Type" value="@preferencesType"> 268 <input type="hidden" name="CurrentPageID" value="@Pageview.ID"> 269 <input type="hidden" name="GroupID" value="@groupId"> 270 <input type="hidden" name="ProductID" value="@productId"> 271 <input type="hidden" name="VariantID" value="@variantId"> 272 <input type="hidden" name="FontSize" value="@linkFontSize"> 273 <input type="hidden" name="FontWeight" value="@linkFontWeight"> 274 <input type="hidden" name="Casing" value="@linkCasing"> 275 276 <button type="button" id="@linkElementId" onmouseover="swift.PageUpdater.Update(event)" onclick="swift.PageUpdater.Update(event)" class="btn border-0 nav-link p-2 text-nowrap text-decoration-underline-hover @linkFontSize @linkFontWeight @linkCasing@(node.IsActive ? " active" : string.Empty) dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" @(node.IsActive ? " aria-current='page'" : string.Empty)> 277 @if (layout == "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 278 { 279 <span class="@iconSize">@ReadFile(pageIcon)</span> 280 } 281 282 <span class="@(navItemVisuallyHidden)">@name</span> 283 284 @if (layout != "linksOnly" && layout != "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 285 { 286 <span class="@iconSize">@ReadFile(pageIcon)</span> 287 } 288 </button> 289 290 <ul class="dropdown-menu @(theme)" id="@(preferencesType)Dropdown_@currentParagraphId"></ul> 291 </form> 292 293 <form class="d-block d-lg-none" action="/Default.aspx?ID=@node.PageId" data-response-target-element="PreferencesModalContent" data-layout-template="Swift_Preferences.cshtml" data-preloader="inline"> 294 <input type="hidden" name="Layout" value="modal"> 295 <input type="hidden" name="CurrentPageID" value="@Pageview.ID"> 296 <input type="hidden" name="GroupID" value="@groupId"> 297 <input type="hidden" name="ProductID" value="@productId"> 298 <input type="hidden" name="VariantID" value="@variantId"> 299 <button type="button" onmouseover="swift.PageUpdater.Update(event)" onclick="swift.PageUpdater.Update(event)" class="btn nav-link p-2 text-nowrap border-0 swift_open-preferences-modal @linkFontSize @linkFontWeight @linkCasing" data-bs-toggle="modal" data-bs-target="#PreferencesModal"> 300 @if (layout == "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 301 { 302 <span class="@iconSize">@ReadFile(iconPath)</span> 303 } 304 305 <span class="@(navItemVisuallyHidden)">@name</span> 306 307 @if (layout != "linksOnly" && layout != "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 308 { 309 <span class="@iconSize">@ReadFile(iconPath)</span> 310 } 311 </button> 312 </form> 313 </li> 314 } 315 316 if (countrySelector && ecomCountries.Count > 1) 317 { 318 name = Translate("Deliver to") + ": " + Dynamicweb.Ecommerce.Common.Context.Country.GetName(Dynamicweb.Ecommerce.Common.Context.LanguageID); 319 preferencesType = "country"; 320 321 string linkElementId = $"{preferencesType}Selector_{Pageview.CurrentParagraph.ID}_{node.PageId}"; 322 323 <li class="nav-item dropdown"> 324 <form class="d-none d-lg-block" action="/Default.aspx?ID=@node.PageId" data-response-target-element="@(preferencesType)Dropdown_@currentParagraphId" data-layout-template="Swift_Preferences.cshtml" data-preloader="inline"> 325 <input type="hidden" name="Type" value="@preferencesType"> 326 <input type="hidden" name="CurrentPageID" value="@Pageview.ID"> 327 <input type="hidden" name="GroupID" value="@groupId"> 328 <input type="hidden" name="ProductID" value="@productId"> 329 <input type="hidden" name="VariantID" value="@variantId"> 330 <input type="hidden" name="FontSize" value="@linkFontSize"> 331 <input type="hidden" name="FontWeight" value="@linkFontWeight"> 332 <input type="hidden" name="Casing" value="@linkCasing"> 333 334 <a id="@linkElementId" onmouseover="swift.PageUpdater.Update(event)" onclick="swift.PageUpdater.Update(event)" class="nav-link p-2 text-nowrap text-decoration-underline-hover @linkFontSize @linkFontWeight @linkCasing@(node.IsActive ? " active" : string.Empty) dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" @(node.IsActive ? " aria-current='page'" : string.Empty)> 335 @if (layout == "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 336 { 337 <span class="@iconSize">@ReadFile(iconPath)</span> 338 } 339 340 <span class="@(navItemVisuallyHidden)">@name</span> 341 342 @if (layout != "linksOnly" && layout != "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 343 { 344 <span class="@iconSize">@ReadFile(iconPath)</span> 345 } 346 </a> 347 348 <ul class="dropdown-menu @(theme)" id="@(preferencesType)Dropdown_@currentParagraphId"></ul> 349 </form> 350 351 <form class="d-block d-lg-none" action="/Default.aspx?ID=@node.PageId" data-response-target-element="PreferencesModalContent" data-layout-template="Swift_Preferences.cshtml" data-preloader="inline"> 352 <input type="hidden" name="Layout" value="modal"> 353 <input type="hidden" name="CurrentPageID" value="@Pageview.ID"> 354 <input type="hidden" name="GroupID" value="@groupId"> 355 <input type="hidden" name="ProductID" value="@productId"> 356 <input type="hidden" name="VariantID" value="@variantId"> 357 <button type="button" onmouseover="swift.PageUpdater.Update(event)" onclick="swift.PageUpdater.Update(event)" class="btn nav-link p-2 text-nowrap border-0 swift_open-preferences-modal @linkFontSize @linkFontWeight @linkCasing" data-bs-toggle="modal" data-bs-target="#PreferencesModal"> 358 @if (layout == "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 359 { 360 <span class="@iconSize">@ReadFile(iconPath)</span> 361 } 362 363 <span>@name</span> 364 365 @if (layout != "linksOnly" && layout != "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 366 { 367 <span class="@iconSize">@ReadFile(iconPath)</span> 368 } 369 </button> 370 </form> 371 </li> 372 } 373 374 if (currencySelector && currencies.Count() > 1) 375 { 376 name = Dynamicweb.Ecommerce.Common.Context.Currency.Code; 377 preferencesType = "currency"; 378 379 string linkElementId = $"{preferencesType}Selector_{Pageview.CurrentParagraph.ID}_{node.PageId}"; 380 381 <li class="nav-item dropdown"> 382 <form class="d-none d-lg-block" action="/Default.aspx?ID=@node.PageId" data-response-target-element="@(preferencesType)Dropdown_@currentParagraphId" data-layout-template="Swift_Preferences.cshtml" data-preloader="inline"> 383 <input type="hidden" name="Type" value="@preferencesType"> 384 <input type="hidden" name="CurrentPageID" value="@Pageview.ID"> 385 <input type="hidden" name="GroupID" value="@groupId"> 386 <input type="hidden" name="ProductID" value="@productId"> 387 <input type="hidden" name="VariantID" value="@variantId"> 388 <input type="hidden" name="FontSize" value="@linkFontSize"> 389 <input type="hidden" name="FontWeight" value="@linkFontWeight"> 390 <input type="hidden" name="Casing" value="@linkCasing"> 391 392 <a id="@linkElementId" onmouseover="swift.PageUpdater.Update(event)" onclick="swift.PageUpdater.Update(event)" class="nav-link p-2 text-nowrap text-decoration-underline-hover @linkFontSize @linkFontWeight @linkCasing@(node.IsActive ? " active" : string.Empty) dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" @(node.IsActive ? " aria-current='page'" : string.Empty)> 393 @if (layout == "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 394 { 395 <span class="@iconSize">@ReadFile(iconPath)</span> 396 } 397 398 <span class="@(navItemVisuallyHidden)">@name</span> 399 400 @if (layout != "linksOnly" && layout != "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 401 { 402 <span class="@iconSize">@ReadFile(iconPath)</span> 403 } 404 </a> 405 406 <ul class="dropdown-menu @(theme)" id="@(preferencesType)Dropdown_@currentParagraphId"></ul> 407 </form> 408 409 <form class="d-block d-lg-none" action="/Default.aspx?ID=@node.PageId" data-response-target-element="PreferencesModalContent" data-layout-template="Swift_Preferences.cshtml" data-preloader="inline"> 410 <input type="hidden" name="Layout" value="modal"> 411 <input type="hidden" name="CurrentPageID" value="@Pageview.ID"> 412 <input type="hidden" name="GroupID" value="@groupId"> 413 <input type="hidden" name="ProductID" value="@productId"> 414 <input type="hidden" name="VariantID" value="@variantId"> 415 <button type="button" onmouseover="swift.PageUpdater.Update(event)" onclick="swift.PageUpdater.Update(event)" class="btn nav-link p-2 text-nowrap border-0 swift_open-preferences-modal @linkFontSize @linkFontWeight @linkCasing" data-bs-toggle="modal" data-bs-target="#PreferencesModal"> 416 @if (layout == "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 417 { 418 <span class="@iconSize">@ReadFile(iconPath)</span> 419 } 420 421 <span>@name</span> 422 423 @if (layout != "linksOnly" && layout != "iconsAndLinks" && pageIcon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase) && !pageIcon.EndsWith("none.svg", StringComparison.OrdinalIgnoreCase)) 424 { 425 <span class="@iconSize">@ReadFile(iconPath)</span> 426 } 427 </button> 428 </form> 429 </li> 430 } 431 } 432 } 433 } 434 </ul> 435 </nav> 436
We and our partners use technologies, including cookies, to collect information about you for various purposes, including:
By clicking 'Accept All' you consent to all these purposes. You can also choose to indicate what purposes you will consent to using the custom selections and then click 'Accept selected'.
You can read more about our use of cookies and other technologies, as well as our collection and processing of personal data by clicking here:
Read more about Cookies Our privacy policy