Error executing template "Designs/Rapido/_parsed/Page.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_c0505f9969cb4b1f8c38757d69411611.Execute() in D:\DynamicWeb\Solutions\shop.famobra.com\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 831
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 3 @* Rapido version 2.1 *@ 4 5 @using Dynamicweb.Frontend 6 @using Dynamicweb.Frontend.Devices 7 @using Dynamicweb.Extensibility 8 @using Dynamicweb.Content 9 @using Dynamicweb.Security 10 @using Dynamicweb.Core 11 @using System 12 @using System.Linq 13 @using System.Web 14 @using System.IO 15 16 @functions { 17 string productsPageId; 18 string contentSearchPageId; 19 string resultPageId; 20 string searchFeedId; 21 string searchSecondFeedId; 22 string groupsFeedId; 23 string searchPlaceholder; 24 string searchType = "product-search"; 25 string searchTemplate; 26 string searchContentTemplate; 27 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") != null ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 28 string searchIcon; 29 bool showGroups = true; 30 } 31 @{ 32 string GoogleTagManagerID = Model.Area.Item.GetString("GoogleTagManagerID"); 33 //General settings 34 string favicon = Model.Area.Item.GetFile("LogoFavicon") != null ? Model.Area.Item.GetFile("LogoFavicon").PathUrlEncoded : "/Files/Images/favicon.png"; 35 string logo = Model.Area.Item.GetFile("LogoImage") != null ? Model.Area.Item.GetFile("LogoImage").PathUrlEncoded : "/Files/Images/logo-dynamicweb.png"; 36 string logoHeight = !String.IsNullOrEmpty(Model.Area.Item.GetString("LogoHeight")) ? Model.Area.Item.GetString("LogoHeight") : "40"; 37 logoHeight = logoHeight != "0" ? logoHeight : "40"; 38 if (Path.GetExtension(logo).ToLower() != ".svg") 39 { 40 logo = "/Admin/Public/GetImage.ashx?height=" + logoHeight + "&amp;crop=5&amp;Compression=75&amp;image=" + logo; 41 42 if (Pageview.Device.ToString() == "Mobile") 43 { 44 logoHeight = "40"; 45 } 46 } 47 string mobileLogo = Model.Area.Item.GetItem("MobileTopLayout").GetFile("MobileLayoutLogo") != null ? Model.Area.Item.GetItem("MobileTopLayout").GetFile("MobileLayoutLogo").PathUrlEncoded : "/Files/Images/logo-dynamicweb.png"; 48 if (Path.GetExtension(mobileLogo).ToLower() != ".svg") 49 { 50 mobileLogo = "/Admin/Public/GetImage.ashx?height=40&amp;crop=5&amp;Compression=75&amp;image=" + mobileLogo; 51 } 52 53 string wireframeMode = Model.Area.Item.GetBoolean("WireframeMode").ToString(); 54 55 var customSettings = Dynamicweb.Content.Items.Item.GetItemById("CustomWebsiteSettings", Pageview.Area.Item["CustomSettings"].ToString()); 56 var showPrices = Converter.ToBoolean(customSettings["ShowProductPrices"]); 57 if (string.IsNullOrWhiteSpace(Model.CurrentUser.CustomerNumber)) 58 { 59 showPrices = false; 60 } 61 62 //Font settings 63 string navigationFont = Model.Area.Item.GetItem("NavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 64 string mobileNavigationFont = Model.Area.Item.GetItem("MobileNavigationFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 65 string headerFont = Model.Area.Item.GetItem("ContentLayoutHeaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 66 string subHeaderFont = Model.Area.Item.GetItem("ContentLayoutSubheaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 67 string contentFont = Model.Area.Item.GetItem("ContentLayoutBodyText").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 68 string newStickersFont = Model.Area.Item.GetItem("NewStickersFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 69 string customStickersFont = Model.Area.Item.GetItem("CustomStickersFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 70 string toolsMenuFont = Model.Area.Item.GetItem("ToolsMenuFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 71 string productListPriceFont = Model.Area.Item.GetItem("ProductListGeneral").GetItem("PriceFontDesign").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 72 string productPagePriceFont = Model.Area.Item.GetItem("ProductDetails").GetItem("ProductDetailsPriceFontDesign").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 73 string facetsHeaderFont = Model.Area.Item.GetItem("ProductCatalogFacets").GetItem("FacetsHeaderFont").GetGoogleFont("FontFamily").Family.Replace(" ", "+"); 74 75 //Icons 76 string cartIcon = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Icons").GetList("CartIcon").SelectedValue) ? Model.Area.Item.GetItem("Icons").GetList("CartIcon").SelectedValue.ToLower() : "fas fa-shopping-cart"; 77 searchIcon = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Icons").GetList("SearchIcon").SelectedValue) ? Model.Area.Item.GetItem("Icons").GetList("SearchIcon").SelectedValue.ToLower() : "fas fa-search"; 78 79 80 //Page IDs for use in the template 81 int pageId = Model.TopPage.ID; 82 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 83 int cartPageId = GetPageIdByNavigationTag("CartPage"); 84 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 85 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 86 87 int impersonationPageId = GetPageIdByNavigationTag("Impersonation"); 88 89 bool stickyMenu = Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet" ? false : Model.Area.Item.GetBoolean("NavigationStickyMenu"); 90 string stickyTop = stickyMenu ? "top-container--sticky" : ""; 91 string pagePos = stickyMenu ? "js-page-pos" : ""; 92 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 93 string mobileTopLayout = !String.IsNullOrEmpty(Model.Area.Item.GetItem("MobileTopLayout").GetList("MobileLayoutTop").SelectedValue) ? Model.Area.Item.GetItem("MobileTopLayout").GetList("MobileLayoutTop").SelectedValue : "nav-left"; 94 string mobileNavigationPosition = mobileTopLayout == "nav-left" || mobileTopLayout == "nav-search-left" ? "left" : "right"; 95 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 96 string toolbarText = Model.Area.Item.GetString("ToolbarText"); 97 bool onlyPreview = Model.Area.Item.GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 98 99 string headerButtonText = Model.Area.Item.GetString("HeaderButtonText"); 100 string headerButtonLink = Model.Area.Item.GetString("HeaderButtonLink"); 101 string headerButtonType = "btn--" + Model.Area.Item.GetList("HeaderButtonType").SelectedName.ToLower(); 102 103 string autoCssLink = "/Files/Templates/Designs/Rapido/css/rapido/rapido_" + Model.Area.ID.ToString() + ".min.css?ticks=" + Model.Area.UpdatedDate.Ticks; 104 bool useFontAwesomePro = Model.Area.Item.GetItem("Icons").GetString("UseFontAwesomePro") != null ? Model.Area.Item.GetItem("Icons").GetBoolean("UseFontAwesomePro") : false; 105 106 string userInitials = ""; 107 if (Model.CurrentUser.ID != 0) 108 { 109 if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) 110 { 111 string[] names = Model.CurrentUser.Name.Split(' '); 112 userInitials += Model.CurrentUser.Name.Substring(0, 1); 113 114 if (names.Length > 1) 115 { 116 userInitials += names[names.Length - 1].Substring(0, 1); 117 } 118 } 119 else 120 { 121 userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; 122 userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; 123 userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; 124 userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; 125 userInitials += userInitials == "" ? Model.CurrentUser.UserName.Substring(0, 2) : ""; 126 } 127 } 128 129 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 130 string businessPhotoPath = Model.Area.Item.GetFile("BusinessPhoto") != null ? Model.Area.Item.GetFile("BusinessPhoto").PathUrlEncoded : ""; 131 string businessName = Model.Area.Item.GetString("BusinessName"); 132 string businessLogo = Model.Area.Item.GetFile("BusinessLogo") != null ? Model.Area.Item.GetFile("BusinessPhoto").Path : ""; 133 string openingHours = Model.Area.Item.GetString("OpeningHours"); 134 var address = Model.Area.Item.GetItem("Address"); 135 string streetAddress = ""; 136 string addressLocality = ""; 137 string addressRegion = ""; 138 string postalCode = ""; 139 string addressCountry = ""; 140 if (address != null) 141 { 142 streetAddress = address.GetString("StreetAddress"); 143 addressLocality = address.GetString("City"); 144 addressRegion = address.GetString("Region"); 145 postalCode = address.GetString("PostalCode"); 146 addressCountry = address.GetString("Country"); 147 } 148 string contactEmail = Model.Area.Item.GetString("ContactEmail"); 149 string contactNumber = Model.Area.Item.GetString("ContactNumber"); 150 151 productsPageId = Converter.ToString(GetPageIdByNavigationTag("ProductsPage")); 152 contentSearchPageId = Converter.ToString(GetPageIdByNavigationTag("ContentSearchResults")) + "&Areaid=" + Model.Area.ID; 153 154 if (Model.Area.Item.GetList("TopSearch").SelectedValue == "contentSearch") 155 { 156 searchFeedId = Converter.ToString(GetPageIdByNavigationTag("ContentSearchFeed")) + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 157 resultPageId = contentSearchPageId; 158 searchPlaceholder = Translate("Search page"); 159 groupsFeedId = "0"; 160 searchType = "content-search"; 161 searchTemplate = "SearchPagesTemplate"; 162 showGroups = false; 163 } 164 else if (Model.Area.Item.GetList("TopSearch").SelectedValue == "combinedSearch") 165 { 166 //data-search-second-feed-id 167 searchFeedId = productsPageId + "&feed=true"; 168 searchSecondFeedId = Converter.ToString(GetPageIdByNavigationTag("ContentSearchFeed")) + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 169 resultPageId = productsPageId; 170 searchPlaceholder = Translate("Search products or pages"); 171 groupsFeedId = Converter.ToString(GetPageIdByNavigationTag("ProductGroupsFeed")); 172 searchType = "combined-search"; 173 searchTemplate = "SearchProductsTemplateWrap"; 174 searchContentTemplate = "SearchPagesTemplateWrap"; 175 showGroups = Model.Area.Item.GetBoolean("ShowGroupsSelector"); 176 } 177 else 178 { 179 resultPageId = productsPageId; 180 searchFeedId = productsPageId + "&feed=true"; 181 groupsFeedId = Converter.ToString(GetPageIdByNavigationTag("ProductGroupsFeed")); 182 searchPlaceholder = Translate("Search products"); 183 searchTemplate = "SearchProductsTemplate"; 184 searchType = "product-search"; 185 showGroups = Model.Area.Item.GetBoolean("ShowGroupsSelector"); 186 } 187 } 188 <!DOCTYPE html> 189 190 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 191 <head> 192 <meta charset="utf-8" /> 193 <title>@Model.Title</title> 194 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> 195 <meta name="robots" content="index, follow"> 196 @Model.MetaTags 197 @if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 198 { 199 <!-- Google Tag Manager --> 200 <script> 201 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 202 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 203 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 204 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 205 })(window,document,'script','dataLayer','@GoogleTagManagerID'); 206 </script> 207 <!-- End Google Tag Manager --> 208 } 209 <!-- Favicon --> 210 <link href="@favicon" rel="icon" type="image/png"> 211 212 <!-- Font awesome --> 213 @if (useFontAwesomePro) 214 { 215 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/fonts/FontAwesomePro/css/fontawesome-all.min.css" type="text/css"> 216 } 217 else 218 { 219 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/fonts/FontAwesomeFree/css/fontawesome-all.min.css" type="text/css"> 220 } 221 222 <!-- Flag icon --> 223 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.1.0/css/flag-icon.min.css" type="text/css"> 224 225 <!-- Base (Default, wireframe) styles --> 226 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css" type="text/css"> 227 228 <!-- Rapido Css from Website Settings --> 229 <link id="rapidoCss" rel="stylesheet" href="@autoCssLink" type="text/css"> 230 231 <!-- Ignite Css (Custom site specific styles) --> 232 <link id="igniteCss" type="text/css" href="/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css" rel="stylesheet"> 233 234 <!-- Google fonts --> 235 @{ 236 var fonts = new string[11] { navigationFont, mobileNavigationFont, headerFont, subHeaderFont, contentFont, newStickersFont, customStickersFont, toolsMenuFont, productListPriceFont, productPagePriceFont, facetsHeaderFont }; 237 var family = string.Join("%7C", fonts.Distinct().Select(x => string.Format("{0}:100,200,300,400,500,600,700,800,900", x))); 238 } 239 <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet"> 240 241 @if (!string.IsNullOrEmpty(businessPhotoPath) && 242 !string.IsNullOrEmpty(businessName) && 243 !string.IsNullOrEmpty(streetAddress) && 244 !string.IsNullOrEmpty(addressLocality) && 245 !string.IsNullOrEmpty(addressRegion) && 246 !string.IsNullOrEmpty(postalCode) && 247 !string.IsNullOrEmpty(addressCountry)) 248 { 249 <script type="application/ld+json"> 250 { 251 "@@context": "http://schema.org", 252 "@@type": "Organization", 253 "name" : "@businessName", 254 "url": "@siteURL" 255 @if (Model.Area.Item.GetItems("FooterSocialLinks").Count > 0) 256 { 257 <text>,"sameAs" : [</text> 258 @(string.Join(",", Model.Area.Item.GetItems("FooterSocialLinks").Select(x => '"' + x.GetString("Link") + '"'))) 259 <text>]</text> 260 } 261 }, 262 { 263 "@@context": "http://schema.org", 264 "@@type": "LocalBusiness", 265 "image": [ 266 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 267 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 268 "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath" 269 ], 270 "@@id": "@siteURL", 271 "url": "@siteURL" 272 @if (!string.IsNullOrEmpty(openingHours)) 273 { 274 <text>,"openingHours": "@openingHours"</text> 275 } 276 @if (!string.IsNullOrEmpty(businessLogo)) 277 { 278 <text>,"logo": "@siteURL@businessLogo"</text> 279 } 280 ,"name": "@businessName", 281 "address": { 282 "@@type": "PostalAddress", 283 "streetAddress": "@streetAddress", 284 "addressLocality": "@addressLocality", 285 "addressRegion": "@addressRegion", 286 "postalCode": "@postalCode", 287 "addressCountry": "@addressCountry" 288 } 289 @if (!string.IsNullOrEmpty(contactEmail)) 290 { 291 <text>,"email": "@Model.Area.Item.GetString("ContactEmail")"</text> 292 } 293 @if (!string.IsNullOrEmpty(contactNumber)) 294 { 295 <text>,"telephone": "@Model.Area.Item.GetString("ContactNumber")"</text> 296 } 297 } 298 </script> 299 } 300 </head> 301 302 <body> 303 @if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 304 { 305 <!-- Google Tag Manager (noscript) --> 306 <noscript> 307 <iframe src="https://www.googletagmanager.com/ns.html?id=@GoogleTagManagerID" 308 height="0" width="0" style="display:none;visibility:hidden"></iframe> 309 </noscript> 310 <!-- End Google Tag Manager (noscript) --> 311 } 312 @MobileNavigation(userInitials, mobileNavigationPosition) 313 314 @LoginModal() 315 316 <main class="site dw-mod"> 317 <header class="top-container @stickyTop dw-mod" id="Top"> 318 @if (renderPagesInToolBar && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 319 { 320 <div class="tools-navigation dw-mod"> 321 <div class="center-container grid top-container__center-container dw-mod"> 322 <div class="grid__cell"> 323 <div class="u-pull--left u-margin-top">@toolbarText</div> 324 <div class="u-pull--right"> 325 @RenderNavigation(new 326 { 327 id = "topToolsNavigation", 328 cssclass = "menu menu-tools dw-mod dwnavigation", 329 template = "TopMenu.xslt" 330 }) 331 </div> 332 </div> 333 </div> 334 </div> 335 } 336 337 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 338 { 339 switch (topLayout) 340 { 341 case "condensed": //2 342 <!-- Main navigation --> 343 <nav class="main-navigation dw-mod"> 344 <div class="center-container top-container__center-container grid grid--align-center dw-mod"> 345 @RenderLogo(firstPageId, logo, businessName) 346 347 @* Navigation *@ 348 <div class="grid__col-auto grid__col--bleed u-reset-position"> 349 @RenderHeaderNavigation() 350 </div> 351 352 <ul class="menu dw-mod"> 353 @RenderSignIn("inNavigation", userInitials) 354 @RenderLanguageSelector() 355 @RenderFavorites() 356 @RenderMiniCart() 357 </ul> 358 @if (!string.IsNullOrWhiteSpace(headerButtonLink)) 359 { 360 <div class="u-margin-left u-inline-block"> 361 <a class="btn @headerButtonType dw-mod u-no-margin" href="@headerButtonLink">@headerButtonText</a> 362 </div> 363 } 364 </div> 365 </nav> 366 367 <!-- Searchbar --> 368 if (!Model.Area.Item.GetBoolean("NavigationItemsHideSearch")) 369 { 370 <div class="u-box-shadow u-color-light-gray--bg u-inline-block u-full-width"> 371 <div class="center-container top-container__center-container dw-mod"> 372 @RenderSearch() 373 </div> 374 </div> 375 } 376 377 break; 378 case "minimal": //4 379 case "minimal-right": //5 380 string alignClass = topLayout == "minimal-right" ? "grid--align-end" : ""; 381 382 <!-- Main navigation --> 383 <nav class="main-navigation dw-mod"> 384 <div class="center-container top-container__center-container grid grid--align-center dw-mod"> 385 @RenderLogo(firstPageId, logo, businessName) 386 387 @* Navigation *@ 388 <div class="grid__col-auto grid__col--bleed u-reset-position @alignClass"> 389 @RenderHeaderNavigation() 390 </div> 391 392 <ul class="menu dw-mod"> 393 @if (!Model.Area.Item.GetBoolean("NavigationItemsHideSearch")) 394 { 395 @RenderMiniSearch() 396 } 397 @RenderSignIn("inNavigation", userInitials) 398 @RenderLanguageSelector() 399 @RenderFavorites() 400 @RenderMiniCart() 401 </ul> 402 @if (!string.IsNullOrWhiteSpace(headerButtonLink)) 403 { 404 <div class="u-margin-left u-inline-block"> 405 <a class="btn @headerButtonType dw-mod u-no-margin" href="@headerButtonLink">@headerButtonText</a> 406 </div> 407 } 408 </div> 409 </nav> 410 break; 411 case "two-lines": //6 412 case "two-lines-centered": //7 413 string justifyClass = topLayout == "two-lines-centered" ? "grid--justify-center" : "grid--justify-space-between"; 414 415 <!-- Main navigation --> 416 <nav class="main-navigation dw-mod"> 417 <div class="center-container top-container__center-container grid @justifyClass dw-mod"> 418 <div class="grid__col--bleed grid--align-center"> 419 @RenderLogo(firstPageId, logo, businessName) 420 </div> 421 @* Navigation *@ 422 <div> 423 <div class="grid__cell u-reset-position"> 424 @RenderHeaderNavigation() 425 </div> 426 </div> 427 <div> 428 <div class="grid grid--align-center"> 429 <div class="grid__cell"> 430 <ul class="menu dw-mod"> 431 @if (!Model.Area.Item.GetBoolean("NavigationItemsHideSearch")) 432 { 433 @RenderMiniSearch() 434 } 435 @RenderSignIn("inNavigation", userInitials) 436 @RenderLanguageSelector() 437 @RenderFavorites() 438 @RenderMiniCart() 439 </ul> 440 </div> 441 @if (!string.IsNullOrWhiteSpace(headerButtonLink)) 442 { 443 <div class="u-margin-left u-inline-block grid__cell"> 444 <a class="btn @headerButtonType dw-mod u-no-margin" href="@headerButtonLink">@headerButtonText</a> 445 </div> 446 } 447 </div> 448 </div> 449 </div> 450 </nav> 451 break; 452 case "splitted": //3 453 <!-- Header --> 454 <div class="header header-top dw-mod"> 455 <div class="center-container top-container__center-container grid grid--align-center dw-mod"> 456 457 @* Logo *@ 458 @RenderLogo(firstPageId, logo, businessName) 459 460 @if (!Model.Area.Item.GetBoolean("NavigationItemsHideSearch")) 461 { 462 @* Search *@ 463 <div class="grid--align-end grid__col-auto grid__col--bleed"> 464 <div class="typeahead u-no-margin u-margin-top u-margin-bottom u-color-inherit js-typeahead" data-page-size="7" id="TopProductSearch" data-search-feed-id="@searchFeedId" data-search-second-feed-id="@searchSecondFeedId" data-result-page-id="@resultPageId" data-groups-page-id="@groupsFeedId" data-search-type="@searchType"> 465 @RenderSearch("right") 466 </div> 467 </div> 468 } 469 </div> 470 </div> 471 <!-- Main navigation --> 472 <nav class="main-navigation dw-mod"> 473 <div class="center-container top-container__center-container grid grid--align-center dw-mod"> 474 <div class="grid__col-auto grid__col--bleed u-reset-position"> 475 @RenderHeaderNavigation() 476 </div> 477 <ul class="menu dw-mod"> 478 @RenderSignIn("inNavigation", userInitials) 479 @RenderLanguageSelector() 480 @RenderFavorites() 481 @if (!onlyPreview) 482 { 483 @RenderMiniCart() 484 } 485 </ul> 486 @if (!string.IsNullOrWhiteSpace(headerButtonLink)) 487 { 488 <div class="u-margin-left u-inline-block"> 489 <a class="btn @headerButtonType dw-mod u-no-margin" href="@headerButtonLink">@headerButtonText</a> 490 </div> 491 } 492 </div> 493 </nav> 494 495 break; 496 case "normal": //1 497 default: 498 <!-- Header --> 499 <div class="header header-top dw-mod"> 500 <div class="center-container top-container__center-container grid grid--align-center dw-mod"> 501 @* Logo *@ 502 @RenderLogo(firstPageId, logo, businessName) 503 504 @if (!Model.Area.Item.GetBoolean("NavigationItemsHideSearch")) 505 { 506 @* Search *@ 507 <div class="grid__col-auto grid__col--bleed"> 508 @RenderSearch() 509 </div> 510 } 511 512 <ul class="menu dw-mod"> 513 @RenderSignIn("outsideNavigation", userInitials) 514 @RenderLanguageSelector("outsideNavigation") 515 @RenderFavorites("outsideNavigation") 516 @if (!onlyPreview) 517 { 518 @RenderMiniCart("outsideNavigation") 519 } 520 </ul> 521 522 @if (!string.IsNullOrWhiteSpace(headerButtonLink)) 523 { 524 <div class="u-margin-left u-inline-block"> 525 <a class="btn @headerButtonType dw-mod u-no-margin" href="@headerButtonLink">@headerButtonText</a> 526 </div> 527 } 528 </div> 529 </div> 530 531 <!-- Main navigation --> 532 <nav class="main-navigation dw-mod"> 533 <div class="center-container top-container__center-container grid dw-mod"> 534 <div> 535 @RenderHeaderNavigation() 536 </div> 537 </div> 538 </nav> 539 540 break; 541 } 542 } 543 else 544 { 545 string style = (topLayout == "normal" || topLayout == "splitted" ? "main-navigation--top-style" : "main-navigation--nav-style"); 546 547 switch (mobileTopLayout) 548 { 549 case "nav-left": 550 <nav class="main-navigation-mobile dw-mod"> 551 <div class="center-container top-container__center-container dw-mod"> 552 <div class="grid"> 553 @MobileNavigationTrigger() 554 555 <div class="logo u-middle dw-mod"> 556 <a href="/Default.aspx?ID=@firstPageId"> 557 <img class="grid__cell-img logo__img dw-mod" src="@mobileLogo" alt="@businessName" /> 558 </a> 559 </div> 560 561 <ul class="menu dw-mod u-pull--right"> 562 @if (!Model.Area.Item.GetBoolean("NavigationItemsHideSearch")) 563 { 564 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 565 <label for="MobileSearchTrigger" class="menu__link dw-mod"> 566 <i class="@searchIcon fa-1_5x"></i> 567 </label> 568 </li> 569 } 570 571 @if (!onlyPreview) 572 { 573 @RenderMiniCart() 574 } 575 </ul> 576 </div> 577 </div> 578 </nav> 579 break; 580 case "nav-right": 581 <nav class="main-navigation-mobile dw-mod"> 582 <div class="center-container top-container__center-container dw-mod"> 583 <div class="grid"> 584 <div class="logo u-middle dw-mod"> 585 <a href="/Default.aspx?ID=@firstPageId"> 586 <img class="grid__cell-img logo__img dw-mod" src="@mobileLogo" alt="@businessName" /> 587 </a> 588 </div> 589 590 <ul class="menu dw-mod u-pull--right"> 591 @if (!Model.Area.Item.GetBoolean("NavigationItemsHideSearch")) 592 { 593 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 594 <label for="MobileSearchTrigger" class="menu__link dw-mod"> 595 <i class="@searchIcon fa-1_5x"></i> 596 </label> 597 </li> 598 } 599 600 @if (!onlyPreview) 601 { 602 @RenderMiniCart() 603 } 604 </ul> 605 606 @MobileNavigationTrigger() 607 </div> 608 </div> 609 </nav> 610 break; 611 case "nav-search-left": 612 <nav class="main-navigation-mobile dw-mod"> 613 <div class="center-container top-container__center-container dw-mod"> 614 <div class="grid"> 615 @MobileNavigationTrigger() 616 617 @if (!Model.Area.Item.GetBoolean("NavigationItemsHideSearch")) 618 { 619 <ul class="menu dw-mod u-pull--right"> 620 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 621 <label for="MobileSearchTrigger" class="menu__link dw-mod"> 622 <i class="@searchIcon fa-1_5x"></i> 623 </label> 624 </li> 625 </ul> 626 } 627 628 <div class="logo u-middle dw-mod"> 629 <a href="/Default.aspx?ID=@firstPageId"> 630 <img class="grid__cell-img logo__img dw-mod" src="@mobileLogo" alt="@businessName" /> 631 </a> 632 </div> 633 634 @if (!onlyPreview) 635 { 636 <ul class="menu dw-mod u-pull--right"> 637 @RenderMiniCart() 638 </ul> 639 } 640 </div> 641 </div> 642 </nav> 643 break; 644 case "search-left": 645 <nav class="main-navigation-mobile dw-mod"> 646 <div class="center-container top-container__center-container dw-mod"> 647 <div class="grid"> 648 649 @if (!Model.Area.Item.GetBoolean("NavigationItemsHideSearch")) 650 { 651 <ul class="menu dw-mod u-pull--right"> 652 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 653 <label for="MobileSearchTrigger" class="menu__link dw-mod"> 654 <i class="@searchIcon fa-1_5x"></i> 655 </label> 656 </li> 657 </ul> 658 } 659 660 <div class="logo u-middle dw-mod"> 661 <a href="/Default.aspx?ID=@firstPageId"> 662 <img class="grid__cell-img logo__img dw-mod" src="@mobileLogo" alt="@businessName" /> 663 </a> 664 </div> 665 666 @if (!onlyPreview) 667 { 668 <ul class="menu dw-mod u-pull--right"> 669 @RenderMiniCart() 670 </ul> 671 } 672 673 @MobileNavigationTrigger() 674 </div> 675 </div> 676 </nav> 677 break; 678 } 679 680 @* Mobile search *@ 681 if (!Model.Area.Item.GetBoolean("NavigationItemsHideSearch")) 682 { 683 <input type="checkbox" id="MobileSearchTrigger" class="mobile-search-trigger" /> 684 685 <div class="main-navigation-mobile typeahead-mobile dw-mod"> 686 @if (mobileNavigationPosition == "left") 687 { 688 <div class="menu dw-mod u-pull--left"> 689 <div class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 690 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link dw-mod"></label> 691 </div> 692 </div> 693 } 694 else 695 { 696 <ul class="menu dw-mod u-pull--left"> 697 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 698 <label for="MobileSearchTrigger" class="menu__link dw-mod"> 699 <i class="fas fa-times fa-1_5x"></i> 700 </label> 701 </li> 702 </ul> 703 } 704 705 <div> 706 <div class="typeahead-mobile__search-field dw-mod js-typeahead" data-page-size="@(searchType == "combined-search" ? 4 : 8)" id="MobileProductSearch" data-search-feed-id="@searchFeedId" data-search-second-feed-id="@searchSecondFeedId" data-result-page-id="@resultPageId" data-search-type="@searchType"> 707 <input type="text" class="js-typeahead-search-field u-no-margin" placeholder="@searchPlaceholder" value="@searchValue"> 708 @if (string.IsNullOrEmpty(searchSecondFeedId)) 709 { 710 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod" id="MobileProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></ul> 711 } 712 else 713 { 714 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--combined-mobile grid"> 715 <div class="js-handlebars-root js-typeahead-search-content grid__col-sm-7 grid__col--bleed-y" id="MobileProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></div> 716 <div class="js-handlebars-root js-typeahead-additional-search-content grid__col-sm-5 grid__col--bleed-y" id="MobileContentSearchBarContent" data-template="@searchContentTemplate" data-json-feed="/Default.aspx?ID=@searchSecondFeedId" data-init-onload="false"></div> 717 </div> 718 } 719 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"><i class="@searchIcon"></i></button> 720 </div> 721 </div> 722 723 @if (mobileNavigationPosition == "right") 724 { 725 <div class="menu dw-mod u-pull--right"> 726 <div class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 727 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link dw-mod"></label> 728 </div> 729 </div> 730 } 731 else 732 { 733 <ul class="menu dw-mod u-pull--right"> 734 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 735 <label for="MobileSearchTrigger" class="menu__link dw-mod"> 736 <i class="fas fa-times fa-1_5x"></i> 737 </label> 738 </li> 739 </ul> 740 } 741 </div> 742 } 743 } 744 745 @* Impersonation bar *@ 746 @if (Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) 747 { 748 <div class="u-color-warning--bg"> 749 <div class="center-container top-container__center-container dw-mod"> 750 @*Impersonation*@ 751 <div class="grid"> 752 <div class="grid--align-self-center grid__col-x"> 753 @if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 754 { 755 string stopImpersonateTranslation = Translate("Stop impersonation"); 756 string username = ""; 757 if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) 758 { 759 username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; 760 } 761 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) 762 { 763 username = Model.CurrentSecondaryUser.Name; 764 } 765 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) 766 { 767 username = Model.CurrentSecondaryUser.Email; 768 } 769 else 770 { 771 username = Model.CurrentSecondaryUser.UserName; 772 } 773 <div class="grid-cell"> 774 <div class="u-pull--left u-bold u-margin-top"> 775 <i class="fas fa-user-secret"></i> 776 @username<text>&nbsp;</text>@Translate("is impersonating")<text>&nbsp;</text>@Pageview.User.UserName 777 </div> 778 <form method="post" class="u-pull--right u-no-margin"> 779 <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 780 </form> 781 </div> 782 } 783 else 784 { 785 string viewListTranslation = Translate("View the list of users you can impersonate"); 786 <div class="grid-cell u-bold"> 787 <i class="fas fa-user-secret"></i> 788 <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> 789 </div> 790 } 791 </div> 792 </div> 793 </div> 794 </div> 795 } 796 </header> 797 798 <!-- Floating mini cart --> 799 @if (!Model.Area.Item.GetBoolean("NavigationItemsHideCart")) 800 { 801 if (!onlyPreview && !stickyMenu && Converter.ToString(pageId) == productsPageId && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 802 { 803 <div class="floating-mini-cart u-hidden dw-mod" id="FloatingMiniCart"> 804 <div class="mini-cart dw-mod"> 805 <a href="/Default.aspx?ID=@cartPageId&Purge=True" class="menu-tools__link menu__link--condensed dw-mod js-mini-cart-button" onmouseover="Cart.UpdateMiniCart(event, 'SecondaryMiniCart', '/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart')"> 806 <i class="@cartIcon fa-4x"></i> 807 <div class="mini-cart__counter mini-cart__counter--lg dw-mod"> 808 <div class="js-handlebars-root js-mini-cart-counter" id="FloatingCartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-preloader="false" data-init-onload="false"> 809 <div class="js-mini-cart-counter-content"> 810 @Model.Cart.TotalProductsCount 811 </div> 812 </div> 813 </div> 814 </a> 815 816 <div class="mini-cart-dropdown js-handlebars-root js-mini-cart dw-mod" id="SecondaryMiniCart" data-template="MiniCartContent" data-cart-id="@miniCartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 817 </div> 818 </div> 819 } 820 } 821 822 <!-- Render the content --> 823 <div id="Page" class="page @pagePos"> 824 <section class="center-container content-container dw-mod" id="content"> 825 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 826 827 828 @{ 829 string columnClass = "12"; 830 bool isProductPage = HttpContext.Current.Request.QueryString.Get("ProductID") != null ? true : false; 831 string backgroundColorClass = Model.PropertyItem.GetString("BackgroundColor") != null && !isProductPage ? "u-" + Model.PropertyItem.GetList("BackgroundColor").SelectedValue + "--bg" : ""; 832 } 833 834 @if (Model.PropertyItem.GetList("ShowBreadcrumb").SelectedValue == "True") 835 { 836 <div class="grid__col-12 grid__col--bleed-y"> 837 @RenderNavigation(new 838 { 839 id = "breadcrumb", 840 template = "Breadcrumb.xslt" 841 }) 842 </div> 843 } 844 845 <div class="grid"> 846 @if (Model.PropertyItem.GetList("LeftMenu") != null && Model.PropertyItem.GetList("LeftMenu").SelectedValue == "True" && (Pageview.Page.NavigationSettings == null || !Pageview.Page.NavigationSettings.UseEcomGroups)) 847 { 848 var navigationMarkup = RenderNavigation(new 849 { 850 id = "leftnav", 851 cssclass = "dwnavigation", 852 startLevel = 2, 853 expandmode = "all", 854 endlevel = 5, 855 template = "LeftNavigation.xslt" 856 }); 857 858 if (!string.IsNullOrEmpty(navigationMarkup)) 859 { 860 <nav class="grid__col-md-3"> 861 <div class="grid__cell"> 862 @navigationMarkup 863 </div> 864 </nav> 865 columnClass = "9"; 866 } 867 } 868 <div class="grid__col-md-@columnClass grid__col--bleed"> 869 <div class="grid"> 870 @Model.Placeholder("dwcontent", "content", "default:true;sort:1") 871 </div> 872 </div> 873 </div> 874 875 876 @* Very small hack to make it cleanly, and easily possible to change the background color on a single page *@ 877 @if (backgroundColorClass != "") 878 { 879 <script> 880 document.getElementById("Page").classList.add("@backgroundColorClass"); 881 </script> 882 } 883 </section> 884 </div> 885 </main> 886 887 @RenderFooter() 888 889 890 891 @helper RenderLogo(string pageId, string src, string alt) 892 { 893 <div class="logo dw-mod"> 894 <a href="/Default.aspx?ID=@pageId" class="logo__img dw-mod u-block"> 895 <img class="grid__cell-img logo__img dw-mod" src="@src" alt="@alt" /> 896 </a> 897 </div> 898 } 899 900 @helper RenderSearch(string alignment = "left") 901 { 902 <div class="typeahead typeahead--centered u-color-inherit js-typeahead dw-mod" data-page-size="7" id="ProductSearchBar" data-search-feed-id="@searchFeedId" data-search-second-feed-id="@searchSecondFeedId" data-result-page-id="@resultPageId" data-groups-page-id="@groupsFeedId" data-search-type="@searchType"> 903 @if (showGroups) 904 { 905 <button type="button" class="btn btn--condensed u-color-light-gray--bg typeahead-group-btn dw-mod js-typeahead-groups-btn" data-group-id="all">@Translate("All")</button> 906 <ul class="dropdown dropdown--absolute-position u-min-w220px js-handlebars-root js-typeahead-groups-content dw-mod" id="ProductSearchBarGroupsContent" data-template="SearchGroupsTemplate" data-json-feed="/Default.aspx?ID=@groupsFeedId&feedType=productGroups" data-init-onload="false" data-preloader="minimal"></ul> 907 } 908 <div class="typeahead-search-field"> 909 <input type="text" class="u-no-margin u-full-width u-full-height js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 910 @if (string.IsNullOrEmpty(searchSecondFeedId)) 911 { 912 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod" id="ProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></ul> 913 } 914 else 915 { 916 <div class="dropdown dropdown--absolute-position dropdown--combined grid @(alignment == "right" ? "dropdown--right-aligned" : "")"> 917 <div class="js-handlebars-root js-typeahead-search-content grid__col-sm-7 grid__col--bleed-y" id="ProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></div> 918 <div class="js-handlebars-root js-typeahead-additional-search-content grid__col-sm-5 grid__col--bleed-y" id="ContentSearchBarContent" data-template="@searchContentTemplate" data-json-feed="/Default.aspx?ID=@searchSecondFeedId" data-init-onload="false"></div> 919 </div> 920 } 921 </div> 922 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"><i class="@searchIcon"></i></button> 923 </div> 924 } 925 926 @helper RenderMiniSearch() 927 { 928 <li class="menu__item menu__item--horizontal menu__item--top-level u-hidden-xxs is-dropdown is-dropdown--no-icon dw-mod" onmouseover="document.getElementById('headerSearch').focus()"> 929 <div class="menu__link u-w50px dw-mod"> 930 <i class="@searchIcon fa-1_5x"></i> 931 </div> 932 <div class="menu menu--dropdown u-w380px top-micro-search dw-mod"> 933 <div class="typeahead js-typeahead" data-page-size="7" id="ProductSearchBar" data-search-feed-id="@searchFeedId" data-search-second-feed-id="@searchSecondFeedId" data-result-page-id="@resultPageId" data-search-type="@searchType"> 934 <div class="typeahead-search-field"> 935 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" id="headerSearch" placeholder="@searchPlaceholder" value="@searchValue"> 936 @if (string.IsNullOrEmpty(searchSecondFeedId)) 937 { 938 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod" id="ProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></ul> 939 } 940 else 941 { 942 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--right-aligned"> 943 <div class="js-handlebars-root js-typeahead-search-content grid__col-sm-7 grid__col--bleed-y" id="ProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></div> 944 <div class="js-handlebars-root js-typeahead-additional-search-content grid__col-sm-5 grid__col--bleed-y" id="ContentSearchBarContent" data-template="@searchContentTemplate" data-json-feed="/Default.aspx?ID=@searchSecondFeedId" data-init-onload="false"></div> 945 </div> 946 } 947 </div> 948 </div> 949 </div> 950 </li> 951 } 952 953 954 <!-- Content rendering helpers --> 955 956 @helper MobileNavigation(string userInitials, string position) 957 { 958 int pageId = Model.TopPage.ID; 959 string mobileNavigationLevels = Model.Area.Item.GetBoolean("MobileNavigationLevels") ? Model.Area.Item.GetString("MobileNavigationLevels") : "3"; 960 961 bool showCreateAccountLink = Model.Area.Item.GetBoolean("ShowCreateAccountLink"); 962 963 string userIcon = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Icons").GetList("SignInProfileIcon").SelectedValue) ? Model.Area.Item.GetItem("Icons").GetList("SignInProfileIcon").SelectedValue.ToLower() : "fas fa-user"; 964 string favoriteIcon = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Icons").GetList("FavoriteIcon").SelectedValue) ? "fas fa-" + Model.Area.Item.GetItem("Icons").GetList("FavoriteIcon").SelectedValue.ToLower() : "fas fa-star"; 965 string languageIcon = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Icons").GetList("LanguageIcon").SelectedValue) ? Model.Area.Item.GetItem("Icons").GetList("LanguageIcon").SelectedValue.ToLower() : "fas fa-globe"; 966 967 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 968 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 969 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 970 971 string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); 972 string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); 973 var quotesPageId = GetPageIdByNavigationTag("QuotesPage"); 974 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 975 bool showMyProfileLink = Model.Area.Item.GetBoolean("ShowMyProfileLink"); 976 bool showMyOrdersLink = Model.Area.Item.GetBoolean("ShowMyOrdersLink"); 977 bool showMyFavoritesLink = Model.Area.Item.GetBoolean("ShowMyFavoritesLink"); 978 979 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 980 bool isSlidesDesign = Model.Area.Item.GetList("MobileNavigationDesign").SelectedValue == "Slides"; 981 string menuTemplate = isSlidesDesign ? "BaseMenuForMobileSlides.xslt" : "BaseMenuForMobileExpandable.xslt"; 982 int startLevel = renderPagesInToolBar ? 1 : 0; 983 984 bool onlyPreview = Model.Area.Item.GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 985 986 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 987 { 988 <!-- Trigger for mobile navigation --> 989 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger mobile-nav-trigger--@position" autocomplete="off" /> 990 991 <!-- Mobile navigation --> 992 <nav class="mobile-navigation mobile-navigation--@position dw-mod"> 993 @if (Model.CurrentUser.ID > 0) 994 { 995 string userName = Model.CurrentUser.FirstName != null ? Model.CurrentUser.FirstName : ""; 996 userName += " " + Model.CurrentUser.LastName != null ? Model.CurrentUser.LastName : ""; 997 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 998 999 <ul class="menu menu-mobile"> 1000 <li class="menu-mobile__item"> 1001 <a href="/default.aspx?ID=@myProfilePageId" class="menu-mobile__link dw-mod"><i class="@userIcon menu-mobile__link-icon"></i> @userName</a> 1002 </li> 1003 </ul> 1004 } 1005 1006 @RenderNavigation(new 1007 { 1008 id = "mobilenavigation", 1009 cssclass = "menu menu-mobile dwnavigation", 1010 startLevel = @startLevel, 1011 ecomStartLevel = @startLevel + 1, 1012 endlevel = @mobileNavigationLevels, 1013 expandmode = "all", 1014 template = @menuTemplate 1015 }) 1016 1017 @if (renderPagesInToolBar) 1018 { 1019 @RenderNavigation(new 1020 { 1021 id = "topToolsMobileNavigation", 1022 cssclass = "menu menu-mobile dwnavigation", 1023 template = "ToolsMenuForMobile.xslt" 1024 }) 1025 } 1026 1027 <ul class="menu menu-mobile"> 1028 @if (!Model.Area.Item.GetBoolean("NavigationItemsHideSignIn")) 1029 { 1030 if (Model.CurrentUser.ID <= 0) 1031 { 1032 <li class="menu-mobile__item"> 1033 <label for="SignInModalTrigger" onclick="document.getElementById('MobileNavTrigger').checked = false;" class="menu-mobile__link dw-mod menu-mobile__link--highlighted"><i class="@userIcon menu-mobile__link-icon"></i> @Translate("Sign in")</label> 1034 </li> 1035 if (showCreateAccountLink) 1036 { 1037 <li class="menu-mobile__item"> 1038 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Default.aspx?ID=@createAccountPageId"><i class="@userIcon menu-mobile__link-icon"></i> @Translate("Create account")</a> 1039 </li> 1040 } 1041 } 1042 else 1043 { 1044 if (showMyProfileLink) 1045 { 1046 <li class="menu-mobile__item"> 1047 <a href="/default.aspx?ID=@myProfilePageId" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@userIcon menu-mobile__link-icon"></i> @Translate("My Profile")</a> 1048 </li> 1049 } 1050 if (showMyOrdersLink) 1051 { 1052 <li class="menu-mobile__item"> 1053 <a href="/default.aspx?ID=@myOrdersPageId" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="fas fa-list menu-mobile__link-icon"></i> @Translate("My Orders")</a> 1054 </li> 1055 } 1056 1057 @*========== Custom Link to My Quote ============*@ 1058 1059 <li class="menu-mobile__item"> 1060 <a href="/default.aspx?ID=@quotesPageId" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="fas fa-list menu-mobile__link-icon"></i> @Translate("My Quotes")</a> 1061 </li> 1062 1063 @*========== END Custom Link to My Quote ============*@ 1064 1065 if (showMyFavoritesLink) 1066 { 1067 <li class="menu-mobile__item"> 1068 <a href="/default.aspx?ID=@myFavoritesPageId" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@favoriteIcon menu-mobile__link-icon"></i> @Translate("My Favorites")</a> 1069 </li> 1070 } 1071 <li class="menu-mobile__item"> 1072 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId"><i class="@userIcon menu-mobile__link-icon"></i> @Translate("Sign out")</a> 1073 </li> 1074 } 1075 } 1076 1077 @if (Model.Languages.Count > 0) 1078 { 1079 string selectedLanguage = ""; 1080 foreach (var lang in Model.Languages) 1081 { 1082 if (lang.IsCurrent) 1083 { 1084 selectedLanguage = lang.Name; 1085 } 1086 } 1087 1088 <li class="menu-mobile__item dw-mod"> 1089 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 1090 <div class="menu-mobile__link__wrap"> 1091 <label for="MobileMenuCheck_Language" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@languageIcon menu-mobile__link-icon"></i> @selectedLanguage</label> 1092 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger"></label> 1093 </div> 1094 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 1095 @if (isSlidesDesign) 1096 { 1097 <li class="menu-mobile__item dw-mod"> 1098 <div class="menu-mobile__link__wrap"> 1099 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger menu-mobile__trigger--back"></label> 1100 <label for="MobileMenuCheck_Language" class="menu-mobile__link dw-mod ">Back</label> 1101 </div> 1102 </li> 1103 } 1104 @foreach (var lang in Model.Languages) 1105 { 1106 <li class="menu-mobile__item dw-mod"> 1107 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod menu-mobile__link--level-1" href="/Default.aspx?ID=@lang.Page.ID">@lang.Name</a> 1108 </li> 1109 } 1110 </ul> 1111 </li> 1112 } 1113 </ul> 1114 </nav> 1115 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 1116 1117 if (!onlyPreview) 1118 { 1119 <div class="u-visually-hidden js-handlebars-root js-mini-cart" id="miniCart" data-template="MiniCartContent" data-cart-id="@cartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 1120 } 1121 } 1122 } 1123 1124 @helper LoginModal() 1125 { 1126 int pageId = Model.TopPage.ID; 1127 string topLayout = Model.Area.Item.GetList("LayoutTop").SelectedValue; 1128 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 1129 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 1130 string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; 1131 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 1132 string userSignedInErrorText = ""; 1133 1134 if (Model.LogOnFailed) 1135 { 1136 switch (Model.LogOnFailedReason) 1137 { 1138 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordLengthInvalid: 1139 userSignedInErrorText = Translate("Password length is invalid"); 1140 break; 1141 case Dynamicweb.Security.UserManagement.LogOnFailedReason.IncorrectLogin: 1142 userSignedInErrorText = Translate("Invalid email or password"); 1143 break; 1144 case Dynamicweb.Security.UserManagement.LogOnFailedReason.ExceededFailedLogOnLimit: 1145 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 1146 break; 1147 case Dynamicweb.Security.UserManagement.LogOnFailedReason.LoginLocked: 1148 userSignedInErrorText = Translate("The user account is temporarily locked"); 1149 break; 1150 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordExpired: 1151 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 1152 break; 1153 default: 1154 userSignedInErrorText = Translate("An unknown error occured"); 1155 break; 1156 } 1157 } 1158 1159 <!-- Trigger for the login modal --> 1160 <input type="checkbox" id="SignInModalTrigger" class="modal-trigger @topLayout" @userSignedInError /> 1161 1162 <!-- Login modal --> 1163 <div class="modal-container"> 1164 <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> 1165 <div class="modal modal--xs" id="SignInModal"> 1166 <div class="modal__header"> 1167 <h2>@Translate("Sign in")</h2> 1168 </div> 1169 <div class="modal__body"> 1170 <form method="post" id="LoginForm" class="u-no-margin"> 1171 <input type="hidden" name="ID" value="@pageId" /> 1172 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 1173 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 1174 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 1175 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 1176 <div class="field-error dw-mod">@userSignedInErrorText</div> 1177 1178 <label> 1179 <input type="checkbox" id="RememberMe" name="Autologin" checked="checked" value="True"> 1180 <span>@Translate("Remember me", "Remember me")</span> 1181 </label> 1182 1183 <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> 1184 1185 <a class="btn btn--link-clean dw-mod" href="/Default.aspx?id=@forgotPasswordPageId">@Translate("Forgot your password?", "Forgot your password?")</a> 1186 1187 <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> 1188 </form> 1189 </div> 1190 </div> 1191 </div> 1192 } 1193 1194 @helper RenderHeaderNavigation() 1195 { 1196 bool megaMenu = Model.Area.Item.GetList("NavigationMegaMenu").SelectedValue.ToLower() == "true" ? true : false; 1197 string megamenuPromotionImage = Model.Area.Item.GetFile("NavigationMegamenuPromotionImage") != null ? Model.Area.Item.GetFile("NavigationMegamenuPromotionImage").PathUrlEncoded : ""; 1198 bool renderPagesInToolBar = Model.Area.Item.GetBoolean("RenderPagesInToolBar"); 1199 int startLevel = renderPagesInToolBar ? 1 : 0; 1200 1201 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 1202 { 1203 if (!megaMenu) 1204 { 1205 @RenderNavigation(new 1206 { 1207 id = "topnavigation", 1208 cssclass = "menu dw-mod dwnavigation u-full-max-width", 1209 startLevel = @startLevel, 1210 ecomStartLevel = @startLevel + 1, 1211 endlevel = 5, 1212 expandmode = "all", 1213 template = "BaseMenuWithDropdown.xslt" 1214 }); 1215 } 1216 else 1217 { 1218 @RenderNavigation(new 1219 { 1220 id = "topnavigation", 1221 cssclass = "menu dw-mod dwnavigation u-full-max-width", 1222 startLevel = @startLevel, 1223 ecomStartLevel = @startLevel + 1, 1224 endlevel = 5, 1225 promotionImage = megamenuPromotionImage, 1226 promotionLink = Model.Area.Item.GetString("NavigationMegamenuPromotionLink"), 1227 expandmode = "all", 1228 template = "BaseMegaMenu.xslt" 1229 }); 1230 } 1231 } 1232 } 1233 1234 @helper MobileNavigationTrigger() 1235 { 1236 @* Mobile navigation trigger *@ 1237 1238 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 1239 { 1240 <div class="menu dw-mod u-pull--left"> 1241 <div class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 1242 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link dw-mod"></label> 1243 </div> 1244 </div> 1245 } 1246 } 1247 1248 @helper RenderLanguageSelector(string type = "inNavigation") 1249 { 1250 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod u-hidden-xxs" : "menu__item menu__item--horizontal menu--clean dw-mod"; 1251 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 1252 string languageIcon = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Icons").GetList("LanguageIcon").SelectedValue) ? Model.Area.Item.GetItem("Icons").GetList("LanguageIcon").SelectedValue.ToLower() : "fas fa-globe"; 1253 string languageViewType = !String.IsNullOrEmpty(Model.Area.Item.GetList("LanguageSelectorViewType").SelectedValue) ? Model.Area.Item.GetList("LanguageSelectorViewType").SelectedValue.ToLower() : ""; 1254 1255 1256 @* Language selector *@ 1257 if (Model.Languages.Count > 1) 1258 { 1259 <li class="@liClasses is-dropdown is-dropdown--no-icon"> 1260 <div class="@menuLinkClass u-w50px dw-mod"> 1261 <i class="@languageIcon fa-1_5x"></i> 1262 </div> 1263 <div class="menu menu--dropdown dw-mod"> 1264 @foreach (var lang in Model.Languages) 1265 { 1266 string langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>" + lang.Name; 1267 1268 if (languageViewType == "flag") 1269 { 1270 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + "\"></span>"; 1271 } 1272 1273 if (languageViewType == "name") 1274 { 1275 langInfo = lang.Name; 1276 } 1277 1278 <a href="/Default.aspx?ID=@lang.Page.ID" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 1279 } 1280 </div> 1281 </li> 1282 } 1283 } 1284 1285 @helper RenderMiniCart(string type = "inNavigation") 1286 { 1287 bool onlyPreview = Model.Area.Item.GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 1288 string cartIcon = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Icons").GetList("CartIcon").SelectedValue) ? Model.Area.Item.GetItem("Icons").GetList("CartIcon").SelectedValue.ToLower() : "fas fa-shopping-cart"; 1289 1290 if (!onlyPreview && !Model.Area.Item.GetBoolean("NavigationItemsHideCart")) 1291 { 1292 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod" : "menu__item menu__item--horizontal menu--clean dw-mod"; 1293 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 1294 1295 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 1296 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 1297 int cartPageId = GetPageIdByNavigationTag("CartPage"); 1298 double cartProductsCount = Model.Cart.TotalProductsCount; 1299 1300 @* Mini cart *@ 1301 <li class="@liClasses" onmouseenter="Cart.UpdateMiniCart(event, 'miniCart', '/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart')"> 1302 <div class="mini-cart dw-mod"> 1303 <a href="/Default.aspx?ID=@cartPageId&Purge=True" id="miniCartCounterWrap" class="@menuLinkClass dw-mod js-mini-cart-button u-w50px"> 1304 <i class="@cartIcon fa-1_5x"></i> 1305 <div class="mini-cart__counter mini-cart__counter--inline dw-mod"> 1306 <div class="js-handlebars-root js-mini-cart-counter" id="cartCounter" data-template="MiniCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-init-onload="false" data-preloader="false"> 1307 <div class="js-mini-cart-counter-content"> 1308 @cartProductsCount 1309 </div> 1310 </div> 1311 </div> 1312 </a> 1313 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 1314 { 1315 <div class="mini-cart-dropdown js-handlebars-root js-mini-cart dw-mod" id="miniCart" data-template="MiniCartContent" data-cart-id="@miniCartFeedPageId" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 1316 } 1317 </div> 1318 </li> 1319 } 1320 } 1321 1322 @helper RenderSignIn(string type = "inNavigation", string userInitials = "") 1323 { 1324 if (!Model.Area.Item.GetBoolean("NavigationItemsHideSignIn")) 1325 { 1326 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod u-hidden-xxs" : "menu__item menu__item--horizontal menu__item--clean dw-mod"; 1327 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 1328 1329 string userIcon = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Icons").GetList("SignInProfileIcon").SelectedValue) ? Model.Area.Item.GetItem("Icons").GetList("SignInProfileIcon").SelectedValue.ToLower() : "fas fa-user"; 1330 string favoriteIcon = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Icons").GetList("FavoriteIcon").SelectedValue) ? "fas fa-" + Model.Area.Item.GetItem("Icons").GetList("FavoriteIcon").SelectedValue.ToLower() : "fas fa-star"; 1331 1332 int pageId = Model.TopPage.ID; 1333 string myProfilePageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerProfile").ToString() : GetPageIdByNavigationTag("CustomerProfile").ToString(); 1334 string myOrdersPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerOrders").ToString() : GetPageIdByNavigationTag("CustomerOrders").ToString(); 1335 var quotesPageId = GetPageIdByNavigationTag("QuotesPage"); 1336 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 1337 string myFavoritesPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("CustomerFavorites").ToString() : GetPageIdByNavigationTag("CustomerFavorites").ToString(); 1338 string mySavedCardsPageId = (Model.CurrentUser.ID <= 0) ? GetPageIdByNavigationTag("SignInPage").ToString() + "&RedirectPageId=" + GetPageIdByNavigationTag("SavedCards").ToString() : GetPageIdByNavigationTag("SavedCards").ToString(); 1339 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 1340 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 1341 string forgotPasswordPageId = signInProfilePageId.ToString() + "&LoginAction=Recovery"; 1342 1343 bool showCreateAccountLink = Model.Area.Item.GetBoolean("ShowCreateAccountLink"); 1344 bool showMyProfileLink = Model.Area.Item.GetBoolean("ShowMyProfileLink"); 1345 bool showMyOrdersLink = Model.Area.Item.GetBoolean("ShowMyOrdersLink"); 1346 bool showMyFavoritesLink = Model.Area.Item.GetBoolean("ShowMyFavoritesLink"); 1347 bool showMySavedCardsLink = Model.Area.Item.GetBoolean("ShowMySavedCardsLink"); 1348 1349 @* Sign in + Customer center links *@ 1350 <li class="@liClasses is-dropdown is-dropdown--no-icon"> 1351 <div class="@menuLinkClass u-w50px dw-mod"> 1352 @if (Model.CurrentUser.ID <= 0) 1353 { 1354 <i class="@userIcon fa-1_5x"></i> 1355 } 1356 else 1357 { 1358 <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit"><div class="circle-icon-btn">@userInitials.ToUpper()</div></a> 1359 } 1360 </div> 1361 <div class="menu menu--dropdown sign-in-dropdown dw-mod"> 1362 <ul class="list list--clean dw-mod"> 1363 @if (Model.CurrentUser.ID <= 0) 1364 { 1365 <li> 1366 <label for="SignInModalTrigger" class="btn btn--primary btn--full u-no-margin sign-in-modal-trigger-button dw-mod" onclick="setTimeout(function () { document.getElementById('LoginUsername').focus() }, 10)">@Translate("Sign in")</label> 1367 </li> 1368 if (showCreateAccountLink) 1369 { 1370 <li> 1371 <a href="/default.aspx?ID=@createAccountPageId" class="list__link dw-mod">@Translate("Create account")</a> 1372 </li> 1373 } 1374 <li> 1375 <a href="/default.aspx?ID=@forgotPasswordPageId" class="list__link dw-mod">@Translate("Forgot your password?")</a> 1376 </li> 1377 if (showMyProfileLink || showMyOrdersLink || showMyFavoritesLink || showMySavedCardsLink) 1378 { 1379 <li class="list__seperator dw-mod"></li> 1380 } 1381 } 1382 @if (showMyProfileLink) 1383 { 1384 <li> 1385 <a href="/default.aspx?ID=@myProfilePageId" class="list__link dw-mod"><i class="@userIcon u-margin-right"></i>@Translate("My Profile")</a> 1386 </li> 1387 } 1388 @if (showMyOrdersLink) 1389 { 1390 <li> 1391 <a href="/default.aspx?ID=@myOrdersPageId" class="list__link dw-mod"><i class="fas fa-list u-margin-right"></i>@Translate("My Orders")</a> 1392 </li> 1393 } 1394 1395 @*========== Custom Link to My Quote ============*@ 1396 <!-- 1397 <li> 1398 <a href="/default.aspx?ID=@quotesPageId" class="list__link dw-mod"><i class="fas fa-list u-margin-right"></i> @Translate("My Quotes")</a> 1399 </li> 1400 --> 1401 @*========== END Custom Link to My Quote ============*@ 1402 @if (showMyFavoritesLink) 1403 { 1404 <li> 1405 <a href="/default.aspx?ID=@myFavoritesPageId" class="list__link dw-mod"><i class="@favoriteIcon u-margin-right"></i>@Translate("My Favorites")</a> 1406 </li> 1407 } 1408 @if (showMySavedCardsLink) 1409 { 1410 <li> 1411 <a href="/default.aspx?ID=@mySavedCardsPageId" class="list__link dw-mod"><i class="fas fa-credit-card u-margin-right"></i>@Translate("My Saved cards")</a> 1412 </li> 1413 } 1414 @if (Model.CurrentUser.ID > 0) 1415 { 1416 if (showMyProfileLink || showMyOrdersLink || showMyFavoritesLink || showMySavedCardsLink) 1417 { 1418 <li class="list__seperator dw-mod"></li> 1419 } 1420 <li> 1421 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId" class="list__link dw-mod">@Translate("Sign out")</a> 1422 </li> 1423 } 1424 </ul> 1425 </div> 1426 </li> 1427 } 1428 } 1429 1430 @helper RenderFavorites(string type = "inNavigation") 1431 { 1432 if (!Model.Area.Item.GetBoolean("NavigationItemsHideFavorites")) 1433 { 1434 string liClasses = type == "inNavigation" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod u-hidden-xxs" : "menu__item menu__item--horizontal menu--clean dw-mod"; 1435 string menuLinkClass = type == "inNavigation" ? "menu__link" : "header-menu__link"; 1436 string favoriteIcon = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Icons").GetList("FavoriteIcon").SelectedValue) ? "fas fa-" + Model.Area.Item.GetItem("Icons").GetList("FavoriteIcon").SelectedValue.ToLower() : "fas fa-star"; 1437 string myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites").ToString(); 1438 1439 @* Favorites *@ 1440 if (Model.CurrentUser.ID > 0) 1441 { 1442 <li class="@liClasses"> 1443 <a href="/Default.aspx?ID=@myFavoritesPageId" class="@menuLinkClass u-w50px dw-mod"> 1444 <i class="@favoriteIcon fa-1_5x"></i> 1445 </a> 1446 </li> 1447 } 1448 } 1449 } 1450 1451 1452 @helper RenderFooter() 1453 { 1454 string footerColumnOneContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnOne")) ? Model.Area.Item.GetString("FooterColumnOne") : ""; 1455 string footerColumnTwoContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnTwo")) ? Model.Area.Item.GetString("FooterColumnTwo") : ""; 1456 string footerColumnThreeContent = !string.IsNullOrEmpty(Model.Area.Item.GetString("FooterColumnThree")) ? Model.Area.Item.GetString("FooterColumnThree") : ""; 1457 string footerColumnOneHeader = Model.Area.Item.GetString("FooterColumnOneHeader"); 1458 string footerColumnTwoHeader = Model.Area.Item.GetString("FooterColumnTwoHeader"); 1459 string footerColumnThreeHeader = Model.Area.Item.GetString("FooterColumnThreeHeader"); 1460 int newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp"); 1461 1462 <!-- Footer section --> 1463 <footer class="footer dw-mod"> 1464 <div class="center-container top-container__center-container dw-mod"> 1465 <div class="grid grid--external-bleed-x"> 1466 @if (!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) 1467 { 1468 <div class="grid__col-md-auto"> 1469 <h3 class="footer__heading dw-mod">@footerColumnOneHeader</h3> 1470 <div class="footer__content dw-mod"> 1471 @footerColumnOneContent 1472 </div> 1473 </div> 1474 } 1475 @if (!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) 1476 { 1477 <div class="grid__col-md-auto"> 1478 <h3 class="footer__heading dw-mod">@footerColumnTwoHeader</h3> 1479 <div class="footer__content dw-mod"> 1480 @footerColumnTwoContent 1481 </div> 1482 </div> 1483 } 1484 @if (!string.IsNullOrEmpty(footerColumnThreeContent) || !string.IsNullOrEmpty(footerColumnThreeHeader)) 1485 { 1486 <div class="grid__col-md-auto"> 1487 <h3 class="footer__heading dw-mod">@footerColumnThreeHeader</h3> 1488 <div class="footer__content dw-mod"> 1489 @footerColumnThreeContent 1490 </div> 1491 </div> 1492 } 1493 @if (Model.Area.Item.GetBoolean("FooterNewsletterSignUp")) 1494 { 1495 <div class="grid__col-md-auto"> 1496 <h3 class="footer__heading dw-mod">@Translate("Mailing list")</h3> 1497 <div class="footer__content dw-mod"> 1498 <p>@Translate("Sign up if you would like to receive occasional treats from us", "Sign up if you would like to receive occasional treats from us").</p> 1499 <form class="form dw-mod" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> 1500 <input name="ID" id="ID" value="@newsletterSignUpPageId" type="hidden" /> 1501 <div class="form__field-combi"> 1502 <input name="NewsletterEmail" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' /> 1503 <input class="btn btn--primary btn--condensed dw-mod" type="submit" id="Submitter" value='@Translate("Go", "Go")' /> 1504 </div> 1505 </form> 1506 </div> 1507 </div> 1508 } 1509 @if (Model.Area.Item.GetItems("FooterSocialLinks").Count > 0) 1510 { 1511 <div class="grid__col-md-auto"> 1512 <h3 class="footer__heading dw-mod">@Translate("Social links")</h3> 1513 <div class="footer__content dw-mod"> 1514 <div class="collection dw-mod"> 1515 @foreach (var socialitem in Model.Area.Item.GetItems("FooterSocialLinks")) 1516 { 1517 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 1518 string socialIconClass = socialIcon.SelectedValue; 1519 string socialIconTitle = socialIcon.SelectedName; 1520 string socialLink = socialitem.GetString("Link"); 1521 1522 <a href="@socialLink" target="_blank" title="@socialIconTitle" class="u-margin-bottom-5px"><i class="@socialIconClass fa-2x"></i></a> 1523 } 1524 </div> 1525 </div> 1526 </div> 1527 } 1528 @if (Model.Area.Item.GetItems("FooterPayments").Count > 0) 1529 { 1530 <div class="grid__col-12"> 1531 <div class="footer__content dw-mod"> 1532 <div class="collection dw-mod"> 1533 @foreach (var payment in Model.Area.Item.GetItems("FooterPayments")) 1534 { 1535 var paymentItem = payment.GetValue("CardTypeOrVerifiedPayment") as Dynamicweb.Frontend.ListViewModel; 1536 string paymentImage = null; 1537 string paymentTitle = paymentItem.SelectedName; 1538 ListOptionViewModel selected = paymentItem.SelectedOptions.FirstOrDefault(); 1539 if (selected != null) 1540 { 1541 paymentImage = selected.Icon; 1542 } 1543 1544 <div class="footer__card-type"> 1545 <img src="/Admin/Public/GetImage.ashx?width=60&Compression=75&image=@paymentImage" alt="@paymentTitle" title="@paymentTitle" /> 1546 </div> 1547 } 1548 </div> 1549 </div> 1550 </div> 1551 } 1552 <div class="grid__col-12 footer__copyright dw-mod"> 1553 <p>@Model.Area.Item.GetString("FooterCopyrightText")</p> 1554 </div> 1555 </div> 1556 </div> 1557 </footer> 1558 } 1559 1560 1561 @* Templates for Typeahead *@ 1562 @if (!Model.Area.Item.GetBoolean("NavigationItemsHideSearch")) 1563 { 1564 <script id="SearchGroupsTemplate" type="text/x-template"> 1565 {{#.}} 1566 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 1567 {{/.}} 1568 </script> 1569 1570 <script id="SearchProductsTemplate" type="text/x-template"> 1571 {{#each .}} 1572 {{#Product}} 1573 {{#ifCond template "!==" "SearchMore"}} 1574 <li class="dropdown__item dropdown__item--seperator dw-mod"> 1575 <div> 1576 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left"> 1577 <div class="u-margin-right u-pull--left {{noimage}} u-hidden-xs u-hidden-xxs"><img src="/Admin/Public/GetImage.ashx?width=45&height=36&crop=5&FillCanvas=True&Compression=75&image={{image}}" alt="{{name}}"></div> 1578 <div class="u-pull--left"> 1579 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 1580 @if (!onlyPreview) 1581 { 1582 if (showPrices) 1583 { 1584 <div class="{{onlyPreview}}">{{price}}</div> 1585 } 1586 } 1587 </div> 1588 </a> 1589 <div class="u-margin-left u-pull--right u-w80px"> 1590 <button class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside" onclick="Cart.AddToCart(event, '{{productId}}', '1')"><i class="@cartIcon js-ignore-click-outside"></i></button> 1591 <a href="{{link}}" class="btn btn--secondary btn--condensed btn--full u-no-margin dw-mod {{hideViewMore}} js-ignore-click-outside">@Translate("View")</a> 1592 </div> 1593 </div> 1594 </li> 1595 {{/ifCond}} 1596 {{#ifCond template "===" "SearchMore"}} 1597 {{>SearchMoreProducts}} 1598 {{/ifCond}} 1599 {{/Product}} 1600 {{else}} 1601 <li class="dropdown__item dropdown__item--seperator dw-mod"> 1602 @Translate("Your search gave 0 results") 1603 </li> 1604 {{/each}} 1605 </script> 1606 1607 <script id="SearchMoreProducts" type="text/x-template"> 1608 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 1609 <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 1610 @Translate("View all") 1611 </a> 1612 </li> 1613 </script> 1614 1615 <script id="SearchMorePages" type="text/x-template"> 1616 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 1617 <a href="/Default.aspx?ID=@contentSearchPageId&Search={{searchParameter}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 1618 @Translate("View all") 1619 </a> 1620 </li> 1621 </script> 1622 1623 <script id="SearchPagesTemplate" type="text/x-template"> 1624 {{#each .}} 1625 {{#ifCond template "!==" "SearchMore"}} 1626 <li class="dropdown__item dropdown__item--seperator dw-mod"> 1627 <div> 1628 <a href="/Default.aspx?ID={{id}}" class="js-typeahead-link u-pull--left u-color-inherit"> 1629 <div class="u-margin-right u-pull--left"><i class="fa {{icon}} u-w20px u-ta-center"></i></div> 1630 <div class="u-pull--left"> 1631 <div class="u-bold u-truncate-text u-max-w220px js-typeahead-name">{{name}}</div> 1632 </div> 1633 </a> 1634 </div> 1635 </li> 1636 {{/ifCond}} 1637 {{#ifCond template "===" "SearchMore"}} 1638 {{>SearchMorePages}} 1639 {{/ifCond}} 1640 {{else}} 1641 <li class="dropdown__item dropdown__item--seperator dw-mod"> 1642 @Translate("Your search gave 0 results") 1643 </li> 1644 {{/each}} 1645 </script> 1646 1647 <script id="SearchPagesTemplateWrap" type="text/x-template"> 1648 <div class="dropdown__column-header">@Translate("Pages")</div> 1649 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 1650 {{>SearchPagesTemplate}} 1651 </ul> 1652 </script> 1653 1654 <script id="SearchProductsTemplateWrap" type="text/x-template"> 1655 <div class="dropdown__column-header">@Translate("Products")</div> 1656 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 1657 {{>SearchProductsTemplate}} 1658 </ul> 1659 </script> 1660 } 1661 1662 @* Templates for the mini cart *@ 1663 @if (!Model.Area.Item.GetBoolean("NavigationItemsHideCart")) 1664 { 1665 <script id="MiniCartCounterContent" type="text/x-template"> 1666 {{#.}} 1667 <div class="js-mini-cart-counter-content dw-mod"> 1668 {{numberofproducts}} 1669 </div> 1670 {{/.}} 1671 </script> 1672 1673 <script id="MiniCartContent" type="text/x-template"> 1674 {{#.}} 1675 <div class="mini-cart-dropdown__inner {{isempty}} dw-mod"> 1676 <h4 class="u-ta-center u-no-margin u-margin-bottom u-margin-top">@Translate("Basket")</h4> 1677 <hr> 1678 <div class="mini-cart-dropdown__body dw-mod"> 1679 <!--CUSTOM--> 1680 1681 <div class="gauges"> 1682 1683 1684 <p style="text-align: center;">@Translate("You are filling a") <span class="cont-name">{{containerName}}</span> @Translate("now").</p> 1685 {{#if iscontainer}} 1686 <div class="cont-name"> 1687 @*<i class="fass fas fa-info-circle"></i>*@ 1688 <div class="progress"> 1689 <div id="volume-progress-bar" class="progress-bar {{progressVolumeStyle}}" role="progressbar" style="width: {{progressVolume}}%"> 1690 <span class="space-info"> 1691 @Translate("Volume"): 1692 <span id="volumeProgressNumber">{{currentVolume}}</span> / 1693 <span id="maxVolume">{{maxVolume}}</span> CBM 1694 </span> 1695 </div> 1696 </div> 1697 </div> 1698 {{else}} 1699 <div class="cont-name"> 1700 @*<i class="fass fas fa-info-circle"></i>*@ 1701 <div class="progress"> 1702 <div id="pallets-progress-bar" class="progress-bar {{progressPalletsStyle}}" role="progressbar" style="width: {{progressPallets}}%"> 1703 <span class="space-info"> 1704 @Translate("Pallets"): 1705 <span id="PalletsProgressNumber">{{currentPallets}}</span> / 1706 <span id="maxPallets">{{maxPallets}}</span> @Translate("Pallets") 1707 </span> 1708 </div> 1709 </div> 1710 </div> 1711 {{/if}} 1712 <div class="outter-pr"> 1713 @*<i class="fass fas fa-info-circle"></i>*@ 1714 <div class="progress"> 1715 <div id="weight-progress-bar" class="progress-bar {{progressWeightStyle}}" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width:{{progressWeight}}%"> 1716 <span class="space-info"> 1717 @Translate("Weight"): 1718 <span id="weightProgressNumber">{{currentWeight}}</span> / 1719 <span id="maxWeight">{{maxWeight}}</span> KG 1720 </span> 1721 </div> 1722 </div> 1723 </div> 1724 </div> 1725 1726 <!--CUSTOM END--> 1727 <table class="table mini-cart-table dw-mod"> 1728 <thead> 1729 <tr> 1730 <td>&nbsp;</td> 1731 <td>@Translate("Product")</td> 1732 <td class="u-ta-right">@Translate("Qty")</td> 1733 @if (showPrices) 1734 { 1735 <td class="u-ta-right" width="120">@Translate("Price") (@Translate("EXW"))</td> 1736 } 1737 </tr> 1738 </thead> 1739 1740 {{#OrderLines}} 1741 {{#ifCond template "===" "CartOrderline"}} 1742 {{>MiniCartOrderline}} 1743 {{/ifCond}} 1744 {{#ifCond template "===" "CartOrderlineMobile"}} 1745 {{>MiniCartOrderlineMobile}} 1746 {{/ifCond}} 1747 {{#ifCond template "===" "CartOrderlineDiscount"}} 1748 {{>MiniCartOrderlineDiscount}} 1749 {{/ifCond}} 1750 {{/OrderLines}} 1751 @if (showPrices) 1752 { 1753 @* 1754 <tr> 1755 <td><i class="fas fa-credit-card"></i></td> 1756 <td>{{paymentmethod}}</td> 1757 <td colspan="2" class="u-ta-right" width="130">{{paymentfee}}</td> 1758 </tr> 1759 <tr> 1760 <td><i class="fas fa-truck"></i></td> 1761 <td>{{shippingmethod}}</td> 1762 <td colspan="2" class="u-ta-right" width="130">{{shippingfee}}</td> 1763 </tr> 1764 *@ 1765 <tr class="mini-cart-totals dw-mod"> 1766 <td colspan="2">@Translate("Total")</td> 1767 <td class="u-ta-right">{{numberofproducts}}</td> 1768 <td class="u-ta-right" width="130">{{subtotalprice}}</td> 1769 </tr> 1770 } 1771 </table> 1772 </div> 1773 1774 <table class="table mini-cart-table dw-mod"> 1775 <tr class="mini-cart-orderlines__footer dw-mod"> 1776 <td colspan="2"><button type="button" class="btn btn--secondary u-pull--left u-no-margin dw-mod btn--sm" onclick="Cart.EmptyCart(event)">@Translate("Empty cart")</button></td> 1777 <td colspan="2" class="u-ta-right"><a href="/Default.aspx?ID=@cartPageId" class="btn btn--primary u-pull--right u-no-margin dw-mod btn--sm">@Translate("Proceed to checkout")</a></td> 1778 </tr> 1779 </table> 1780 </div> 1781 {{/.}} 1782 </script> 1783 1784 <script id="MiniCartOrderline" type="text/x-template"> 1785 <tr class="{{isempty}}"> 1786 <td><a href="{{link}}" class="{{hideimage}}"><img src="/Admin/Public/GetImage.ashx?width=50&height=50&crop=5&Compression=75&image={{image}}" alt="{{name}}"></a></td> 1787 <td> 1788 <a href="{{link}}" class="mini-cart-orderlines__name" title="{{name}}">{{name}}</a> 1789 {{#if variantname}} 1790 <a href="{{link}}" class="mini-cart-orderlines__name mini-cart-orderlines__name--small">{{variantname}}</a> 1791 {{/if}} 1792 {{#if unitname}} 1793 <div class="mini-cart-orderlines__name mini-cart-orderlines__name--small">{{unitname}}</div> 1794 {{/if}} 1795 </td> 1796 <td class="u-ta-right">{{quantity}}</td> 1797 @if (showPrices) 1798 { 1799 <td class="u-ta-right">{{totalprice}}</td> 1800 } 1801 </tr> 1802 </script> 1803 1804 <script id="MiniCartOrderlineMobile" type="text/x-template"> 1805 <tr class="{{isempty}}"> 1806 <td><a href="{{link}}" class="{{hideimage}}"><img src="/Admin/Public/GetImage.ashx?width=50&height=50&crop=5&Compression=75&image={{image}}" alt="{{name}}"></a></td> 1807 <td> 1808 <a href="{{link}}" class="mini-cart-orderlines__name">{{name}}</a> 1809 {{#if variantname}} 1810 <a href="{{link}}" class="mini-cart-orderlines__name mini-cart-orderlines__name--small">{{variantname}}</a> 1811 {{/if}} 1812 {{#if unitname}} 1813 <div class="mini-cart-orderlines__name mini-cart-orderlines__name--small">{{unitname}}</div> 1814 {{/if}} 1815 </td> 1816 <td class="u-ta-right">{{quantity}}</td> 1817 @if (showPrices) 1818 { 1819 <td class="u-ta-right">{{totalprice}}</td> 1820 } 1821 </tr> 1822 </script> 1823 1824 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 1825 <tr class="table__row--no-border {{isempty}}"> 1826 <td>&nbsp;</td> 1827 <td><div class="mini-cart-orderlines__name dw-mod">{{name}}</div></td> 1828 <td class="u-ta-right">&nbsp;</td> 1829 @if (showPrices) 1830 { 1831 <td class="u-ta-right">{{totalprice}}</td> 1832 } 1833 </tr> 1834 </script> 1835 } 1836 1837 <!-- Javascript --> 1838 <script src="/Files/Templates/Designs/Rapido/js/handlebars-v4.0.11.js"></script> 1839 <script src="/Files/Templates/Designs/Rapido/js/master.js"></script> 1840 1841 <!--CUSTOM--> 1842 <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous"> 1843 <script src="/Files/Templates/Designs/Rapido/js/MutationGauges.js"></script> 1844 <!--CUSTOM END--> 1845 @if (Model.Area.Item.GetBoolean("UseCustomJavascript")) 1846 { 1847 <script src="/Files/Templates/Designs/Rapido/js/custom.js"></script> 1848 } 1849 <script> 1850 Wireframe.Init(@wireframeMode.ToLower()); 1851 </script> 1852 <!--@Javascripts--> 1853 </body> 1854 1855 </html> 1856 1857