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_4e0814b47a8d4d0d8e660bd382078b87.b__95_0(TextWriter __razor_helper_writer) in E:\Dynamicweb\Solutions\Kruuse\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 4396
   at CompiledRazorTemplates.Dynamic.RazorEngine_4e0814b47a8d4d0d8e660bd382078b87.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in E:\Dynamicweb\Solutions\Kruuse\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 161
   at CompiledRazorTemplates.Dynamic.RazorEngine_4e0814b47a8d4d0d8e660bd382078b87.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in E:\Dynamicweb\Solutions\Kruuse\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 125
   at CompiledRazorTemplates.Dynamic.RazorEngine_4e0814b47a8d4d0d8e660bd382078b87.b__63_0(TextWriter __razor_helper_writer) in E:\Dynamicweb\Solutions\Kruuse\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 2930
   at CompiledRazorTemplates.Dynamic.RazorEngine_4e0814b47a8d4d0d8e660bd382078b87.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in E:\Dynamicweb\Solutions\Kruuse\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 161
   at CompiledRazorTemplates.Dynamic.RazorEngine_4e0814b47a8d4d0d8e660bd382078b87.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in E:\Dynamicweb\Solutions\Kruuse\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 125
   at CompiledRazorTemplates.Dynamic.RazorEngine_4e0814b47a8d4d0d8e660bd382078b87.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in E:\Dynamicweb\Solutions\Kruuse\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 166
   at CompiledRazorTemplates.Dynamic.RazorEngine_4e0814b47a8d4d0d8e660bd382078b87.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in E:\Dynamicweb\Solutions\Kruuse\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 125
   at CompiledRazorTemplates.Dynamic.RazorEngine_4e0814b47a8d4d0d8e660bd382078b87.Execute() in E:\Dynamicweb\Solutions\Kruuse\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 4360
   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 3.0.1 *@ 4 5 @using System.Web; 6 @using Dynamicweb.Frontend 7 @using Dynamicweb.Frontend.Devices 8 @using Dynamicweb.Extensibility 9 @using Dynamicweb.Content 10 @using Dynamicweb.Security 11 @using Dynamicweb.Core 12 @using System 13 @using System.Web 14 @using System.IO 15 @using Dynamicweb.Rapido.Blocks 16 17 @functions { 18 BlocksPage masterPage = BlocksPage.GetBlockPage("Master"); 19 20 string getFontFamily(params string[] items) 21 { 22 var itemParent = Pageview.AreaSettings; 23 foreach (var item in items) 24 { 25 itemParent = itemParent.GetItem(item); 26 if (itemParent == null) 27 { 28 return null; 29 } 30 } 31 32 var googleFont = itemParent.GetGoogleFont("FontFamily"); 33 if (googleFont == null) 34 { 35 return null; 36 } 37 return googleFont.Family.Replace(" ", "+"); 38 } 39 } 40 @{ 41 //Font settings 42 var fonts = new string[] { 43 getFontFamily("Layout", "HeaderFont"), 44 getFontFamily("Layout", "SubheaderFont"), 45 getFontFamily("Layout", "TertiaryHeaderFont"), 46 getFontFamily("Layout", "Header", "ToolsFont"), 47 getFontFamily("Layout", "Header", "NavigationFont"), 48 getFontFamily("Layout", "MobileNavigation", "Font"), 49 getFontFamily("ProductList", "Facets", "HeaderFont"), 50 getFontFamily("ProductPage", "PriceFontDesign"), 51 getFontFamily("Ecommerce", "SaleSticker", "Font"), 52 getFontFamily("Ecommerce", "NewSticker", "Font"), 53 getFontFamily("Ecommerce", "CustomSticker", "Font") 54 }; 55 56 string autoCssLink = "/Files/Templates/Designs/Rapido/css/rapido/rapido_" + Model.Area.ID.ToString() + ".min.css?ticks=" + Model.Area.UpdatedDate.Ticks; 57 bool useFontAwesomePro = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetBoolean("UseFontAwesomePro"); 58 string favicon = Model.Area.Item.GetItem("Layout").GetFile("LogoFavicon") != null ? Model.Area.Item.GetItem("Layout").GetFile("LogoFavicon").Path : "/Files/Images/favicon.png"; 59 } 60 61 @{ 62 Block master = new Block() 63 { 64 Id = "Master", 65 BlocksList = new List<Block> { 66 new Block { 67 Id = "MasterTopSnippets", 68 SortId = 10 69 }, 70 new Block { 71 Id = "MasterMain", 72 SortId = 20, 73 Template = RenderMain(), 74 SkipRenderBlocksList = true, 75 BlocksList = new List<Block> { 76 new Block 77 { 78 Id = "MasterHeader", 79 SortId = 10, 80 Template = RenderMasterHeader(), 81 SkipRenderBlocksList = true 82 }, 83 new Block { 84 Id = "MasterPageContent", 85 SortId = 20, 86 Template = RenderPageContent() 87 } 88 } 89 }, 90 new Block { 91 Id = "MasterFooter", 92 SortId = 30 93 }, 94 new Block { 95 Id = "MasterReferences", 96 SortId = 40 97 }, 98 new Block { 99 Id = "MasterBottomSnippets", 100 SortId = 50 101 } 102 } 103 }; 104 masterPage.Add(master); 105 } 106 107 @* Include the required Grid builder (Contains the methods @RenderBlockList and @RenderBlock) *@ 108 @using System.Text.RegularExpressions 109 @using System.Collections.Generic 110 @using Dynamicweb.Rapido.Blocks 111 112 113 @*--- START: Base block renderers ---*@ 114 115 @helper RenderBlockList(List<Block> blocks) 116 { 117 blocks = blocks.OrderBy(item => item.SortId).ToList(); 118 119 foreach (Block item in blocks) 120 { 121 <!-- START: @item.Id --> 122 123 if (item.Design == null) 124 { 125 @RenderBlock(item) 126 } 127 else if (item.Design.RenderType != RenderType.Hide) 128 { 129 if (item.Design.RenderType == RenderType.Row) 130 { 131 <div class="grid grid--align-content-start"> 132 @RenderBlock(item) 133 </div> 134 } 135 136 if (item.Design.RenderType == RenderType.Column) 137 { 138 string hidePadding = item.Design.HidePadding ? "u-no-padding" : ""; 139 string size = item.Design.Size != null ? item.Design.Size : "12"; 140 size = Regex.IsMatch(size, @"\d") ? "md-" + item.Design.Size : item.Design.Size; 141 142 <div class="grid__col-lg-@item.Design.Size grid__col-md-@item.Design.Size grid__col-sm-12 grid__col-xs-12 @hidePadding" id="Block__@item.Id"> 143 @RenderBlock(item) 144 </div> 145 } 146 147 if (item.SkipRenderBlocksList == true) 148 { 149 @RenderBlock(item) 150 } 151 } 152 153 <!-- END: @item.Id --> 154 } 155 } 156 157 @helper RenderBlock(Block item) 158 { 159 if (item.Template != null) 160 { 161 @BlocksPage.RenderTemplate(item.Template) 162 } 163 164 if (item.BlocksList.Count > 0 && item.SkipRenderBlocksList == false) 165 { 166 @RenderBlockList(item.BlocksList) 167 } 168 } 169 170 @*--- END: Base block renderers ---*@ 171 172 173 @* Include the Blocks for the page *@ 174 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 175 176 @using System 177 @using System.Web 178 @using System.Collections.Generic 179 @using Dynamicweb.Rapido.Blocks.Extensibility 180 @using Dynamicweb.Rapido.Blocks 181 182 @{ 183 BlocksPage topSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 184 185 Block tagManager = new Block() 186 { 187 Id = "TagManager", 188 SortId = 1, 189 Template = RenderGoogleTagManager() 190 }; 191 192 Block facebookPixel = new Block() 193 { 194 Id = "FacebookPixel", 195 SortId = 2, 196 Template = RenderFacebookPixel() 197 }; 198 199 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, tagManager); 200 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, facebookPixel); 201 } 202 203 @helper RenderGoogleTagManager() { 204 string GoogleTagManagerID = Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID") != null ? Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID") : ""; 205 206 if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 207 { 208 <script> 209 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 210 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 211 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 212 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 213 })(window,document,'script','dataLayer','@GoogleTagManagerID'); 214 </script> 215 <!-- Google Tag Manager (noscript) --> 216 <noscript> 217 <iframe src="https://www.googletagmanager.com/ns.html?id=@GoogleTagManagerID" 218 height="0" width="0" style="display:none;visibility:hidden"></iframe> 219 </noscript> 220 <!-- End Google Tag Manager (noscript) --> 221 } 222 } 223 224 @helper RenderFacebookPixel() { 225 string FacebookPixelID = Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID") != null ? Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID") : ""; 226 227 if (!string.IsNullOrWhiteSpace(FacebookPixelID)) 228 { 229 <!-- Facebook Pixel Code --> 230 <script> 231 !function(f,b,e,v,n,t,s) 232 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 233 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 234 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 235 n.queue=[];t=b.createElement(e);t.async=!0; 236 t.src=v;s=b.getElementsByTagName(e)[0]; 237 s.parentNode.insertBefore(t,s)}(window, document,'script', 238 'https://connect.facebook.net/en_US/fbevents.js'); 239 fbq('init', '@FacebookPixelID'); 240 fbq('track', 'PageView'); 241 </script> 242 <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=@FacebookPixelID&ev=PageView&noscript=1" alt="" /></noscript> 243 } 244 } 245 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 246 247 @using System 248 @using System.Web 249 @using System.Collections.Generic 250 @using Dynamicweb.Rapido.Blocks.Extensibility 251 @using Dynamicweb.Rapido.Blocks 252 253 254 @{ 255 BlocksPage loginBlocksPage = BlocksPage.GetBlockPage("Master"); 256 257 Block loginModal = new Block() 258 { 259 Id = "LoginModal", 260 SortId = 10, 261 Template = LoginModal() 262 }; 263 264 loginBlocksPage.Add(MasterBlockId.MasterTopSnippets, loginModal); 265 } 266 267 @helper LoginModal() { 268 int pageId = Model.TopPage.ID; 269 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 270 string userSignedInErrorText = ""; 271 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 272 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 273 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 274 275 if (Model.LogOnFailed) { 276 switch (Model.LogOnFailedReason) 277 { 278 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordLengthInvalid: 279 userSignedInErrorText = Translate("Password length is invalid"); 280 break; 281 case Dynamicweb.Security.UserManagement.LogOnFailedReason.IncorrectLogin: 282 userSignedInErrorText = Translate("Invalid email or password"); 283 break; 284 case Dynamicweb.Security.UserManagement.LogOnFailedReason.ExceededFailedLogOnLimit: 285 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 286 break; 287 case Dynamicweb.Security.UserManagement.LogOnFailedReason.LoginLocked: 288 userSignedInErrorText = Translate("The user account is temporarily locked"); 289 break; 290 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordExpired: 291 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 292 break; 293 default: 294 userSignedInErrorText = Translate("An unknown error occured"); 295 break; 296 } 297 } 298 299 <!-- Trigger for the login modal --> 300 <input type="checkbox" id="SignInModalTrigger" class="modal-trigger" @userSignedInError /> 301 302 <!-- Login modal --> 303 <div class="modal-container"> 304 <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> 305 <div class="modal modal--xs" id="SignInModal"> 306 <div class="modal__header"> 307 <h2>@Translate("Sign in")</h2> 308 </div> 309 <div class="modal__body"> 310 <form method="post" id="LoginForm" class="u-no-margin"> 311 <input type="hidden" name="ID" value="@pageId" /> 312 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 313 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 314 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 315 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 316 <div class="field-error dw-mod">@userSignedInErrorText</div> 317 318 <div class="form__field-group dw-mod"> 319 <input type="checkbox" id="LoginRememberMe" name="Autologin" checked="checked" value="True" class="form__control"> 320 <label for="LoginRememberMe"> 321 @Translate("Remember me", "Remember me") 322 </label> 323 </div> 324 325 <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> 326 327 <a class="btn btn--link-clean dw-mod" href="@forgotPasswordPageLink">@Translate("Forgot your password?", "Forgot your password?")</a> 328 329 <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> 330 </form> 331 </div> 332 </div> 333 </div> 334 } 335 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 336 { 337 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 338 339 @using System 340 @using System.Web 341 @using System.Collections.Generic 342 @using Dynamicweb.Rapido.Blocks.Extensibility 343 @using Dynamicweb.Rapido.Blocks 344 345 346 @functions { 347 BlocksPage mobileHeaderBlocksPage = BlocksPage.GetBlockPage("Master"); 348 } 349 350 @{ 351 var mobileTopLayout = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetString("Design")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 352 bool hideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 353 bool hideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 354 bool hideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 355 356 357 Block mobileHeader = new Block() 358 { 359 Id = "MobileTop", 360 SortId = 10, 361 Template = RenderMobileTop(), 362 SkipRenderBlocksList = true 363 }; 364 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeader); 365 366 Block mobileHeaderNavigation = new Block() 367 { 368 Id = "MobileHeaderNavigation", 369 SortId = 10, 370 Template = RenderMobileHeaderNavigation(), 371 SkipRenderBlocksList = true, 372 BlocksList = new List<Block> { 373 new Block { 374 Id = "MobileHeaderNavigationTrigger", 375 SortId = 10, 376 Template = RenderMobileHeaderNavigationTrigger() 377 } 378 } 379 }; 380 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderNavigation); 381 382 383 Block mobileHeaderLogo = new Block() 384 { 385 Id = "MobileHeaderLogo", 386 SortId = 20, 387 Template = RenderMobileHeaderLogo(), 388 SkipRenderBlocksList = true 389 }; 390 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderLogo); 391 392 Block mobileHeaderActions = new Block() 393 { 394 Id = "MobileHeaderActions", 395 SortId = 30, 396 Template = RenderMobileTopActions(), 397 SkipRenderBlocksList = true 398 }; 399 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderActions); 400 401 if (hideSearch == false) 402 { 403 Block mobileHeaderSearch = new Block 404 { 405 Id = "MobileHeaderSearch", 406 SortId = 10, 407 Template = RenderMobileTopSearch() 408 }; 409 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderSearch); 410 } 411 412 Block mobileHeaderMiniCart; 413 414 if (hideCart == false) 415 { 416 mobileHeaderMiniCart = new Block 417 { 418 Id = "MobileHeaderMiniCart", 419 SortId = 20, 420 Template = RenderMobileTopMiniCart() 421 }; 422 } 423 else 424 { 425 mobileHeaderMiniCart = new Block 426 { 427 Id = "MobileHeaderMiniCart", 428 SortId = 20 429 }; 430 } 431 432 if (hideSearch == false) 433 { 434 Block mobileHeaderSearchBar = new Block() 435 { 436 Id = "MobileHeaderSearchBar", 437 SortId = 30, 438 Template = RenderMobileTopSearchBar() 439 }; 440 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeaderSearchBar); 441 } 442 443 switch (mobileTopLayout) 444 { 445 case "nav-left": 446 mobileHeaderNavigation.SortId = 10; 447 mobileHeaderLogo.SortId = 20; 448 mobileHeaderActions.SortId = 30; 449 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 450 break; 451 case "nav-right": 452 mobileHeaderLogo.SortId = 10; 453 mobileHeaderActions.SortId = 20; 454 mobileHeaderNavigation.SortId = 30; 455 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 456 break; 457 case "nav-search-left": 458 mobileHeaderNavigation.SortId = 10; 459 mobileHeaderLogo.SortId = 20; 460 mobileHeaderActions.SortId = 30; 461 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 462 break; 463 case "search-left": 464 mobileHeaderActions.SortId = 10; 465 mobileHeaderLogo.SortId = 20; 466 mobileHeaderNavigation.SortId = 30; 467 mobileHeaderMiniCart.SortId = 0; 468 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 469 break; 470 } 471 } 472 473 474 @helper RenderMobileTop() 475 { 476 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileTop").OrderBy(item => item.SortId).ToList(); 477 478 <nav class="main-navigation-mobile dw-mod"> 479 <div class="center-container top-container__center-container dw-mod"> 480 <div class="grid grid--align-center"> 481 @RenderBlockList(subBlocks) 482 </div> 483 </div> 484 </nav> 485 } 486 487 @helper RenderMobileHeaderNavigation() 488 { 489 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderNavigation").OrderBy(item => item.SortId).ToList(); 490 491 <div class="grid__col-auto-width"> 492 <ul class="menu dw-mod"> 493 @RenderBlockList(subBlocks) 494 </ul> 495 </div> 496 } 497 498 @helper RenderMobileHeaderNavigationTrigger() 499 { 500 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 501 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link menu__link--icon menu__link--mobile dw-mod"></label> 502 </li> 503 } 504 505 @helper RenderMobileHeaderLogo() 506 { 507 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderLogo").OrderBy(item => item.SortId).ToList(); 508 509 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 510 string businessName = Model.Area.Item.GetItem("Settings").GetString("BusinessName"); 511 512 string mobileLogo = "/Files/Images/logo-dynamicweb.png"; 513 if (Model.Area.Item.GetItem("Layout").GetItem("MobileTop") != null && Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo") != null) 514 { 515 mobileLogo = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo").PathUrlEncoded; 516 } 517 518 if (Path.GetExtension(mobileLogo).ToLower() != ".svg") 519 { 520 mobileLogo = "/Admin/Public/GetImage.ashx?height=40&amp;crop=5&amp;Compression=75&amp;image=" + mobileLogo; 521 } 522 else 523 { 524 mobileLogo = HttpUtility.UrlDecode(mobileLogo); 525 } 526 527 <div class="grid__col-auto"> 528 <div class="logo dw-mod"> 529 <a href="/Default.aspx?ID=@firstPageId"> 530 <img class="grid__cell-img logo__img logo__img--mobile dw-mod" src="@mobileLogo" alt="@businessName" /> 531 </a> 532 </div> 533 534 @RenderBlockList(subBlocks) 535 </div> 536 } 537 538 @helper RenderMobileTopActions() 539 { 540 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderActions").OrderBy(item => item.SortId).ToList(); 541 542 <div class="grid__col-auto-width"> 543 <ul class="menu dw-mod"> 544 @RenderBlockList(subBlocks) 545 </ul> 546 </div> 547 } 548 549 @helper RenderMobileTopSearch() 550 { 551 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 552 <label for="MobileSearchTrigger" class="menu__link menu__link--icon menu__link--mobile dw-mod"> 553 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue fa-1_5x"></i> 554 </label> 555 </li> 556 } 557 558 @helper RenderMobileTopMiniCart() // NOTE: Change in original Razor file. 559 { 560 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 561 int cartPageId = GetPageIdByNavigationTag("CartPage"); 562 563 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod" id="miniCartWrapper" onmouseenter="Cart.UpdateMiniCart('miniCartWrapper', 'miniCart', 'cartCounter', '/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart')"> 564 <div class="mini-cart dw-mod"> 565 <a href="/Default.aspx?ID=@cartPageId&Purge=True" id="miniCartCounterWrap" class="menu__link menu__link--icon menu__link--mobile dw-mod js-mini-cart-button u-w50px"> 566 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue"></i> 567 <div class="mini-cart__counter mini-cart__counter--inline dw-mod"> 568 <div class="js-handlebars-root js-mini-cart-counter mobile-cart-wrap" id="cartCounter" data-template="MiniMobileCartCounterContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=Counter" data-init-onload="false" data-preloader="false"> 569 <div class="js-mini-cart-counter-content sp-mobile-cart-counter u-brand-color-five--bg"> 570 @Model.Cart.TotalProductsCount.ToString() 571 </div> 572 </div> 573 </div> 574 </a> 575 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 576 { 577 <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> 578 } 579 </div> 580 </li> 581 } 582 583 @helper RenderMobileTopSearchBar() 584 { 585 string searchFeedId = ""; 586 string searchSecondFeedId = ""; 587 int groupsFeedId; 588 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 589 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 590 string resultPageLink; 591 string searchPlaceholder; 592 string searchType = "product-search"; 593 string searchTemplate; 594 string searchContentTemplate = ""; 595 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 596 bool showGroups = true; 597 598 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 599 { 600 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 601 resultPageLink = contentSearchPageLink; 602 searchPlaceholder = Translate("Search page"); 603 groupsFeedId = 0; 604 searchType = "content-search"; 605 searchTemplate = "SearchPagesTemplate"; 606 showGroups = false; 607 } 608 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 609 { 610 searchFeedId = productsPageId + "&feed=true"; 611 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 612 resultPageLink = Converter.ToString(productsPageId); 613 searchPlaceholder = Translate("Search products or pages"); 614 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 615 searchType = "combined-search"; 616 searchTemplate = "SearchProductsTemplateWrap"; 617 searchContentTemplate = "SearchPagesTemplateWrap"; 618 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 619 } 620 else 621 { 622 resultPageLink = Converter.ToString(productsPageId); 623 searchFeedId = productsPageId + "&feed=true"; 624 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 625 searchPlaceholder = Translate("Search products"); 626 searchTemplate = "SearchProductsTemplateWrap"; 627 searchType = "product-search"; 628 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 629 } 630 631 632 <input type="checkbox" id="MobileSearchTrigger" class="mobile-search-trigger" /> 633 634 <div class="main-navigation-mobile typeahead-mobile dw-mod"> 635 <div class="center-container top-container__center-container dw-mod"> 636 <div class="grid"> 637 <div class="grid__col-auto" style="position:initial;"> 638 <div class="typeahead-mobile__search-field dw-mod js-typeahead sp-mobile-search" 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="@resultPageLink" data-search-type="@searchType"> 639 <div style="display:flex;justify-content:space-between"> 640 <input type="text" class="js-typeahead-search-field u-no-margin u-full-width" placeholder="@searchPlaceholder" value="@searchValue"> 641 <button type="button" class="btn btn--condensed btn--primary u-no-margin u-margin-left dw-mod js-typeahead-enter-btn"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue"></i></button> 642 </div> 643 @if (string.IsNullOrEmpty(searchSecondFeedId)) 644 { 645 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod u-padding" id="MobileProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></ul> 646 } 647 else 648 { 649 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--combined-mobile grid"> 650 <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> 651 <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> 652 </div> 653 } 654 </div> 655 </div> 656 <div class="grid__col-auto-width"> 657 <ul class="menu dw-mod"> 658 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 659 <label for="MobileSearchTrigger" class="menu__link menu__link--icon menu__link--mobile dw-mod"> 660 <i class="fas fa-times fa-1_5x"></i> 661 </label> 662 </li> 663 </ul> 664 </div> 665 </div> 666 </div> 667 </div> 668 } </text> 669 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 670 671 @using System 672 @using System.Web 673 @using System.Collections.Generic 674 @using Dynamicweb.Rapido.Blocks.Extensibility 675 @using Dynamicweb.Rapido.Blocks 676 677 @functions { 678 BlocksPage mobileNavigationBlocksPage = BlocksPage.GetBlockPage("Master"); 679 } 680 681 @{ 682 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 683 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 684 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 685 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 686 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 687 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 688 689 Block mobileNavigation = new Block() 690 { 691 Id = "MobileNavigation", 692 SortId = 10, 693 Template = MobileNavigation(), 694 SkipRenderBlocksList = true 695 }; 696 mobileNavigationBlocksPage.Add(MasterBlockId.MasterTopSnippets, mobileNavigation); 697 698 if (Model.CurrentUser.ID > 0 && !hideMyProfileLink) 699 { 700 Block mobileNavigationSignIn = new Block 701 { 702 Id = "MobileNavigationSignIn", 703 SortId = 10, 704 Template = RenderMobileNavigationSignIn() 705 }; 706 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationSignIn); 707 } 708 709 Block mobileNavigationMenu = new Block 710 { 711 Id = "MobileNavigationMenu", 712 SortId = 20, 713 Template = RenderMobileNavigationMenu() 714 }; 715 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationMenu); 716 717 Block mobileNavigationActions = new Block 718 { 719 Id = "MobileNavigationActions", 720 SortId = 30, 721 Template = RenderMobileNavigationActions(), 722 SkipRenderBlocksList = true 723 }; 724 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationActions); 725 726 if (!navigationItemsHideSignIn) 727 { 728 if (Model.CurrentUser.ID <= 0) 729 { 730 Block mobileNavigationSignInAction = new Block 731 { 732 Id = "MobileNavigationSignInAction", 733 SortId = 10, 734 Template = RenderMobileNavigationSignInAction() 735 }; 736 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignInAction); 737 738 if (!hideCreateAccountLink) 739 { 740 Block mobileNavigationCreateAccountAction = new Block 741 { 742 Id = "MobileNavigationCreateAccountAction", 743 SortId = 20, 744 Template = RenderMobileNavigationCreateAccountAction() 745 }; 746 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationCreateAccountAction); 747 } 748 } 749 else 750 { 751 if (!hideMyOrdersLink) 752 { 753 Block mobileNavigationOrdersAction = new Block 754 { 755 Id = "MobileNavigationOrdersAction", 756 SortId = 20, 757 Template = RenderMobileNavigationOrdersAction() 758 }; 759 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationOrdersAction); 760 } 761 if (!hideMyFavoritesLink) 762 { 763 Block mobileNavigationFavoritesAction = new Block 764 { 765 Id = "MobileNavigationFavoritesAction", 766 SortId = 30, 767 Template = RenderMobileNavigationFavoritesAction() 768 }; 769 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationFavoritesAction); 770 } 771 if (!hideMySavedCardsLink) 772 { 773 Block mobileNavigationSavedCardsAction = new Block 774 { 775 Id = "MobileNavigationSavedCardsAction", 776 SortId = 30, 777 Template = RenderMobileNavigationSavedCardsAction() 778 }; 779 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSavedCardsAction); 780 } 781 782 Block mobileNavigationSignOutAction = new Block 783 { 784 Id = "MobileNavigationSignOutAction", 785 SortId = 40, 786 Template = RenderMobileNavigationSignOutAction() 787 }; 788 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignOutAction); 789 } 790 } 791 792 if (Model.Languages.Count > 1) 793 { 794 Block mobileNavigationLanguagesAction = new Block 795 { 796 Id = "MobileNavigationLanguagesAction", 797 SortId = 50, 798 Template = RenderMobileNavigationLanguagesAction() 799 }; 800 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationLanguagesAction); 801 } 802 } 803 804 805 @helper MobileNavigation() 806 { 807 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigation").OrderBy(item => item.SortId).ToList(); 808 809 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 810 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 811 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 812 string mobileTopDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileTop") != null ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 813 string position = mobileTopDesign == "nav-left" || mobileTopDesign == "nav-search-left" ? "left" : "right"; 814 815 <!-- Trigger for mobile navigation --> 816 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger mobile-nav-trigger--@position" autocomplete="off" /> 817 818 <!-- Mobile navigation --> 819 <nav class="mobile-navigation mobile-navigation--@position dw-mod"> 820 @RenderBlockList(subBlocks) 821 </nav> 822 823 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 824 825 if (!onlyPreview) 826 { 827 <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> 828 } 829 } 830 831 @helper RenderMobileNavigationSignIn() 832 { 833 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 834 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 835 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 836 string myProfilePageLink = linkStart + myProfilePageId; 837 string userName = Model.CurrentUser.FirstName != null ? Model.CurrentUser.FirstName : ""; 838 userName += " " + Model.CurrentUser.LastName != null ? Model.CurrentUser.LastName : ""; 839 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 840 841 <ul class="menu menu-mobile"> 842 <li class="menu-mobile__item"> 843 <a href="@myProfilePageLink" class="menu-mobile__link dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @userName</a> 844 </li> 845 </ul> 846 } 847 848 @helper RenderMobileNavigationMenu() 849 { 850 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 851 string menuTemplate = isSlidesDesign ? "BaseMenuForMobileSlides.xslt" : "BaseMenuForMobileExpandable.xslt"; 852 string levels = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels") : "3"; 853 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 854 int startLevel = renderPagesInToolBar ? 1 : 0; 855 856 @RenderNavigation(new 857 { 858 id = "mobilenavigation", 859 cssclass = "menu menu-mobile dwnavigation", 860 startLevel = @startLevel, 861 ecomStartLevel = @startLevel + 1, 862 endlevel = @levels, 863 expandmode = "all", 864 template = @menuTemplate 865 }) 866 867 if (renderPagesInToolBar) 868 { 869 @RenderNavigation(new 870 { 871 id = "topToolsMobileNavigation", 872 cssclass = "menu menu-mobile dwnavigation", 873 template = "ToolsMenuForMobile.xslt" 874 }) 875 } 876 } 877 878 @helper RenderMobileNavigationActions() 879 { 880 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigationActions").OrderBy(item => item.SortId).ToList(); ; 881 882 <ul class="menu menu-mobile"> 883 @RenderBlockList(subBlocks) 884 </ul> 885 } 886 887 @helper RenderMobileNavigationSignInAction() 888 { 889 <li class="menu-mobile__item"> 890 <label for="SignInModalTrigger" onclick="document.getElementById('MobileNavTrigger').checked = false;" class="menu-mobile__link dw-mod menu-mobile__link--highlighted"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("Sign in")</label> 891 </li> 892 } 893 894 @helper RenderMobileNavigationCreateAccountAction() 895 { 896 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 897 898 <li class="menu-mobile__item"> 899 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Default.aspx?ID=@createAccountPageId"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("Create account")</a> 900 </li> 901 } 902 903 @helper RenderMobileNavigationProfileAction() 904 { 905 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 906 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 907 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 908 string myProfilePageLink = linkStart + myProfilePageId; 909 910 <li class="menu-mobile__item"> 911 <a href="@myProfilePageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("My Profile")</a> 912 </li> 913 } 914 915 @helper RenderMobileNavigationOrdersAction() 916 { 917 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 918 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 919 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 920 string myOrdersPageLink = linkStart + myOrdersPageId; 921 922 <li class="menu-mobile__item"> 923 <a href="@myOrdersPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="fas fa-list menu-mobile__link-icon"></i> @Translate("My Orders")</a> 924 </li> 925 } 926 927 @helper RenderMobileNavigationFavoritesAction() 928 { 929 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 930 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 931 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 932 string myFavoritesPageLink = linkStart + myFavoritesPageId; 933 string favoritesIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue : "fa fa-star"; 934 935 936 <li class="menu-mobile__item"> 937 <a href="@myFavoritesPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@favoritesIcon menu-mobile__link-icon"></i> @Translate("My Favorites")</a> 938 </li> 939 } 940 941 @helper RenderMobileNavigationSavedCardsAction() 942 { 943 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 944 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 945 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 946 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 947 string savedCardsIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SavedCards") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SavedCards").SelectedValue : "fas fa-credit-card"; 948 949 <li class="menu-mobile__item"> 950 <a href="@mySavedCardsPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@savedCardsIcon menu-mobile__link-icon"></i> @Translate("My Saved Cards")</a> 951 </li> 952 } 953 954 @helper RenderMobileNavigationSignOutAction() 955 { 956 int pageId = Model.TopPage.ID; 957 string signOutIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignOutIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignOutIcon").SelectedValue : "far fa-sign-out-alt"; 958 959 960 <li class="menu-mobile__item"> 961 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId"><i class="@signOutIcon menu-mobile__link-icon"></i> @Translate("Sign out")</a> 962 </li> 963 } 964 965 @helper RenderMobileNavigationLanguagesAction() 966 { 967 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 968 969 string selectedLanguage = ""; 970 foreach (var lang in Model.Languages) 971 { 972 if (lang.IsCurrent) 973 { 974 selectedLanguage = lang.Name; 975 } 976 } 977 978 <li class="menu-mobile__item dw-mod"> 979 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 980 <div class="menu-mobile__link__wrap"> 981 <label for="MobileMenuCheck_Language" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("LanguageIcon").SelectedValue menu-mobile__link-icon"></i> @selectedLanguage</label> 982 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger"></label> 983 </div> 984 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 985 @if (isSlidesDesign) 986 { 987 <li class="menu-mobile__item dw-mod"> 988 <div class="menu-mobile__link__wrap"> 989 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger menu-mobile__trigger--back"></label> 990 <label for="MobileMenuCheck_Language" class="menu-mobile__link dw-mod ">@Translate("Back")</label> 991 </div> 992 </li> 993 } 994 @foreach (var lang in Model.Languages) 995 { 996 <li class="menu-mobile__item dw-mod"> 997 <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> 998 </li> 999 } 1000 </ul> 1001 </li> 1002 }</text> 1003 } 1004 else 1005 { 1006 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 1007 1008 @using System 1009 @using System.Web 1010 @using System.Collections.Generic 1011 @using Dynamicweb.Rapido.Blocks.Extensibility 1012 @using Dynamicweb.Rapido.Blocks 1013 1014 @functions { 1015 BlocksPage headerBlocksPage = BlocksPage.GetBlockPage("Master"); 1016 } 1017 1018 @{ 1019 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 1020 bool navigationActionHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 1021 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideFavorites"); 1022 bool showSearchIcon = false; 1023 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1024 1025 if (topLayout == "minimal" || topLayout == "minimal-right" || topLayout == "two-lines" || topLayout == "two-lines-centered") 1026 { 1027 showSearchIcon = true; 1028 } 1029 bool headerOnlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 1030 1031 if (renderPagesInToolBar && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 1032 { 1033 Block masterTools = new Block() 1034 { 1035 Id = "MasterDesktopTools", 1036 SortId = 10, 1037 Template = RenderDesktopTools(), 1038 SkipRenderBlocksList = true, 1039 BlocksList = new List<Block> 1040 { 1041 new Block { 1042 Id = "MasterDesktopToolsText", 1043 SortId = 10, 1044 Template = RenderDesktopToolsText(), 1045 Design = new Design 1046 { 1047 Size = "auto", 1048 HidePadding = true, 1049 RenderType = RenderType.Column 1050 } 1051 }, 1052 new Block { 1053 Id = "MasterDesktopToolsNavigation", 1054 SortId = 20, 1055 Template = RenderDesktopToolsNavigation(), 1056 Design = new Design 1057 { 1058 Size = "auto-width", 1059 HidePadding = true, 1060 RenderType = RenderType.Column 1061 } 1062 } 1063 } 1064 }; 1065 headerBlocksPage.Add(MasterBlockId.MasterHeader, masterTools); 1066 }; 1067 1068 Block masterDesktopExtra = new Block() 1069 { 1070 Id = "MasterDesktopExtra", 1071 SortId = 10, 1072 Template = RenderDesktopExtra(), 1073 SkipRenderBlocksList = true 1074 }; 1075 headerBlocksPage.Add(MasterBlockId.MasterHeader, masterDesktopExtra); 1076 1077 Block masterDesktopNavigation = new Block() 1078 { 1079 Id = "MasterDesktopNavigation", 1080 SortId = 20, 1081 Template = RenderDesktopNavigation(), 1082 SkipRenderBlocksList = true 1083 }; 1084 headerBlocksPage.Add(MasterBlockId.MasterHeader, masterDesktopNavigation); 1085 1086 Block masterDesktopLogo = new Block 1087 { 1088 Id = "MasterDesktopLogo", 1089 SortId = 10, 1090 Template = RenderDesktopLogo(), 1091 Design = new Design 1092 { 1093 Size = "auto-width", 1094 HidePadding = true, 1095 RenderType = RenderType.Column 1096 } 1097 }; 1098 1099 Block masterDesktopMenu = new Block 1100 { 1101 Id = "MasterDesktopMenu", 1102 SortId = 20, 1103 Template = RenderDesktopMenu(), 1104 Design = new Design() 1105 { 1106 Size = "auto", 1107 HidePadding = true, 1108 RenderType = RenderType.Column 1109 } 1110 }; 1111 1112 Block masterDesktopActionsMenuContainer = new Block 1113 { 1114 Id = "MasterDesktopActionsMenuContainer", 1115 SortId = 30, 1116 Design = new Design 1117 { 1118 RenderType = RenderType.Column, 1119 Size = "auto" 1120 } 1121 }; 1122 1123 Block masterDesktopActionsMenu = new Block 1124 { 1125 Id = "MasterDesktopActionsMenu", 1126 SortId = 10, 1127 Template = RenderDesktopActionsMenu(), 1128 SkipRenderBlocksList = true 1129 }; 1130 1131 if (!navigationActionHideSearch && showSearchIcon) 1132 { 1133 Block masterDesktopActionsMenuSearch = new Block 1134 { 1135 Id = "MasterDesktopActionsMenuSearch", 1136 SortId = 10, 1137 Template = RenderMiniSearch() 1138 }; 1139 masterDesktopActionsMenu.Add(masterDesktopActionsMenuSearch); 1140 } 1141 1142 Block masterDesktopActionsMenuSignIn = new Block 1143 { 1144 Id = "MasterDesktopActionsMenuSignIn", 1145 SortId = 20, 1146 Template = RenderSignIn() 1147 }; 1148 masterDesktopActionsMenu.Add(masterDesktopActionsMenuSignIn); 1149 1150 if (!hideMyFavoritesLink && Model.CurrentUser.ID > 0) 1151 { 1152 Block masterDesktopActionsMenuFavorites = new Block 1153 { 1154 Id = "MasterDesktopActionsMenuFavorites", 1155 SortId = 30, 1156 Template = RenderFavorites() 1157 }; 1158 masterDesktopActionsMenu.Add(masterDesktopActionsMenuFavorites); 1159 } 1160 1161 Block masterDesktopActionsMenuLanguageSelector = new Block 1162 { 1163 Id = "MasterDesktopActionsMenuLanguageSelector", 1164 SortId = 40, 1165 Template = RenderLanguageSelector() 1166 }; 1167 masterDesktopActionsMenu.Add(masterDesktopActionsMenuLanguageSelector); 1168 1169 if (!headerOnlyPreview) 1170 { 1171 Block masterDesktopActionsMenuMiniCart = new Block 1172 { 1173 Id = "MasterDesktopActionsMenuMiniCart", 1174 SortId = 50, 1175 Template = RenderMiniCart() 1176 }; 1177 masterDesktopActionsMenu.Add(masterDesktopActionsMenuMiniCart); 1178 } 1179 1180 if (!string.IsNullOrWhiteSpace(Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonLink"))) 1181 { 1182 Block masterDesktopActionsHeaderButton = new Block 1183 { 1184 Id = "MasterDesktopActionsHeaderButton", 1185 SortId = 60, 1186 Template = RenderHeaderButton() 1187 }; 1188 masterDesktopActionsMenu.Add(masterDesktopActionsHeaderButton); 1189 } 1190 1191 Block searchBar = new Block() 1192 { 1193 Id = "SearchBar", 1194 SortId = 40, 1195 Template = RenderSearchBar(), 1196 Design = new Design() 1197 { 1198 Size = "auto", 1199 HidePadding = true, 1200 RenderType = RenderType.Column 1201 } 1202 }; 1203 1204 if (Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) 1205 { 1206 Block impersonationBar = new Block() 1207 { 1208 Id = "ImpersonationBar", 1209 SortId = 50, 1210 Template = RenderImpersonationBar(), 1211 Design = new Design() 1212 { 1213 Size = "auto-width", 1214 HidePadding = true, 1215 RenderType = RenderType.Column 1216 } 1217 }; 1218 headerBlocksPage.Add(MasterBlockId.MasterHeader, impersonationBar); 1219 } 1220 1221 switch (topLayout) 1222 { 1223 case "condensed": //2 1224 masterDesktopLogo.SortId = 10; 1225 masterDesktopLogo.Design.Size = "auto-width"; 1226 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopLogo); 1227 masterDesktopMenu.SortId = 20; 1228 masterDesktopMenu.Design.Size = "auto"; 1229 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1230 masterDesktopActionsMenuContainer.SortId = 30; 1231 masterDesktopActionsMenuContainer.Design.Size = "auto-width"; 1232 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopActionsMenuContainer); 1233 if (!navigationActionHideSearch) 1234 { 1235 searchBar.SortId = 40; 1236 searchBar.Design.Size = "12"; 1237 masterDesktopExtra.SortId = 50; 1238 headerBlocksPage.Add("MasterDesktopExtra", searchBar); 1239 } 1240 break; 1241 case "minimal": //4 1242 masterDesktopLogo.SortId = 10; 1243 masterDesktopLogo.Design.Size = "auto-width"; 1244 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopLogo); 1245 masterDesktopMenu.SortId = 10; 1246 masterDesktopMenu.Design.Size = "auto"; 1247 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1248 masterDesktopActionsMenuContainer.SortId = 20; 1249 masterDesktopActionsMenuContainer.Design.Size = "auto-width"; 1250 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopActionsMenuContainer); 1251 break; 1252 case "minimal-right": //5 1253 masterDesktopLogo.SortId = 10; 1254 masterDesktopLogo.Design.Size = "auto-width"; 1255 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopLogo); 1256 masterDesktopMenu.SortId = 10; 1257 masterDesktopMenu.Design.Size = "auto"; 1258 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1259 masterDesktopActionsMenuContainer.SortId = 20; 1260 masterDesktopActionsMenuContainer.Design.Size = "auto-width"; 1261 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopActionsMenuContainer); 1262 break; 1263 case "two-lines": //6 1264 masterDesktopLogo.SortId = 10; 1265 masterDesktopLogo.Design.Size = "auto"; 1266 headerBlocksPage.Add("MasterDesktopExtra", masterDesktopLogo); 1267 masterDesktopMenu.SortId = 10; 1268 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1269 masterDesktopActionsMenuContainer.SortId = 20; 1270 masterDesktopActionsMenuContainer.Design.Size = "auto-width"; 1271 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopActionsMenuContainer); 1272 break; 1273 case "two-lines-centered": //7 1274 masterDesktopLogo.SortId = 10; 1275 masterDesktopLogo.Design.Size = "auto"; 1276 headerBlocksPage.Add("MasterDesktopExtra", masterDesktopLogo); 1277 masterDesktopMenu.SortId = 10; 1278 masterDesktopMenu.Design.Size = "auto"; 1279 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1280 masterDesktopActionsMenuContainer.SortId = 20; 1281 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopActionsMenuContainer); 1282 break; 1283 case "splitted": //3 1284 masterDesktopLogo.SortId = 10; 1285 masterDesktopLogo.Design.Size = "auto"; 1286 headerBlocksPage.Add("MasterDesktopExtra", masterDesktopLogo); 1287 if (!navigationActionHideSearch) 1288 { 1289 searchBar.SortId = 20; 1290 searchBar.Design.Size = "auto"; 1291 headerBlocksPage.Add("MasterDesktopExtra", searchBar); 1292 } 1293 masterDesktopMenu.SortId = 10; 1294 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1295 masterDesktopActionsMenuContainer.SortId = 20; 1296 masterDesktopActionsMenuContainer.Design.Size = "auto-width"; 1297 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopActionsMenuContainer); 1298 break; 1299 case "normal": //1 1300 default: 1301 masterDesktopLogo.SortId = 10; 1302 headerBlocksPage.Add("MasterDesktopExtra", masterDesktopLogo); 1303 if (!navigationActionHideSearch) 1304 { 1305 searchBar.SortId = 20; 1306 headerBlocksPage.Add("MasterDesktopExtra", searchBar); 1307 } 1308 masterDesktopActionsMenuContainer.SortId = 30; 1309 headerBlocksPage.Add("MasterDesktopExtra", masterDesktopActionsMenuContainer); 1310 masterDesktopMenu.SortId = 10; 1311 masterDesktopActionsMenuContainer.Design.Size = "auto-width"; 1312 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1313 break; 1314 } 1315 1316 headerBlocksPage.Add("MasterDesktopActionsMenuContainer", masterDesktopActionsMenu); 1317 } 1318 1319 @helper RenderDesktopTools() 1320 { 1321 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopTools").OrderBy(item => item.SortId).ToList(); 1322 1323 <div class="tools-navigation dw-mod"> 1324 <div class="center-container grid top-container__center-container dw-mod"> 1325 @RenderBlockList(subBlocks) 1326 </div> 1327 </div> 1328 } 1329 1330 @helper RenderDesktopToolsText() 1331 { 1332 string toolsText = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("ToolsText"); 1333 1334 <div class="u-margin-top">@toolsText</div> 1335 } 1336 1337 @helper RenderDesktopToolsNavigation() 1338 { 1339 <div> 1340 @RenderNavigation(new 1341 { 1342 id = "topToolsNavigation", 1343 cssclass = "menu menu-tools dw-mod dwnavigation", 1344 template = "TopMenu.xslt" 1345 }) 1346 </div> 1347 } 1348 1349 @helper RenderDesktopNavigation() 1350 { 1351 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopNavigation").OrderBy(item => item.SortId).ToList(); 1352 1353 <nav class="main-navigation dw-mod"> 1354 <div class="center-container top-container__center-container grid grid--align-center dw-mod"> 1355 @RenderBlockList(subBlocks) 1356 </div> 1357 </nav> 1358 } 1359 1360 @helper RenderDesktopExtra() 1361 { 1362 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopExtra").OrderBy(item => item.SortId).ToList(); 1363 1364 if (subBlocks.Count > 0) 1365 { 1366 <div class="header header-top dw-mod"> 1367 <div class="center-container top-container__center-container grid grid--align-center grid--justify-space-between dw-mod"> 1368 @RenderBlockList(subBlocks) 1369 </div> 1370 </div> 1371 } 1372 } 1373 1374 @helper RenderDesktopLogo() 1375 { 1376 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 1377 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1378 string alignClass = topLayout == "two-lines-centered" || topLayout == "two-lines" ? "grid--align-self-center" : ""; 1379 string logo = Model.Area.Item.GetItem("Layout").GetFile("LogoImage") != null ? Model.Area.Item.GetItem("Layout").GetFile("LogoImage").PathUrlEncoded : "/Files/Images/logo-dynamicweb.png"; 1380 string logoHeight = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetString("LogoHeight")) ? Model.Area.Item.GetItem("Layout").GetString("LogoHeight") : "40"; 1381 logoHeight = logoHeight != "0" ? logoHeight : "40"; 1382 if (Path.GetExtension(logo).ToLower() != ".svg") 1383 { 1384 logo = "/Admin/Public/GetImage.ashx?height=" + logoHeight + "&amp;crop=5&amp;Compression=75&amp;image=" + logo; 1385 1386 if (Pageview.Device.ToString() == "Mobile") 1387 { 1388 logoHeight = "40"; 1389 } 1390 } 1391 else 1392 { 1393 logo = HttpUtility.UrlDecode(logo); 1394 } 1395 1396 <div class="logo @alignClass dw-mod"> 1397 <a href="/Default.aspx?ID=@firstPageId" class="logo__img dw-mod u-block"> 1398 <img class="grid__cell-img logo__img dw-mod" src="@logo" /> 1399 </a> 1400 </div> 1401 } 1402 1403 @helper RenderDesktopMenu() 1404 { 1405 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1406 string menuAlignment = topLayout == "two-lines-centered" || topLayout == "minimal-right" ? "u-pull--right" : ""; 1407 1408 bool megaMenu = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("NavigationMegaMenu").SelectedValue.ToLower() == "true" ? true : false; 1409 string megamenuPromotionImage = Model.Area.Item.GetItem("Layout").GetItem("Header").GetFile("MegamenuPromotionImage") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetFile("MegamenuPromotionImage").PathUrlEncoded : ""; 1410 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 1411 int startLevel = renderPagesInToolBar ? 1 : 0; 1412 1413 <div class="grid__cell"> 1414 <div class="@menuAlignment"> 1415 @if (!megaMenu) 1416 { 1417 @RenderNavigation(new 1418 { 1419 id = "topnavigation", 1420 cssclass = "menu dw-mod dwnavigation u-full-max-width", 1421 startLevel = @startLevel, 1422 ecomStartLevel = @startLevel + 1, 1423 endlevel = 5, 1424 expandmode = "all", 1425 template = "BaseMenuWithDropdown.xslt" 1426 }); 1427 } 1428 else 1429 { 1430 @RenderNavigation(new 1431 { 1432 id = "topnavigation", 1433 cssclass = "menu dw-mod dwnavigation u-full-max-width", 1434 startLevel = @startLevel, 1435 ecomStartLevel = @startLevel + 1, 1436 endlevel = 5, 1437 promotionImage = megamenuPromotionImage, 1438 promotionLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("MegamenuPromotionLink"), 1439 expandmode = "all", 1440 template = "BaseMegaMenu.xslt" 1441 }); 1442 } 1443 </div> 1444 </div> 1445 } 1446 1447 @helper RenderDesktopActionsMenu() 1448 { 1449 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopActionsMenu").OrderBy(item => item.SortId).ToList(); 1450 1451 <ul class="menu dw-mod"> 1452 @RenderBlockList(subBlocks) 1453 </ul> 1454 } 1455 1456 @helper RenderLanguageSelector() 1457 { 1458 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1459 string liClasses = topLayout != "normal" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod u-hidden-xxs" : "menu__item menu__item--horizontal menu--clean dw-mod"; 1460 string menuLinkClass = topLayout != "normal" ? "menu__link" : "header-menu__link"; 1461 string languageViewType = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("LanguageSelector").SelectedValue) ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("LanguageSelector").SelectedValue.ToLower() : ""; 1462 1463 if (Model.Languages.Count > 1) 1464 { 1465 <li class="@liClasses is-dropdown is-dropdown--no-icon"> 1466 <div class="@menuLinkClass menu__link--icon dw-mod"> 1467 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("LanguageIcon").SelectedValue fa-1_5x"></i> 1468 </div> 1469 <div class="menu menu--dropdown dw-mod"> 1470 @foreach (var lang in Model.Languages) 1471 { 1472 string langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>" + lang.Name; 1473 1474 if (languageViewType == "flag") 1475 { 1476 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + "\"></span>"; 1477 } 1478 1479 if (languageViewType == "name") 1480 { 1481 langInfo = lang.Name; 1482 } 1483 1484 <a href="/Default.aspx?AreaID=@Dynamicweb.Services.Pages.GetPage(lang.Page.ID).Area.ID&SetLang=true" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 1485 } 1486 </div> 1487 </li> 1488 } 1489 } 1490 1491 @helper RenderMiniCart() 1492 { 1493 bool navigationItemsHideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 1494 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 1495 int cartPageId = GetPageIdByNavigationTag("CartPage"); 1496 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 1497 1498 if (!onlyPreview && !navigationItemsHideCart) 1499 { 1500 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1501 string liClasses = topLayout != "normal" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod" : "menu__item menu__item--horizontal menu--clean dw-mod"; 1502 string menuLinkClass = topLayout != "normal" ? "menu__link" : "header-menu__link"; 1503 string cartProductsCount = Model.Cart.TotalProductsCount.ToString(); 1504 string counterPosition = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue; 1505 bool showPrice = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 1506 string cartProductsTotalPrice = showPrice && Model.Cart.TotalPrice != null ? Model.Cart.TotalPrice.Price.Formatted : ""; 1507 cartProductsTotalPrice = counterPosition == "right" ? cartProductsTotalPrice : ""; 1508 1509 if (showPrice && counterPosition == "right") 1510 { 1511 cartProductsCount = Translate("Cart") + "(" + cartProductsCount + ")"; 1512 } 1513 1514 1515 <li class="@liClasses" id="miniCartWrapper" onmouseenter="Cart.UpdateMiniCart('miniCartWrapper', 'miniCart', 'cartCounter', '/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart')"> 1516 <div class="mini-cart dw-mod"> 1517 <a href="/Default.aspx?ID=@cartPageId&Purge=True" id="miniCartCounterWrap" class="@menuLinkClass menu__link--icon dw-mod js-mini-cart-button"> 1518 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue fa-1_5x"></i> 1519 <div class="mini-cart__counter dw-mod"> 1520 <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"> 1521 <div class="js-mini-cart-counter-content"> 1522 @cartProductsCount 1523 @cartProductsTotalPrice 1524 </div> 1525 </div> 1526 </div> 1527 </a> 1528 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 1529 { 1530 <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> 1531 } 1532 </div> 1533 </li> 1534 } 1535 } 1536 1537 @helper RenderSignIn() 1538 { 1539 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 1540 string userInitials = ""; 1541 int pageId = Model.TopPage.ID; 1542 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 1543 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 1544 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 1545 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 1546 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 1547 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 1548 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 1549 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 1550 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 1551 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 1552 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 1553 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 1554 1555 string linkStart = "/Default.aspx?ID="; 1556 if (Model.CurrentUser.ID <= 0) 1557 { 1558 linkStart = linkStart + signInProfilePageId + "&RedirectPageId="; 1559 } 1560 1561 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 1562 string myProfilePageLink = linkStart + myProfilePageId; 1563 string myOrdersPageLink = linkStart + myOrdersPageId; 1564 string myFavoritesPageLink = linkStart + myFavoritesPageId; 1565 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 1566 1567 if (Model.CurrentUser.ID != 0) 1568 { 1569 if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) 1570 { 1571 string[] names = Model.CurrentUser.Name.Split(' '); 1572 userInitials += Model.CurrentUser.Name.Substring(0, 1); 1573 1574 if (names.Length > 1) 1575 { 1576 userInitials += names[names.Length - 1].Substring(0, 1); 1577 } 1578 } 1579 else 1580 { 1581 userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; 1582 userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; 1583 userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; 1584 userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; 1585 userInitials += userInitials == "" ? Model.CurrentUser.UserName.Substring(0, 2) : ""; 1586 } 1587 } 1588 1589 if (!navigationItemsHideSignIn) 1590 { 1591 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1592 string liClasses = topLayout != "normal" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod u-hidden-xxs" : "menu__item menu__item--horizontal menu__item--clean dw-mod"; 1593 string menuLinkClass = topLayout != "normal" ? "menu__link" : "header-menu__link"; 1594 1595 <li class="@liClasses is-dropdown is-dropdown--no-icon"> 1596 <div class="@menuLinkClass menu__link--icon dw-mod"> 1597 @if (Model.CurrentUser.ID <= 0) 1598 { 1599 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue fa-1_5x"></i> 1600 } 1601 else 1602 { 1603 <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit"><div class="circle-icon-btn">@userInitials.ToUpper()</div></a> 1604 } 1605 </div> 1606 <div class="menu menu--dropdown sign-in-dropdown dw-mod"> 1607 <ul class="list list--clean dw-mod"> 1608 @if (Model.CurrentUser.ID <= 0) 1609 { 1610 <li> 1611 <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> 1612 </li> 1613 if (!hideCreateAccountLink) 1614 { 1615 <li> 1616 <a href="/default.aspx?ID=@createAccountPageId" class="list__link dw-mod">@Translate("Create account")</a> 1617 </li> 1618 } 1619 <li> 1620 <a href="@forgotPasswordPageLink" class="list__link dw-mod">@Translate("Forgot your password?")</a> 1621 </li> 1622 if (!hideMyProfileLink || !hideMyOrdersLink || !hideMyFavoritesLink || !hideMySavedCardsLink) 1623 { 1624 <li class="list__seperator dw-mod"></li> 1625 } 1626 } 1627 @if (!hideMyProfileLink) 1628 { 1629 <li> 1630 <a href="@myProfilePageLink" class="list__link dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue u-margin-right"></i>@Translate("My Profile")</a> 1631 </li> 1632 } 1633 @if (!hideMyOrdersLink) 1634 { 1635 <li> 1636 <a href="@myOrdersPageLink" class="list__link dw-mod"><i class="fas fa-list u-margin-right"></i>@Translate("My Orders")</a> 1637 </li> 1638 } 1639 @if (!hideMyFavoritesLink) 1640 { 1641 <li> 1642 <a href="@myFavoritesPageLink" class="list__link dw-mod"><i class="fas fa-@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue u-margin-right"></i>@Translate("My Favorites")</a> 1643 </li> 1644 } 1645 @if (!hideMySavedCardsLink) 1646 { 1647 <li> 1648 <a href="@mySavedCardsPageLink" class="list__link dw-mod"><i class="fas fa-credit-card u-margin-right"></i>@Translate("My Saved cards")</a> 1649 </li> 1650 } 1651 @if (Model.CurrentUser.ID > 0) 1652 { 1653 if (!hideMyProfileLink || !hideMyOrdersLink || !hideMyFavoritesLink || !hideMySavedCardsLink) 1654 { 1655 <li class="list__seperator dw-mod"></li> 1656 } 1657 <li> 1658 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId" class="list__link dw-mod">@Translate("Sign out")</a> 1659 </li> 1660 } 1661 </ul> 1662 </div> 1663 </li> 1664 } 1665 } 1666 1667 @helper RenderFavorites() 1668 { 1669 bool navigationItemsHideFavorites = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideFavorites"); 1670 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 1671 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 1672 1673 string linkStart = "/Default.aspx?ID="; 1674 if (Model.CurrentUser.ID <= 0) 1675 { 1676 linkStart = linkStart + signInProfilePageId + "&RedirectPageId="; 1677 } 1678 1679 string myFavoritesPageLink = linkStart + myFavoritesPageId; 1680 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1681 string liClasses = topLayout != "normal" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod u-hidden-xxs" : "menu__item menu__item--horizontal menu--clean dw-mod"; 1682 string menuLinkClass = topLayout != "normal" ? "menu__link" : "header-menu__link"; 1683 1684 <li class="@liClasses"> 1685 <a href="@myFavoritesPageLink" class="@menuLinkClass menu__link--icon dw-mod"> 1686 <i class="fas fa-@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue fa-1_5x"></i> 1687 </a> 1688 </li> 1689 } 1690 1691 @helper RenderHeaderButton() 1692 { 1693 string headerButtonText = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonText"); 1694 string headerButtonLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonLink"); 1695 string headerButtonType = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("HeaderButtonType") != null ? "btn--" + Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("HeaderButtonType").SelectedName.ToLower() : ""; 1696 1697 <li class="menu__item menu__item--horizontal menu--clean dw-mod"> 1698 <a class="btn @headerButtonType dw-mod u-no-margin u-margin-top u-margin-left" href="@headerButtonLink">@headerButtonText</a> 1699 </li> 1700 } 1701 1702 @helper RenderSearchBar(string alignment = "left") 1703 { 1704 string searchFeedId = ""; 1705 string searchSecondFeedId = ""; 1706 int groupsFeedId; 1707 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 1708 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 1709 string resultPageLink; 1710 string searchPlaceholder; 1711 string searchType = "product-search"; 1712 string searchTemplate; 1713 string searchContentTemplate = ""; 1714 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") != null ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 1715 bool showGroups = true; 1716 1717 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 1718 { 1719 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 1720 resultPageLink = contentSearchPageLink; 1721 searchPlaceholder = Translate("Search page"); 1722 groupsFeedId = 0; 1723 searchType = "content-search"; 1724 searchTemplate = "SearchPagesTemplate"; 1725 showGroups = false; 1726 } 1727 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 1728 { 1729 searchFeedId = productsPageId + "&feed=true"; 1730 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 1731 resultPageLink = Converter.ToString(productsPageId); 1732 searchPlaceholder = Translate("Search products or pages"); 1733 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 1734 searchType = "combined-search"; 1735 searchTemplate = "SearchProductsTemplateWrap"; 1736 searchContentTemplate = "SearchPagesTemplateWrap"; 1737 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 1738 } 1739 else 1740 { 1741 resultPageLink = Converter.ToString(productsPageId); 1742 searchFeedId = productsPageId + "&feed=true"; 1743 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 1744 searchPlaceholder = Translate("Search products"); 1745 searchTemplate = "SearchProductsTemplate"; 1746 searchType = "product-search"; 1747 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 1748 } 1749 1750 <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="@resultPageLink" data-groups-page-id="@groupsFeedId" data-search-type="@searchType"> 1751 @if (showGroups) 1752 { 1753 <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> 1754 <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> 1755 } 1756 <div class="typeahead-search-field"> 1757 <input type="text" class="u-no-margin u-full-width u-full-height js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 1758 @if (string.IsNullOrEmpty(searchSecondFeedId)) 1759 { 1760 <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> 1761 } 1762 else 1763 { 1764 <div class="dropdown dropdown--absolute-position dropdown--combined grid @(alignment == "right" ? "dropdown--right-aligned" : "")"> 1765 <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> 1766 <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> 1767 </div> 1768 } 1769 </div> 1770 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod js-typeahead-enter-btn"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue"></i></button> 1771 </div> 1772 } 1773 1774 @helper RenderMiniSearch() 1775 { 1776 string searchFeedId = ""; 1777 string searchSecondFeedId = ""; 1778 int groupsFeedId; 1779 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 1780 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 1781 string resultPageLink; 1782 string searchPlaceholder; 1783 string searchType = "product-search"; 1784 string searchTemplate; 1785 string searchContentTemplate = ""; 1786 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") != null ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 1787 bool showGroups = true; 1788 1789 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 1790 { 1791 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 1792 resultPageLink = contentSearchPageLink; 1793 searchPlaceholder = Translate("Search page"); 1794 groupsFeedId = 0; 1795 searchType = "content-search"; 1796 searchTemplate = "SearchPagesTemplate"; 1797 showGroups = false; 1798 } 1799 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 1800 { 1801 searchFeedId = productsPageId + "&feed=true"; 1802 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 1803 resultPageLink = Converter.ToString(productsPageId); 1804 searchPlaceholder = Translate("Search products or pages"); 1805 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 1806 searchType = "combined-search"; 1807 searchTemplate = "SearchProductsTemplateWrap"; 1808 searchContentTemplate = "SearchPagesTemplateWrap"; 1809 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 1810 } 1811 else 1812 { 1813 resultPageLink = Converter.ToString(productsPageId); 1814 searchFeedId = productsPageId + "&feed=true"; 1815 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 1816 searchPlaceholder = Translate("Search products"); 1817 searchTemplate = "SearchProductsTemplate"; 1818 searchType = "product-search"; 1819 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 1820 } 1821 1822 <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()"> 1823 <div class="menu__link menu__link--icon dw-mod"> 1824 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue fa-1_5x"></i> 1825 </div> 1826 <div class="menu menu--dropdown u-w380px top-micro-search dw-mod"> 1827 <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="@resultPageLink" data-search-type="@searchType"> 1828 <div class="typeahead-search-field"> 1829 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" id="headerSearch" placeholder="@searchPlaceholder" value="@searchValue"> 1830 @if (string.IsNullOrEmpty(searchSecondFeedId)) 1831 { 1832 <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> 1833 } 1834 else 1835 { 1836 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--right-aligned"> 1837 <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> 1838 <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> 1839 </div> 1840 } 1841 </div> 1842 </div> 1843 </div> 1844 </li> 1845 } 1846 1847 @helper RenderImpersonationBar() 1848 { 1849 int impersonationPageId = GetPageIdByNavigationTag("Impersonation"); 1850 1851 <div class="u-color-warning--bg"> 1852 <div class="center-container top-container__center-container dw-mod"> 1853 @*Impersonation*@ 1854 <div class="grid"> 1855 <div class="grid--align-self-center grid__col-x"> 1856 @if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 1857 { 1858 string stopImpersonateTranslation = Translate("Stop impersonation"); 1859 string username = ""; 1860 if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) 1861 { 1862 username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; 1863 } 1864 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) 1865 { 1866 username = Model.CurrentSecondaryUser.Name; 1867 } 1868 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) 1869 { 1870 username = Model.CurrentSecondaryUser.Email; 1871 } 1872 else 1873 { 1874 username = Model.CurrentSecondaryUser.UserName; 1875 } 1876 <div class="grid-cell"> 1877 <div class="u-pull--left u-bold u-margin-top"> 1878 <i class="fas fa-user-secret"></i> 1879 @Pageview.User.UserName<text>&nbsp;</text>@Translate("is impersonating")<text>&nbsp;</text>@username 1880 </div> 1881 <form method="post" class="u-pull--right u-no-margin"> 1882 <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 1883 </form> 1884 </div> 1885 } 1886 else 1887 { 1888 string viewListTranslation = Translate("View the list of users you can impersonate"); 1889 <div class="grid-cell u-bold"> 1890 <i class="fas fa-user-secret"></i> 1891 <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> 1892 </div> 1893 } 1894 </div> 1895 </div> 1896 </div> 1897 </div> 1898 } 1899 1900 </text> 1901 } 1902 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 1903 1904 @using System 1905 @using System.Web 1906 @using System.Collections.Generic 1907 @using Dynamicweb.Rapido.Blocks.Extensibility 1908 @using Dynamicweb.Rapido.Blocks 1909 1910 @functions { 1911 BlocksPage footerBlocksPage = BlocksPage.GetBlockPage("Master"); 1912 } 1913 1914 @{ 1915 string footerColumnOneContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne").GetString("Content") : ""; 1916 string footerColumnTwoContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo").GetString("Content") : ""; 1917 string footerColumnThreeContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree").GetString("Content") : ""; 1918 string footerColumnOneHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne").GetString("Header") : ""; 1919 string footerColumnTwoHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo").GetString("Header") : ""; 1920 string footerColumnThreeHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree").GetString("Header") : ""; 1921 1922 Block masterFooterContent = new Block() 1923 { 1924 Id = "MasterFooterContent", 1925 SortId = 10, 1926 Template = RenderFooter(), 1927 SkipRenderBlocksList = true 1928 }; 1929 footerBlocksPage.Add(MasterBlockId.MasterFooter, masterFooterContent); 1930 1931 if (!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) 1932 { 1933 Block masterFooterColumnOne = new Block 1934 { 1935 Id = "MasterFooterColumnOne", 1936 SortId = 10, 1937 Template = RenderFooterColumn(footerColumnOneHeader, footerColumnOneContent), 1938 Design = new Design { 1939 Size = "auto", 1940 RenderType = RenderType.Column 1941 } 1942 }; 1943 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnOne); 1944 } 1945 1946 if (!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) 1947 { 1948 Block masterFooterColumnTwo = new Block 1949 { 1950 Id = "MasterFooterColumnTwo", 1951 SortId = 20, 1952 Template = RenderFooterColumn(footerColumnTwoHeader, footerColumnTwoContent), 1953 Design = new Design 1954 { 1955 Size = "auto", 1956 RenderType = RenderType.Column 1957 } 1958 }; 1959 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnTwo); 1960 } 1961 1962 if (!string.IsNullOrEmpty(footerColumnThreeContent) || !string.IsNullOrEmpty(footerColumnThreeHeader)) 1963 { 1964 Block masterFooterColumnThree = new Block 1965 { 1966 Id = "MasterFooterColumnThree", 1967 SortId = 30, 1968 Template = RenderFooterColumn(footerColumnThreeHeader, footerColumnThreeContent), 1969 Design = new Design 1970 { 1971 Size = "auto", 1972 RenderType = RenderType.Column 1973 } 1974 }; 1975 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnThree); 1976 } 1977 1978 if (Model.Area.Item.GetItem("Layout").GetBoolean("FooterNewsletterSignUp")) 1979 { 1980 Block masterFooterNewsletterSignUp = new Block 1981 { 1982 Id = "MasterFooterNewsletterSignUp", 1983 SortId = 40, 1984 Template = RenderFooterNewsletterSignUp(), 1985 Design = new Design 1986 { 1987 Size = "auto", 1988 RenderType = RenderType.Column 1989 } 1990 }; 1991 footerBlocksPage.Add("MasterFooterContent", masterFooterNewsletterSignUp); 1992 } 1993 1994 if (Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks") != null && Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks").Count > 0) 1995 { 1996 Block masterFooterSocialLinks = new Block 1997 { 1998 Id = "MasterFooterSocialLinks", 1999 SortId = 50, 2000 Template = RenderFooterSocialLinks(), 2001 Design = new Design 2002 { 2003 Size = "auto", 2004 RenderType = RenderType.Column 2005 } 2006 }; 2007 footerBlocksPage.Add("MasterFooterContent", masterFooterSocialLinks); 2008 } 2009 2010 if (Model.Area.Item.GetItem("Layout").GetItems("FooterPayments") != null && Model.Area.Item.GetItem("Layout").GetItems("FooterPayments").Count > 0) 2011 { 2012 Block masterFooterPayments = new Block 2013 { 2014 Id = "MasterFooterPayments", 2015 SortId = 60, 2016 Template = RenderFooterPayments(), 2017 Design = new Design 2018 { 2019 Size = "12", 2020 RenderType = RenderType.Column 2021 } 2022 }; 2023 footerBlocksPage.Add("MasterFooterContent", masterFooterPayments); 2024 } 2025 2026 Block masterFooterCopyright = new Block 2027 { 2028 Id = "MasterFooterCopyright", 2029 SortId = 70, 2030 Template = RenderFooterCopyright(), 2031 Design = new Design 2032 { 2033 Size = "12", 2034 RenderType = RenderType.Column 2035 } 2036 }; 2037 footerBlocksPage.Add("MasterFooterContent", masterFooterCopyright); 2038 2039 } 2040 2041 @helper RenderFooter() { 2042 List<Block> subBlocks = this.footerBlocksPage.GetBlockListById("MasterFooterContent").OrderBy(item => item.SortId).ToList(); 2043 2044 <footer class="footer dw-mod"> 2045 <div class="center-container top-container__center-container dw-mod"> 2046 <div class="grid grid--external-bleed-x"> 2047 @RenderBlockList(subBlocks) 2048 </div> 2049 </div> 2050 </footer> 2051 } 2052 2053 @helper RenderFooterColumn(string header, string content) { 2054 <h3 class="footer__heading dw-mod">@header</h3> 2055 <div class="footer__content dw-mod"> 2056 @content 2057 </div> 2058 } 2059 2060 @helper RenderFooterNewsletterSignUp() { 2061 string newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp").ToString(); 2062 2063 <h3 class="footer__heading dw-mod">@Translate("Mailing list")</h3> 2064 <div class="footer__content dw-mod"> 2065 <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> 2066 <form class="form dw-mod" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> 2067 <input name="ID" value="@newsletterSignUpPageId" type="hidden" /> 2068 <div class="form__field-combi"> 2069 <input name="NewsletterEmail" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' /> 2070 <input class="btn btn--primary btn--condensed dw-mod" type="submit" id="Submitter" value='@Translate("Go", "Go")' /> 2071 </div> 2072 </form> 2073 </div> 2074 } 2075 2076 @helper RenderFooterSocialLinks() { 2077 <h3 class="footer__heading dw-mod">@Translate("Social links")</h3> 2078 <div class="footer__content dw-mod"> 2079 <div class="collection dw-mod"> 2080 @foreach (var socialitem in Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks")) 2081 { 2082 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 2083 string socialIconClass = socialIcon.SelectedValue; 2084 string socialIconTitle = socialIcon.SelectedName; 2085 string socialLink = socialitem.GetString("Link"); 2086 2087 <a href="@socialLink" target="_blank" title="@socialIconTitle" class="u-margin-bottom-5px"><i class="@socialIconClass fa-2x"></i></a> 2088 } 2089 </div> 2090 </div> 2091 } 2092 2093 @helper RenderFooterPayments() { 2094 <div class="footer__content dw-mod"> 2095 <div class="collection dw-mod"> 2096 @foreach (var payment in Model.Area.Item.GetItem("Layout").GetItems("FooterPayments")) 2097 { 2098 var paymentItem = payment.GetValue("CardTypeOrVerifiedPayment") as Dynamicweb.Frontend.ListViewModel; 2099 string paymentImage = null; 2100 string paymentTitle = paymentItem.SelectedName; 2101 ListOptionViewModel selected = paymentItem.SelectedOptions.FirstOrDefault(); 2102 if (selected != null) 2103 { 2104 paymentImage = selected.Icon; 2105 } 2106 2107 <div class="footer__card-type"> 2108 <img src="/Admin/Public/GetImage.ashx?width=60&Compression=75&image=@paymentImage" alt="@paymentTitle" title="@paymentTitle" /> 2109 </div> 2110 } 2111 </div> 2112 </div> 2113 } 2114 2115 @helper RenderFooterCopyright() { 2116 <div class="grid__col-12 footer__copyright dw-mod"> 2117 <p>@Model.Area.Item.GetItem("Layout").GetString("FooterCopyrightText")</p> 2118 </div> 2119 } 2120 2121 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2122 2123 @using System 2124 @using System.Web 2125 @using System.Collections.Generic 2126 @using Dynamicweb.Rapido.Blocks.Extensibility 2127 @using Dynamicweb.Rapido.Blocks 2128 2129 @{ 2130 BlocksPage miniCartBlocksPage = BlocksPage.GetBlockPage("Master"); 2131 bool navigationItemsHideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 2132 2133 if (!navigationItemsHideCart) 2134 { 2135 Block miniCartScriptTemplates = new Block() 2136 { 2137 Id = "MasterMiniCartTemplates", 2138 SortId = 1, 2139 Template = RenderMiniCartScriptTemplates(), 2140 SkipRenderBlocksList = true, 2141 BlocksList = new List<Block> 2142 { 2143 new Block { 2144 Id = "MiniCartHeader", 2145 SortId = 10, 2146 Template = RenderMiniCartHeader() 2147 }, 2148 new Block { 2149 Id = "MiniCartOrderLines", 2150 SortId = 20, 2151 Template = RenderMiniCartOrderLines() 2152 }, 2153 new Block { 2154 Id = "MiniCartFees", 2155 SortId = 30, 2156 Template = RenderMiniCartFees() 2157 }, 2158 new Block { 2159 Id = "MiniCartPoints", 2160 SortId = 40, 2161 Template = RenderMiniCartPoints() 2162 }, 2163 new Block { 2164 Id = "MiniCartTotal", 2165 SortId = 50 , 2166 Template = RenderMiniCartTotal() 2167 } 2168 } 2169 }; 2170 2171 miniCartBlocksPage.Add(MasterBlockId.MasterBottomSnippets, miniCartScriptTemplates); 2172 } 2173 } 2174 2175 @helper RenderMiniCartScriptTemplates() 2176 { 2177 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMiniCartTemplates").OrderBy(item => item.SortId).ToList(); 2178 2179 int cartPageId = GetPageIdByNavigationTag("CartPage"); 2180 bool showPriceInMiniCartCounter = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 2181 showPriceInMiniCartCounter = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue == "right" ? showPriceInMiniCartCounter : false; 2182 showPriceInMiniCartCounter = Pageview.Device.ToString() == "Mobile" ? false : showPriceInMiniCartCounter; 2183 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 2184 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 2185 string addingToCartNotification = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType").SelectedValue : ""; 2186 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 2187 2188 2189 <script id="MiniCartCounterContent" type="text/x-template"> 2190 {{#.}} 2191 <div class="js-mini-cart-counter-content dw-mod"> 2192 @if (showPriceInMiniCartCounter) { 2193 @Translate("Cart")<text>({{numberofproducts}}) {{totalprice}}</text> 2194 } else { 2195 <text>{{numberofproducts}}</text> 2196 } 2197 </div> 2198 {{/.}} 2199 </script> 2200 2201 <script id="MiniCartContent" type="text/x-template"> 2202 {{#.}} 2203 @if (useGoogleTagManager) 2204 { 2205 <text>{{{googleEnchantImpressionEmptyCart OrderLines}}}</text> 2206 } 2207 <div class="mini-cart-dropdown__inner {{isempty}} dw-mod"> 2208 <h4 class="u-ta-center u-no-margin u-margin-bottom u-margin-top">@Translate("Shopping cart")</h4> 2209 <div class="mini-cart-dropdown__body dw-mod"> 2210 <table class="table mini-cart-table dw-mod"> 2211 @RenderBlockList(subBlocks) 2212 </table> 2213 </div> 2214 2215 <table class="table mini-cart-table dw-mod"> 2216 <tr class="mini-cart-orderlines__footer dw-mod"> 2217 <td colspan="2"><button type="button" class="btn btn--secondary u-pull--left u-no-margin dw-mod btn--sm" onclick="googleEnchantImpressionEmptyCart(); Cart.EmptyCart(event);">@Translate("Empty cart")</button></td> 2218 <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> 2219 </tr> 2220 </table> 2221 </div> 2222 {{/.}} 2223 </script> 2224 2225 <script id="MiniCartOrderline" type="text/x-template"> 2226 <tr class="{{isempty}}"> 2227 <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> 2228 <td> 2229 <a href="{{link}}" class="mini-cart-orderlines__name" title="{{name}}">{{name}}</a> 2230 {{#if variantname}} 2231 <a href="{{link}}" class="mini-cart-orderlines__name mini-cart-orderlines__name--small">{{variantname}}</a> 2232 {{/if}} 2233 {{#if unitname}} 2234 <div class="mini-cart-orderlines__name mini-cart-orderlines__name--small">{{unitname}}</div> 2235 {{/if}} 2236 </td> 2237 <td class="u-ta-right">{{quantity}}</td> 2238 <td class="u-ta-right"> 2239 {{#if pointsTotal}} 2240 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 2241 {{else}} 2242 {{totalprice}} 2243 {{/if}} 2244 </td> 2245 </tr> 2246 </script> 2247 2248 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 2249 <tr class="table__row--no-border {{isempty}}"> 2250 <td>&nbsp;</td> 2251 <td><div class="mini-cart-orderlines__name dw-mod">{{name}}</div></td> 2252 <td class="u-ta-right">&nbsp;</td> 2253 <td class="u-ta-right">{{totalprice}}</td> 2254 </tr> 2255 </script> 2256 2257 if (!onlyPreview && addingToCartNotification == "modal") 2258 { 2259 <div id="LastAddedProductModal" data-template="LastAddedProductTemplate"></div> 2260 2261 <script id="LastAddedProductTemplate" type="text/x-template"> 2262 <!-- Trigger for the login modal --> 2263 <input type="checkbox" id="LastAddedProductModalTrigger" class="modal-trigger" /> 2264 2265 <!-- Login modal --> 2266 <div class="modal-container"> 2267 <label for="LastAddedProductModalTrigger" class="modal-overlay"></label> 2268 <div class="modal modal--md"> 2269 <div class="modal__header"> 2270 <h2>@Translate("Product is added to the cart")</h2> 2271 </div> 2272 <div class="modal__body"> 2273 <div class="grid"> 2274 <div class="grid__col-2"> 2275 <a href="{{productInfo.link}}"> 2276 <img src="{{productInfo.image}}" alt="{{productInfo.name}}" class="dw-mod" /> 2277 </a> 2278 </div> 2279 <div class="u-padding grid--align-self-center"> 2280 <span>{{quantity}}</span> x 2281 </div> 2282 <div class="grid__col-auto grid--align-self-center"> 2283 <div>{{productInfo.name}}</div> 2284 {{#if productInfo.variantName}} 2285 <small class="u-margin-bottom-5px">{{productInfo.variantName}}</small> 2286 {{/if}} 2287 {{#if productInfo.unitName}} 2288 <small class="u-margin-bottom-5px">{{productInfo.unitName}}</small> 2289 {{/if}} 2290 </div> 2291 </div> 2292 <div class="modal__footer u-margin-top--lg"> 2293 <label class="btn btn--secondary u-pull--left u-no-margin dw-mod btn--sm" for="LastAddedProductModalTrigger">@Translate("Continue shopping")</label> 2294 <a href="/cart" class="btn btn--primary u-pull--right u-no-margin dw-mod btn--sm">@Translate("Proceed to checkout")</a> 2295 </div> 2296 </div> 2297 <label class="modal__close-btn" for="LastAddedProductModalTrigger"></label> 2298 </div> 2299 </div> 2300 </script> 2301 <script> 2302 document.addEventListener('addToCart', function (event) { 2303 Cart.ShowLastAddedProductModal(event.detail); 2304 }); 2305 </script> 2306 } 2307 else if (!onlyPreview && addingToCartNotification == "toggle") 2308 { 2309 <script> 2310 document.addEventListener('addToCart', function () { 2311 Cart.ToggleMiniCart('miniCartWrapper', 'miniCart', 'cartCounter', '@miniCartFeedPageId'); 2312 }); 2313 </script> 2314 } 2315 } 2316 2317 @helper RenderMiniCartHeader() { 2318 <thead> 2319 <tr> 2320 <td>&nbsp;</td> 2321 <td>@Translate("Product")</td> 2322 <td class="u-ta-right">@Translate("Qty")</td> 2323 <td class="u-ta-right" width="120">@Translate("Price")</td> 2324 </tr> 2325 </thead> 2326 } 2327 2328 @helper RenderMiniCartOrderLines() { 2329 <text> 2330 {{#OrderLines}} 2331 {{#ifCond template "===" "CartOrderline"}} 2332 {{>MiniCartOrderline}} 2333 {{/ifCond}} 2334 {{#ifCond template "===" "CartOrderlineMobile"}} 2335 {{>MiniCartOrderline}} 2336 {{/ifCond}} 2337 {{#ifCond template "===" "CartOrderlineDiscount"}} 2338 {{>MiniCartOrderlineDiscount}} 2339 {{/ifCond}} 2340 {{/OrderLines}} 2341 </text> 2342 } 2343 2344 @helper RenderMiniCartFees() { 2345 <tr> 2346 <td><i class="fas fa-credit-card"></i></td> 2347 <td>{{paymentmethod}}</td> 2348 <td colspan="2" class="u-ta-right" width="130">{{paymentfee}}</td> 2349 </tr> 2350 <tr> 2351 <td><i class="fas fa-truck"></i></td> 2352 <td>{{shippingmethod}}</td> 2353 <td colspan="2" class="u-ta-right" width="130">{{shippingfee}}</td> 2354 </tr> 2355 } 2356 2357 @helper RenderMiniCartPoints() { 2358 <text> 2359 {{#if earnings}} 2360 <tr> 2361 <td colspan="2">@Translate("Earnings")</td> 2362 <td colspan="2" class="u-ta-right" width="130"><span class="u-color--loyalty-points">{{earnings}}</span> @Translate("points")</td> 2363 </tr> 2364 {{/if}} 2365 </text> 2366 } 2367 2368 @helper RenderMiniCartTotal() { 2369 <tr class="mini-cart-totals dw-mod"> 2370 <td colspan="2">@Translate("Total")</td> 2371 <td class="u-ta-right">{{numberofproducts}}</td> 2372 <td class="u-ta-right" width="130">{{totalprice}}</td> 2373 </tr> 2374 } 2375 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2376 2377 @using System 2378 @using System.Web 2379 @using System.Collections.Generic 2380 @using Dynamicweb.Rapido.Blocks.Extensibility 2381 @using Dynamicweb.Rapido.Blocks 2382 @using Dynamicweb.Ecommerce.Common 2383 2384 @{ 2385 BlocksPage referencesBlocksPage = BlocksPage.GetBlockPage("Master"); 2386 2387 Block masterScriptReferences = new Block() 2388 { 2389 Id = "MasterScriptReferences", 2390 SortId = 1, 2391 Template = RenderMasterScriptReferences() 2392 }; 2393 referencesBlocksPage.Add(MasterBlockId.MasterReferences, masterScriptReferences); 2394 } 2395 2396 @helper RenderMasterScriptReferences() { 2397 <script src="/Files/Templates/Designs/Rapido/js/handlebars-v4.0.11.js"></script> 2398 <script src="/Files/Templates/Designs/Rapido/js/master.min.js?v=26"></script> 2399 2400 if (Model.Area.Item.GetItem("Custom").GetBoolean("UseCustomJavascript")) 2401 { 2402 <script src="/Files/Templates/Designs/Rapido/js/custom.min.js?v=26"></script> 2403 } 2404 } 2405 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2406 2407 @using System 2408 @using System.Web 2409 @using System.Collections.Generic 2410 @using Dynamicweb.Rapido.Blocks.Extensibility 2411 @using Dynamicweb.Rapido.Blocks 2412 2413 @{ 2414 BlocksPage searchBlocksPage = BlocksPage.GetBlockPage("Master"); 2415 bool navigationItemsHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 2416 2417 if (!navigationItemsHideSearch) 2418 { 2419 Block masterSearchScriptTemplates = new Block() 2420 { 2421 Id = "MasterSearchScriptTemplates", 2422 SortId = 1, 2423 Template = RenderSearchScriptTemplates() 2424 }; 2425 2426 searchBlocksPage.Add(MasterBlockId.MasterBottomSnippets, masterSearchScriptTemplates); 2427 } 2428 } 2429 2430 @helper RenderSearchScriptTemplates() 2431 { 2432 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 2433 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 2434 bool useFacebookPixel = !string.IsNullOrWhiteSpace(Pageview.AreaSettings.GetItem("Settings").GetString("FacebookPixelID")); 2435 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 2436 bool useGoogleTagManager = !string.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID")); 2437 bool isDigitalWarehouse = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("EnableDigitalWarehouse"); 2438 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 2439 2440 <script id="SearchGroupsTemplate" type="text/x-template"> 2441 {{#.}} 2442 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 2443 {{/.}} 2444 </script> 2445 2446 <script id="SearchProductsTemplate" type="text/x-template"> 2447 {{#each .}} 2448 {{#Product}} 2449 {{#ifCond template "!==" "SearchMore"}} 2450 <li class="dropdown__item dropdown__item--seperator dw-mod"> 2451 @if (useFacebookPixel) 2452 { 2453 <text>{{{facebookPixelSearch name number priceDouble currency searchParameter}}}</text> 2454 } 2455 @if (useGoogleTagManager) 2456 { 2457 <text>{{{googleEnchantImpression 'Search results' currency googleImpression}}}</text> 2458 } 2459 <div> 2460 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left" onclick="{{googleImpressionClick}}" title="{{name}}"> 2461 <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> 2462 <div class="u-pull--left"> 2463 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 2464 @if (!onlyPreview) 2465 { 2466 if (pointShopOnly) 2467 { 2468 <text> 2469 {{#if havePointPrice}} 2470 <div> 2471 <span class="u-color--loyalty-points">{{points}}</span> @Translate("points") 2472 </div> 2473 {{else}} 2474 <small class="help-text u-no-margin">@Translate("Not available")</small> 2475 {{/if}} 2476 {{#unless canBePurchasedWithPoints}} 2477 {{#if havePointPrice}} 2478 <small class="help-text u-no-margin">@Translate("Not enough points to buy this")</small> 2479 {{/if}} 2480 {{/unless}} 2481 </text> 2482 } 2483 else 2484 { 2485 <div>{{price}}</div> 2486 } 2487 } 2488 </div> 2489 </a> 2490 <div class="u-margin-left u-pull--right"> 2491 @if (!onlyPreview) 2492 { 2493 if (pointShopOnly) 2494 { 2495 <button type="button" class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 2496 onclick="Cart.AddToCart(event, { 2497 id: '{{productId}}', 2498 quantity: 1, 2499 buyForPoints: true, 2500 productInfo: {{productInfo}} 2501 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 2502 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue js-ignore-click-outside"></i> 2503 </button> 2504 } 2505 else 2506 { 2507 <button type="button" class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside" 2508 onclick="Cart.AddToCart(event, { 2509 id: '{{productId}}', 2510 quantity: 1, 2511 productInfo: {{productInfo}} 2512 }); {{facebookPixelAction}}"> 2513 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue js-ignore-click-outside"></i> 2514 </button> 2515 } 2516 <a href="{{link}}" onclick="{{googleImpressionClick}}" class="btn btn--secondary btn--condensed btn--full u-no-margin dw-mod {{hideViewMore}} js-ignore-click-outside" title="@Translate("View")">@Translate("View")</a> 2517 } 2518 else if (isDigitalWarehouse) 2519 { 2520 <a class="btn btn--primary u-no-margin btn--condensed dw-mod" href="{{listLink}}"><i class="fas {{listIcon}}"></i></a> 2521 } 2522 else 2523 { 2524 <a href="{{link}}" onclick="{{googleImpressionClick}}" class="btn btn--secondary btn--condensed btn--full u-no-margin dw-mod js-ignore-click-outside" title="@Translate("View")">@Translate("View")</a> 2525 } 2526 </div> 2527 </div> 2528 </li> 2529 {{/ifCond}} 2530 {{#ifCond template "===" "SearchMore"}} 2531 {{>SearchMoreProducts}} 2532 {{/ifCond}} 2533 {{/Product}} 2534 {{else}} 2535 <li class="dropdown__item dropdown__item--seperator dw-mod"> 2536 @Translate("Your search gave 0 results") 2537 </li> 2538 {{/each}} 2539 </script> 2540 2541 <script id="SearchMoreProducts" type="text/x-template"> 2542 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 2543 <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 2544 @Translate("View all") 2545 </a> 2546 </li> 2547 </script> 2548 2549 <script id="SearchMorePages" type="text/x-template"> 2550 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 2551 <a href="/Default.aspx?ID=@contentSearchPageLink&Search={{searchParameter}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 2552 @Translate("View all") 2553 </a> 2554 </li> 2555 </script> 2556 2557 <script id="SearchPagesTemplate" type="text/x-template"> 2558 {{#each .}} 2559 {{#ifCond template "!==" "SearchMore"}} 2560 <li class="dropdown__item dropdown__item--seperator dw-mod"> 2561 <div> 2562 <a href="/Default.aspx?ID={{id}}" class="js-typeahead-link u-pull--left u-color-inherit"> 2563 <div class="u-margin-right u-pull--left"><i class="fa {{icon}} u-w20px u-ta-center"></i></div> 2564 <div class="u-pull--left"> 2565 <div class="u-bold u-truncate-text u-max-w220px js-typeahead-name">{{name}}</div> 2566 </div> 2567 </a> 2568 </div> 2569 </li> 2570 {{/ifCond}} 2571 {{#ifCond template "===" "SearchMore"}} 2572 {{>SearchMorePages}} 2573 {{/ifCond}} 2574 {{else}} 2575 <li class="dropdown__item dropdown__item--seperator dw-mod"> 2576 @Translate("Your search gave 0 results") 2577 </li> 2578 {{/each}} 2579 </script> 2580 2581 <script id="SearchPagesTemplateWrap" type="text/x-template"> 2582 <div class="dropdown__column-header">@Translate("Pages")</div> 2583 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 2584 {{>SearchPagesTemplate}} 2585 </ul> 2586 </script> 2587 2588 <script id="SearchProductsTemplateWrap" type="text/x-template"> 2589 <div class="dropdown__column-header">@Translate("Products")</div> 2590 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 2591 {{>SearchProductsTemplate}} 2592 </ul> 2593 </script> 2594 } 2595 2596 2597 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2598 2599 @using System 2600 @using System.Web 2601 @using System.Collections.Generic 2602 @using Dynamicweb.Rapido.Blocks.Extensibility 2603 @using Dynamicweb.Rapido.Blocks 2604 2605 @{ 2606 BlocksPage bottomSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 2607 2608 Block primaryBottomSnippets = new Block() 2609 { 2610 Id = "MasterJavascriptInitializers", 2611 SortId = 100, 2612 Template = RenderPrimaryBottomSnippets() 2613 }; 2614 bottomSnippetsBlocksPage.Add(MasterBlockId.MasterReferences, primaryBottomSnippets); 2615 } 2616 2617 @helper RenderPrimaryBottomSnippets() 2618 { 2619 bool isWireframeMode = Model.Area.Item.GetItem("Settings").GetBoolean("WireframeMode"); 2620 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 2621 2622 if (isWireframeMode) 2623 { 2624 <script> 2625 Wireframe.Init(true); 2626 </script> 2627 } 2628 2629 2630 if (useGoogleTagManager) 2631 { 2632 <script> 2633 document.addEventListener('addToCart', function(event) { 2634 var googleImpression = event.detail.productInfo.googleImpression; 2635 dataLayer.push({ 2636 'event': 'addToCart', 2637 'ecommerce': { 2638 'currencyCode': '@Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency().Code', 2639 'add': { 2640 'products': [{ 2641 'name': googleImpression.name, 2642 'id': googleImpression.id, 2643 'price': googleImpression.price, 2644 'brand': googleImpression.brand, 2645 'category': googleImpression.category, 2646 'variant': googleImpression.variant, 2647 'quantity': event.detail.quantity 2648 }] 2649 } 2650 } 2651 }); 2652 }); 2653 </script> 2654 } 2655 2656 <!--@Javascripts--> 2657 } 2658 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2659 2660 @using System 2661 @using System.Text.RegularExpressions 2662 2663 @using Dynamicweb; 2664 @using Dynamicweb.Core 2665 @using Dynamicweb.Rapido.Blocks 2666 2667 @using Smartpage.CookieManager 2668 2669 @{ 2670 BlocksPage masterBlocksBlocksPage = BlocksPage.GetBlockPage("Master"); 2671 2672 if (Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue == "custom") 2673 { 2674 /* Master main */ 2675 var MasterMain = masterBlocksBlocksPage.GetBlockById("MasterMain"); 2676 if (MasterMain != null) 2677 { 2678 MasterMain.Template = RenderMainCustom(); 2679 } 2680 2681 /* Master header */ 2682 var MasterHeader = masterBlocksBlocksPage.GetBlockById("MasterHeader"); 2683 if (MasterHeader != null) 2684 { 2685 MasterHeader.Template = RenderMasterHeaderCustom(); 2686 } 2687 2688 /* Tools text (USP) */ 2689 var MasterDesktopToolsText = masterBlocksBlocksPage.GetBlockById("MasterDesktopToolsText"); 2690 if (MasterDesktopToolsText != null) 2691 { 2692 MasterDesktopToolsText.Template = RenderDesktopToolsTextCustom(); 2693 } 2694 2695 /* Tools navigation */ 2696 var MasterDesktopToolsNavigation = masterBlocksBlocksPage.GetBlockById("MasterDesktopToolsNavigation"); 2697 if (MasterDesktopToolsNavigation != null) 2698 { 2699 MasterDesktopToolsNavigation.Template = RenderDesktopToolsNavigationCustom(); 2700 } 2701 2702 /* Language selector */ 2703 var MasterDesktopActionsMenuLanguageSelector = masterBlocksBlocksPage.GetBlockById("MasterDesktopActionsMenuLanguageSelector"); 2704 if (MasterDesktopActionsMenuLanguageSelector != null) 2705 { 2706 MasterDesktopActionsMenuLanguageSelector.Template = null; 2707 } 2708 2709 /* Sign in */ 2710 var masterDesktopActionsMenuSignIn = masterBlocksBlocksPage.GetBlockById("masterDesktopActionsMenuSignIn"); 2711 if (masterDesktopActionsMenuSignIn != null) 2712 { 2713 masterDesktopActionsMenuSignIn.Template = null; 2714 } 2715 2716 /* Search bar */ 2717 var SearchBar = masterBlocksBlocksPage.GetBlockById("SearchBar"); 2718 if (SearchBar != null) 2719 { 2720 SearchBar.Template = RenderSearchBarCustom(); 2721 } 2722 2723 /* Search script */ 2724 var MasterSearchScriptTemplates = masterBlocksBlocksPage.GetBlockById("MasterSearchScriptTemplates"); 2725 if (MasterSearchScriptTemplates != null) 2726 { 2727 MasterSearchScriptTemplates.Template = RenderSearchScriptTemplatesCustom(); 2728 } 2729 2730 /* Navigation links */ 2731 var MasterDesktopActionsMenu = masterBlocksBlocksPage.GetBlockById("MasterDesktopActionsMenu"); 2732 if (MasterDesktopActionsMenu != null) 2733 { 2734 masterBlocksBlocksPage.Add("MasterDesktopActionsMenu", new Block 2735 { 2736 Id = "masterDesktopActionsMenuNavigationLinks", 2737 SortId = 10, 2738 Template = RenderDesktopActionsMenuNavigationLinksCustom() 2739 }); 2740 } 2741 2742 /* Favorites */ 2743 var MasterDesktopActionsMenuFavorites = masterBlocksBlocksPage.GetBlockById("MasterDesktopActionsMenuFavorites"); 2744 if (MasterDesktopActionsMenuFavorites != null && !Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideFavorites") && Model.CurrentUser.ID > 0) 2745 { 2746 MasterDesktopActionsMenuFavorites.Template = RenderFavoritesCustom(); 2747 } 2748 2749 /* Mini cart */ 2750 var MasterDesktopActionsMenuMiniCart = masterBlocksBlocksPage.GetBlockById("MasterDesktopActionsMenuMiniCart"); 2751 if (MasterDesktopActionsMenuMiniCart != null) 2752 { 2753 MasterDesktopActionsMenuMiniCart.Template = RenderMiniCartCustom(); 2754 } 2755 2756 /* Mini cart templates */ 2757 var MasterMiniCartTemplates = masterBlocksBlocksPage.GetBlockById("MasterMiniCartTemplates"); 2758 if (MasterMiniCartTemplates != null) 2759 { 2760 MasterMiniCartTemplates.Template = RenderMiniCartScriptTemplatesCustom(); 2761 2762 /* Mini cart SubTotal */ 2763 MasterMiniCartTemplates.Add(new Block 2764 { 2765 Id = "MiniCartSubTotal", 2766 SortId = 25, 2767 Template = RenderMiniCartSubTotalCustom() 2768 }); 2769 2770 /* Mini cart VAT */ 2771 MasterMiniCartTemplates.Add(new Block 2772 { 2773 Id = "MiniCartVAT", 2774 SortId = 45, 2775 Template = RenderMiniCartVATCustom() 2776 }); 2777 } 2778 2779 /* Mini cart fees */ 2780 var MiniCartFees = masterBlocksBlocksPage.GetBlockById("MiniCartFees"); 2781 if (MiniCartFees != null) 2782 { 2783 MiniCartFees.Template = RenderMiniCartFeesCustom(); 2784 } 2785 2786 /* Desktop navigation */ 2787 var MasterDesktopNavigation = masterBlocksBlocksPage.GetBlockById("MasterDesktopNavigation"); 2788 if (MasterDesktopNavigation != null) 2789 { 2790 MasterDesktopNavigation.Template = RenderDesktopNavigationCustom(); 2791 } 2792 2793 /* Desktop menu */ 2794 var MasterDesktopMenu = masterBlocksBlocksPage.GetBlockById("MasterDesktopMenu"); 2795 if (MasterDesktopMenu != null) 2796 { 2797 MasterDesktopMenu.Template = RenderDesktopMenuCustom(); 2798 } 2799 } 2800 2801 /* LoginModal */ 2802 var masterBlocksBlocksPageLoginModal = masterBlocksBlocksPage.GetBlockById("LoginModal"); 2803 if (masterBlocksBlocksPageLoginModal != null) 2804 { 2805 masterBlocksBlocksPageLoginModal.Template = LoginModalCustom(); 2806 } 2807 2808 if (Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItem("SpNewsletterPopup") != null) 2809 { 2810 Block masterFooterNewsletterPopup = new Block 2811 { 2812 Id = "MasterFooterNewsletterPopup", 2813 SortId = 80, 2814 Template = RenderNewsletterPopup(), 2815 Design = new Design 2816 { 2817 Size = "12", 2818 RenderType = RenderType.Column 2819 } 2820 }; 2821 masterBlocksBlocksPage.GetBlockById("MasterFooterContent").Add(masterFooterNewsletterPopup); 2822 } 2823 2824 if (Model.Area.Item.GetItem("Layout").GetBoolean("FooterNewsletterSignUp")) 2825 { 2826 masterBlocksBlocksPage.GetBlockById("MasterFooterNewsletterSignUp").Template = RenderFooterNewsletterSignUpCustom(); 2827 } 2828 2829 masterBlocksBlocksPage.GetBlockById("MasterJavascriptInitializers").Template = RenderPrimaryBottomSnippetsCustom(); 2830 2831 masterBlocksBlocksPage.GetBlockById("TagManager").Template = RenderGoogleTagManagerCustom(); 2832 masterBlocksBlocksPage.GetBlockById("FacebookPixel").Template = RenderFacebookPixelCustom(); 2833 2834 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 2835 if (!onlyPreview) 2836 { 2837 Block masterColliModalWithMultiplum = new Block 2838 { 2839 Id = "ColliModalWithMultiplum", 2840 SortId = 90, 2841 Template = RenderColliModalWithMultiplum() 2842 }; 2843 masterBlocksBlocksPage.GetBlockById("Master").Add(masterColliModalWithMultiplum); 2844 2845 Block masterColliModalWithoutMultiplum = new Block 2846 { 2847 Id = "ColliModalWithoutMultiplum", 2848 SortId = 100, 2849 Template = RenderColliModalWithoutMultiplum() 2850 }; 2851 masterBlocksBlocksPage.GetBlockById("Master").Add(masterColliModalWithoutMultiplum); 2852 } 2853 2854 2855 2856 Block masterAlertBoxModal = new Block 2857 { 2858 Id = "AlertBoxModal", 2859 SortId = 101, 2860 Template = RenderAlertBoxModal() 2861 2862 }; 2863 2864 masterBlocksBlocksPage.GetBlockById("Master").Add(masterAlertBoxModal); 2865 2866 2867 2868 Block productListDiscontinued = new Block 2869 { 2870 Id = "Discontinued", 2871 SortId = 102, 2872 Template = RenderDiscontinuedTemplates() 2873 }; 2874 masterBlocksBlocksPage.GetBlockById("Master").Add(productListDiscontinued); 2875 } 2876 2877 @{ 2878 2879 BlocksPage customMasterDesktopLogoBlock = BlocksPage.GetBlockPage("Master"); 2880 2881 Block masterDesktopLogoCustom = new Block 2882 { 2883 Id = "MasterDesktopLogo", 2884 SortId = 9, 2885 Template = RenderDesktopLogoCustom(), 2886 Design = new Design 2887 { 2888 Size = "auto-width", 2889 HidePadding = true, 2890 RenderType = RenderType.Column 2891 } 2892 }; 2893 customMasterDesktopLogoBlock.ReplaceBlock(masterDesktopLogoCustom); 2894 } 2895 2896 @{ 2897 BlocksPage customMobileNavigationBlockPage = BlocksPage.GetBlockPage("Master"); 2898 2899 Block mobileNavigationLanguagesActionCustom = new Block 2900 { 2901 Id = "MobileNavigationLanguagesAction", 2902 SortId = 49, 2903 Template = RenderMobileNavigationLanguagesActionCustom() 2904 }; 2905 customMobileNavigationBlockPage.ReplaceBlock(mobileNavigationLanguagesActionCustom); 2906 2907 } 2908 2909 @{ 2910 Block RenderAxExceptionsBlock = new Block 2911 { 2912 Id = "RenderAxExceptions", 2913 SortId = 102, 2914 Template = RenderAxExceptions() 2915 }; 2916 masterBlocksBlocksPage.GetBlockById("Master").Add(RenderAxExceptionsBlock); 2917 2918 } 2919 2920 2921 @functions { 2922 CookieBot cookieBot = new CookieBot(); 2923 } 2924 2925 @helper RenderMainCustom() 2926 { 2927 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMain").OrderBy(item => item.SortId).ToList(); 2928 2929 <main class="site dw-mod topLayoutCustom"> 2930 @RenderBlockList(subBlocks) 2931 </main> 2932 } 2933 2934 @helper RenderMasterHeaderCustom() 2935 { 2936 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterHeader").OrderBy(item => item.SortId).ToList(); 2937 var isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 2938 var stickyTop = isNavigationStickyMenu ? "top-container--sticky" : ""; 2939 2940 var isNavigationStickyMinifiedMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetBoolean("SpStickyTopMinified"); 2941 var stickyTopMinified = isNavigationStickyMinifiedMenu ? "top-container--sticky-minified" : ""; 2942 2943 <header class="top-container @stickyTop @stickyTopMinified dw-mod" id="Top"> 2944 @RenderBlockList(subBlocks) 2945 </header> 2946 } 2947 2948 @helper RenderDesktopToolsTextCustom() 2949 { 2950 var toolsText = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("ToolsText"); 2951 2952 <ul class="usp dw-mod"> 2953 @foreach (var text in toolsText.Split(new Char[] { ';' })) 2954 { 2955 <li><i class="fas fa-check"></i> @text</li> 2956 } 2957 </ul> 2958 } 2959 2960 @helper RenderDesktopToolsNavigationCustom() 2961 { 2962 <ul id="topToolsNavigation" class="menu menu-tools dw-mod dwnavigation"> 2963 @RenderNavigation(new 2964 { 2965 template = "SpTopMenu.xslt" 2966 }) 2967 @RenderLanguageSelectorCustom() 2968 @RenderSignInCustom() 2969 </ul> 2970 } 2971 2972 @helper RenderDiscontinuedTemplates() 2973 { 2974 <script id="DiscontinuedTemplate" type="text/x-template"> 2975 <div class="discontinue-container u-full-max-width u-no-margin padding-10px bg-light-grey"> 2976 <h5 class="u-no-margin">@Translate("Produktet er udgået")</h5> 2977 2978 {{#if replacementItemName}} 2979 <div class="grid__cell"> 2980 <label class="u-margin-top">@Translate("Replacement product:")</label> 2981 </div> 2982 <div class="u-full-width"> 2983 <div class="grid"> 2984 <div class="grid__col-auto grid__col--bleed-x"> 2985 <a href="{{replacementItemLink}}"> 2986 <div id="ProductsContainer" class="grid product-list dw-mod"> 2987 <div class="product-list__details-item__left sp-product-list-detail-replacement u-color-light--bg u-full-width u-position-relative u-border u-margin-top dw-mod"> 2988 2989 <div class="u-hidden-xxs"> 2990 <div class="u-margin-right"> 2991 <img onerror="this.onerror=null;this.src='/Admin/Public/GetImage.ashx?width=112&amp;height=82&amp;crop=5&FillCanvas=true&amp;Compression=75&amp;image=/Files/Images/missing_image.jpg';" src="/Admin/Public/GetImage.ashx?width=112&amp;height=82&amp;crop=5&FillCanvas=true&amp;Compression=75&amp;image={{replacementItemImage}}" alt="{{replacementItemName}}" /> 2992 </div> 2993 </div> 2994 2995 <div class="u-margin-left u-margin-right"> 2996 <h6 class="u-condensed-text">{{replacementItemName}}</h6> 2997 2998 <div class="item-number u-no-margin"> 2999 #{{replacementItemNumber}} 3000 </div> 3001 3002 <div class="u-margin-bottom"> 3003 <span class="stock-icon {{replacementItemStockState}} u-no-margin dw-mod" title="{{replacementItemStockText}}"></span> {{replacementItemStockText}}{{deliveryText}} 3004 </div> 3005 </div> 3006 <div class="custom-button-placement-right-bottom dw-mod"> 3007 <div class="btn btn--primary btn--condensed dw-mod u-margin vertical-align-sub"> 3008 @Translate("View") 3009 </div> 3010 </div> 3011 </div> 3012 </div> 3013 </a> 3014 </div> 3015 </div> 3016 </div> 3017 {{/if}} 3018 </div> 3019 </script> 3020 } 3021 3022 3023 @helper RenderMobileNavigationLanguagesActionCustom() 3024 { 3025 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 3026 3027 string selectedLanguage = ""; 3028 foreach (var lang in Model.Languages) 3029 { 3030 if (lang.IsCurrent) 3031 { 3032 selectedLanguage = lang.Name; 3033 } 3034 } 3035 3036 <li class="menu-mobile__item dw-mod"> 3037 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 3038 <div class="menu-mobile__link__wrap"> 3039 <label for="MobileMenuCheck_Language" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("LanguageIcon").SelectedValue menu-mobile__link-icon"></i> @selectedLanguage</label> 3040 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger"></label> 3041 </div> 3042 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 3043 @if (isSlidesDesign) 3044 { 3045 <li class="menu-mobile__item dw-mod"> 3046 <div class="menu-mobile__link__wrap"> 3047 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger menu-mobile__trigger--back"></label> 3048 <label for="MobileMenuCheck_Language" class="menu-mobile__link dw-mod ">@Translate("Back")</label> 3049 </div> 3050 </li> 3051 } 3052 @foreach (var lang in Model.Languages) 3053 { 3054 <li class="menu-mobile__item dw-mod"> 3055 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod menu-mobile__link--level-1" href="/Default.aspx?ID=@lang.Page.ID&SetLang=True">@lang.Name</a> 3056 </li> 3057 } 3058 </ul> 3059 </li> 3060 } 3061 3062 3063 3064 3065 3066 @helper RenderLanguageSelectorCustom() 3067 { 3068 if (Model.Languages.Count > 1) 3069 { 3070 var languageViewType = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("LanguageSelector").SelectedValue) ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("LanguageSelector").SelectedValue.ToLower() : ""; 3071 var currentLanguage = Model.Languages.First(i => i.IsCurrent).Name; 3072 var internationalID = Converter.ToInt32(Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetList("SpInternationalWebsite").SelectedValue); 3073 3074 <li class="menu-tools__item dw-mod is-dropdown is-dropdown--no-icon"> 3075 <div class="menu-tools__link menu-tools__link-language menu__link--icon dw-mod"> 3076 @currentLanguage 3077 <i class="fas fa-angle-down"></i> 3078 </div> 3079 <div class="menu menu--dropdown language-dropdown dw-mod"> 3080 @foreach (var lang in Model.Languages) 3081 { 3082 Regex rx = new Regex(@"[A-Z]{2}"); 3083 MatchCollection countryCode = rx.Matches(lang.Culture); // lang.Culture returns in format "da-DK" 3084 3085 var langInfo = ""; 3086 3087 3088 3089 if (lang.ID == internationalID) 3090 { 3091 langInfo = "<span class=\"flag-icon custom-icon-international u-ta-center u-margin-right\"></span>" + lang.Name; 3092 } 3093 else 3094 { 3095 langInfo = "<span class=\"flag-icon flag-icon-" + Converter.ToString(countryCode[0]).ToLower() + " u-margin-right\"></span>" + lang.Name; 3096 } 3097 3098 if (languageViewType == "flag") 3099 { 3100 langInfo = "<span class=\"flag-icon flag-icon-" + Converter.ToString(countryCode[0]).ToLower() + "\"></span>"; 3101 } 3102 3103 if (languageViewType == "name") 3104 { 3105 langInfo = lang.Name; 3106 } 3107 3108 <a href="/Default.aspx?ID=@lang.Page.ID&SetLang=true" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 3109 } 3110 </div> 3111 </li> 3112 } 3113 } 3114 3115 @helper RenderSignInCustom() 3116 { 3117 var navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 3118 var userInitials = ""; 3119 var pageId = Model.TopPage.ID; 3120 3121 var createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 3122 var myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 3123 var myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 3124 var myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 3125 var myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 3126 var mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 3127 var signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 3128 3129 var myInvoicesPageId = GetPageIdByNavigationTag("InvoicesPage"); 3130 var myBackordersPageId = GetPageIdByNavigationTag("BackordersPage"); 3131 var myMostBoughtItemsPageId = GetPageIdByNavigationTag("MostBoughtItemsPage"); 3132 var myNewsletterSettingsPageId = GetPageIdByNavigationTag("NewsletterSettingsPage"); 3133 3134 var hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 3135 var hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 3136 var hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 3137 var hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 3138 var hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 3139 3140 var hideMyInvoicesLink = (myInvoicesPageId == 0); 3141 var hideMyBackordersLink = (myBackordersPageId == 0); 3142 var hideMyMostBoughtItemsLink = (myMostBoughtItemsPageId == 0); 3143 var hideMyNewsletterSettingsLink = (myNewsletterSettingsPageId == 0); 3144 3145 var linkStart = "/Default.aspx?ID="; 3146 if (Model.CurrentUser.ID <= 0) 3147 { 3148 linkStart = linkStart + signInProfilePageId + "&RedirectPageId="; 3149 } 3150 3151 var forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 3152 var myProfilePageLink = linkStart + myProfilePageId; 3153 var myOrdersPageLink = linkStart + myOrdersPageId; 3154 var myFavoritesPageLink = linkStart + myFavoritesPageId; 3155 var mySavedCardsPageLink = linkStart + mySavedCardsPageId; 3156 3157 var myInvoicesPageLink = linkStart + myInvoicesPageId; 3158 var myBackordersPageLink = linkStart + myBackordersPageId; 3159 var myMostBoughtItemsPageLink = linkStart + myMostBoughtItemsPageId; 3160 var myNewsletterSettingsPageLink = linkStart + myNewsletterSettingsPageId; 3161 3162 if (Model.CurrentUser.ID != 0) 3163 { 3164 if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) 3165 { 3166 string[] names = Model.CurrentUser.Name.Split(' '); 3167 userInitials += Model.CurrentUser.Name.Substring(0, 1); 3168 3169 if (names.Length > 1) 3170 { 3171 userInitials += names[names.Length - 1].Substring(0, 1); 3172 } 3173 } 3174 else 3175 { 3176 userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; 3177 userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; 3178 userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; 3179 userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; 3180 userInitials += userInitials == "" ? Model.CurrentUser.UserName.Substring(0, 2) : ""; 3181 } 3182 } 3183 3184 if (!navigationItemsHideSignIn) 3185 { 3186 <li class="menu-tools__item dw-mod is-dropdown is-dropdown--no-icon"> 3187 <div class="menu-tools__link menu-tools__link-sign-in menu__link--icon dw-mod"> 3188 @if (Model.CurrentUser.ID <= 0) 3189 { 3190 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue fac-white"></i> 3191 @Translate("Login") 3192 } 3193 else 3194 { 3195 <a href="/default.aspx?ID=@myProfilePageId" class="u-color-inherit"> 3196 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue fac-white"></i> 3197 @Translate("My account") 3198 </a> 3199 } 3200 </div> 3201 <div class="menu menu--dropdown sign-in-dropdown dw-mod"> 3202 <ul class="list list--clean dw-mod"> 3203 @if (Model.CurrentUser.ID <= 0) 3204 { 3205 <li> 3206 <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> 3207 </li> 3208 if (!hideCreateAccountLink) 3209 { 3210 <li> 3211 <a href="/default.aspx?ID=@createAccountPageId" class="list__link dw-mod">@Translate("Create account")</a> 3212 </li> 3213 } 3214 <li> 3215 <a href="@forgotPasswordPageLink" class="list__link dw-mod">@Translate("Forgot your password?")</a> 3216 </li> 3217 if (!hideMyProfileLink || !hideMyOrdersLink || !hideMyFavoritesLink || !hideMySavedCardsLink) 3218 { 3219 <li class="list__seperator dw-mod"></li> 3220 } 3221 } 3222 @if (!hideMyProfileLink) 3223 { 3224 <li> 3225 <a href="@myProfilePageLink" class="list__link dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue u-margin-right"></i>@Translate("My profile")</a> 3226 </li> 3227 } 3228 @if (!hideMyFavoritesLink) 3229 { 3230 <li> 3231 <a href="@myFavoritesPageLink" class="list__link dw-mod"><i class="fas fa-@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue u-margin-right"></i>@Translate("My favorites")</a> 3232 </li> 3233 } 3234 @if (!hideMyOrdersLink) 3235 { 3236 <li> 3237 <a href="@myOrdersPageLink" class="list__link dw-mod"><i class="fas fa-list u-margin-right"></i>@Translate("My orders")</a> 3238 </li> 3239 } 3240 @if (!hideMyInvoicesLink) 3241 { 3242 <li> 3243 <a href="@myInvoicesPageLink" class="list__link dw-mod"><i class="fac fa-invoices u-margin-right"></i>@Translate("My invoices")</a> 3244 </li> 3245 } 3246 @if (!hideMyBackordersLink) 3247 { 3248 <li> 3249 <a href="@myBackordersPageLink" class="list__link dw-mod"><i class="fac fa-backorder u-margin-right"></i>@Translate("My backorders")</a> 3250 </li> 3251 } 3252 @if (!hideMyMostBoughtItemsLink) 3253 { 3254 <li> 3255 <a href="@myMostBoughtItemsPageLink" class="list__link dw-mod"><i class="fac fa-most-bought-item u-margin-right"></i>@Translate("My most bought items")</a> 3256 </li> 3257 } 3258 @if (!hideMyNewsletterSettingsLink) 3259 { 3260 <li> 3261 <a href="@myNewsletterSettingsPageLink" class="list__link dw-mod"><i class="fac fa-newsletter u-margin-right"></i>@Translate("My newsletter settings")</a> 3262 </li> 3263 } 3264 @if (!hideMySavedCardsLink) 3265 { 3266 <li> 3267 <a href="@mySavedCardsPageLink" class="list__link dw-mod"><i class="fas fa-credit-card u-margin-right"></i>@Translate("My saved cards")</a> 3268 </li> 3269 } 3270 @if (Model.CurrentUser.ID > 0) 3271 { 3272 if (!hideMyProfileLink || !hideMyOrdersLink || !hideMyFavoritesLink || !hideMySavedCardsLink) 3273 { 3274 <li class="list__seperator dw-mod"></li> 3275 } 3276 3277 var logoutLink = Dynamicweb.Context.Current.Request.RawUrl; 3278 logoutLink = logoutLink.Contains("CompletedOrderSecret") ? "/Default.aspx?ID=" + Model.Area.FirstActivePage.ID : logoutLink; 3279 3280 <li> 3281 <a href="@("/Admin/Public/ExtranetLogoff.aspx?Redirect=" + HttpUtility.UrlEncode(logoutLink))" class="list__link dw-mod">@Translate("Sign out")</a> 3282 </li> 3283 } 3284 </ul> 3285 </div> 3286 </li> 3287 } 3288 } 3289 3290 @helper RenderSearchBarCustom(string alignment = "left") 3291 { 3292 string searchFeedId = ""; 3293 string searchSecondFeedId = ""; 3294 int groupsFeedId; 3295 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 3296 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 3297 string resultPageLink; 3298 string searchPlaceholder; 3299 string searchType = "product-search"; 3300 string searchTemplate; 3301 string searchContentTemplate = ""; 3302 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") != null ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 3303 bool showGroups = true; 3304 3305 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 3306 { 3307 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 3308 resultPageLink = contentSearchPageLink; 3309 searchPlaceholder = Translate("Search page"); 3310 groupsFeedId = 0; 3311 searchType = "content-search"; 3312 searchTemplate = "SearchPagesTemplate"; 3313 showGroups = false; 3314 } 3315 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 3316 { 3317 searchFeedId = Converter.ToString(GetPageIdByNavigationTag("ProductsSearchPage")); 3318 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 3319 resultPageLink = Converter.ToString(productsPageId); 3320 searchPlaceholder = Translate("Search products or pages"); 3321 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 3322 searchType = "combined-search"; 3323 searchTemplate = "SearchProductsTemplateWrap"; 3324 searchContentTemplate = "SearchPagesTemplateWrap"; 3325 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 3326 } 3327 else 3328 { 3329 resultPageLink = Converter.ToString(productsPageId); 3330 searchFeedId = Converter.ToString(GetPageIdByNavigationTag("ProductsSearchPage")); 3331 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 3332 searchPlaceholder = Translate("Search products"); 3333 searchTemplate = "SearchProductsTemplateWrapGrid"; 3334 searchType = "product-search"; 3335 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 3336 } 3337 3338 <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="@resultPageLink" data-groups-page-id="@groupsFeedId" data-search-type="@searchType"> 3339 @if (showGroups) 3340 { 3341 <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> 3342 <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> 3343 } 3344 <div class="typeahead-search-field"> 3345 <input type="text" class="u-no-margin u-full-width u-full-height js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 3346 @if (string.IsNullOrEmpty(searchSecondFeedId)) 3347 { 3348 <div class="dropdown dropdown--absolute-position dropdown--combined grid js-handlebars-root js-typeahead-search-content sp-search-dropdown-content u-hidden" id="ProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></div> 3349 } 3350 else 3351 { 3352 <div class="dropdown dropdown--absolute-position dropdown--combined grid @(alignment == "right" ? "dropdown--right-aligned" : "")"> 3353 <div class="js-handlebars-root js-typeahead-search-content grid__col-sm-6 grid__col--bleed-y u-hidden" id="ProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></div> 3354 <div class="js-handlebars-root js-typeahead-additional-search-content grid__col-sm-6 grid__col--bleed-y u-hidden" id="ContentSearchBarContent" data-template="@searchContentTemplate" data-json-feed="/Default.aspx?ID=@searchSecondFeedId" data-init-onload="false"></div> 3355 </div> 3356 } 3357 </div> 3358 <button type="button" class="btn btn--condensed btn--secondary u-no-margin dw-mod js-typeahead-enter-btn"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue fa-1_5x fac-white"></i></button> 3359 </div> 3360 } 3361 3362 @helper RenderSearchScriptTemplatesCustom() 3363 { 3364 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 3365 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 3366 bool useFacebookPixel = !string.IsNullOrWhiteSpace(Pageview.AreaSettings.GetItem("Settings").GetString("FacebookPixelID")) && cookieBot.Marketing; 3367 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 3368 bool useGoogleTagManager = !string.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID")) && cookieBot.Statistics; 3369 bool isDigitalWarehouse = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("EnableDigitalWarehouse"); 3370 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 3371 var cartIcon = "fas fa-shopping-cart"; 3372 3373 <script id="SearchGroupsTemplate" type="text/x-template"> 3374 {{#.}} 3375 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 3376 {{/.}} 3377 </script> 3378 3379 <script id="SearchFavoriteProductsTemplate" type="text/x-template"> 3380 {{#if .}} 3381 {{#.}} 3382 {{#each ProductsContainer}} 3383 {{>SearchProductsTemplate}} 3384 {{/each}} 3385 {{/.}} 3386 {{/if}} 3387 </script> 3388 3389 <script id="SearchProductsTemplate" type="text/x-template"> 3390 {{#Product}} 3391 {{#ifCond template "!==" "SearchMore"}} 3392 <li class="dropdown__item dropdown__item--seperator dw-mod"> 3393 @if (useFacebookPixel) 3394 { 3395 <text>{{{facebookPixelSearch name number priceDouble currency searchParameter}}}</text> 3396 } 3397 @if (useGoogleTagManager) 3398 { 3399 <text>{{{googleEnchantImpression 'Search results' currency googleImpression}}}</text> 3400 } 3401 <div> 3402 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left" onclick="{{googleImpressionClick}}" title="{{name}}"> 3403 <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}}" onerror="this.onerror=null;this.src='/Admin/Public/GetImage.ashx?width=45&height=36&crop=5&FillCanvas=True&Compression=75&image=/Files/Images/missing_image.jpg';" alt="{{name}}"></div> 3404 <div class="u-pull--left"> 3405 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 3406 @if (!onlyPreview) 3407 { 3408 if (pointShopOnly) 3409 { 3410 <text> 3411 {{#if havePointPrice}} 3412 <div> 3413 <span class="u-color--loyalty-points">{{points}}</span> @Translate("points") 3414 </div> 3415 {{else}} 3416 <small class="help-text u-no-margin">@Translate("Not available")</small> 3417 {{/if}} 3418 {{#unless canBePurchasedWithPoints}} 3419 {{#if havePointPrice}} 3420 <small class="help-text u-no-margin">@Translate("Not enough points to buy this")</small> 3421 {{/if}} 3422 {{/unless}} 3423 </text> 3424 } 3425 else 3426 { 3427 <div>{{price}}</div> 3428 } 3429 } 3430 </div> 3431 </a> 3432 <div class="u-margin-left u-pull--right"> 3433 @if (!onlyPreview) 3434 { 3435 if (pointShopOnly) 3436 { 3437 <button type="button" class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 3438 onclick="Cart.AddToCart(event, { 3439 id: '{{productId}}', 3440 unitId: '{{unitId}}', 3441 quantity: 1, 3442 buyForPoints: true, 3443 productInfo: {{ productInfo }}, 3444 multiplum: {{multiplum}}, 3445 multiplumUnitId: '{{ProductDefaultUnitId}}, 3446 standardOrderQuantity: {{standardOrderQuantity}} 3447 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 3448 <i class="@cartIcon js-ignore-click-outside"></i> 3449 </button> 3450 } 3451 else 3452 { 3453 <button type="button" class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside" 3454 onclick="Cart.AddToCart(event, { 3455 id: '{{productId}}', 3456 unitId: '{{unitId}}', 3457 quantity: 1, 3458 productInfo: {{productInfo}}, 3459 multiplum: {{multiplum}}, 3460 multiplumUnitId: '{{ProductDefaultUnitId}}', 3461 standardOrderQuantity: {{standardOrderQuantity}} 3462 }); {{facebookPixelAction}}"> 3463 <i class="@cartIcon js-ignore-click-outside"></i> 3464 </button> 3465 } 3466 <a href="{{link}}" onclick="{{googleImpressionClick}}" class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideViewMore}} js-ignore-click-outside" title="@Translate("View")">@Translate("View")</a> 3467 } 3468 else if (isDigitalWarehouse) 3469 { 3470 <a class="btn btn--primary u-no-margin btn--condensed dw-mod" href="{{listLink}}"><i class="fas {{listIcon}}"></i></a> 3471 } 3472 else 3473 { 3474 <a href="{{link}}" onclick="{{googleImpressionClick}}" class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod js-ignore-click-outside" title="@Translate("View")">@Translate("View")</a> 3475 } 3476 </div> 3477 </div> 3478 </li> 3479 {{/ifCond}} 3480 {{#ifCond template "===" "SearchMore"}} 3481 {{>SearchMoreProducts}} 3482 {{/ifCond}} 3483 {{/Product}} 3484 </script> 3485 3486 <script id="SearchMoreProducts" type="text/x-template"> 3487 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 3488 <a href="{{#if link}}{{link}}{{else}}/Default.aspx?ID=@productsPageId&GroupID={{groupId}}&Search={{searchParameter}}{{/if}}" class="btn btn--tertiary btn--full u-no-margin dw-mod js-typeahead-link"> 3489 @string.Format(Translate("View all products ({0})"), "{{total}}") 3490 </a> 3491 </li> 3492 </script> 3493 3494 <script id="SearchMorePages" type="text/x-template"> 3495 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 3496 <a href="/Default.aspx?ID=@contentSearchPageLink&Search={{searchParameter}}" class="btn btn--tertiary btn--full u-no-margin dw-mod js-typeahead-link"> 3497 @Translate("View all pages") 3498 </a> 3499 </li> 3500 </script> 3501 3502 <script id="SearchMoreFacets" type="text/x-template"> 3503 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 3504 <a href="{{link}}" class="btn btn--tertiary btn--full u-no-margin dw-mod js-typeahead-link"> 3505 @Translate("View all concepts") 3506 </a> 3507 </li> 3508 </script> 3509 3510 <script id="SearchPagesTemplate" type="text/x-template"> 3511 {{#each .}} 3512 {{#ifCond template "!==" "SearchMore"}} 3513 <li class="dropdown__item dropdown__item--seperator dw-mod"> 3514 <div> 3515 <a href="/Default.aspx?ID={{id}}" class="js-typeahead-link u-pull--left u-color-inherit"> 3516 <div class="u-margin-right u-pull--left"><i class="fa {{icon}} u-w20px u-ta-center"></i></div> 3517 <div class="u-pull--left"> 3518 <div class="u-bold u-truncate-text u-max-w220px js-typeahead-name">{{name}}</div> 3519 </div> 3520 </a> 3521 </div> 3522 </li> 3523 {{/ifCond}} 3524 {{#ifCond template "===" "SearchMore"}} 3525 {{>SearchMorePages}} 3526 {{/ifCond}} 3527 {{else}} 3528 <li class="dropdown__item dropdown__item--seperator dw-mod"> 3529 @Translate("Your search gave 0 results") 3530 </li> 3531 {{/each}} 3532 </script> 3533 3534 <script id="SearchPagesTemplateWrap" type="text/x-template"> 3535 <div class="dropdown__column-header">@Translate("Pages")</div> 3536 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 3537 {{>SearchPagesTemplate}} 3538 </ul> 3539 </script> 3540 3541 <script id="SearchProductsTemplateWrap" type="text/x-template"> 3542 <div class="dropdown__column-header">@Translate("Products")</div> 3543 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 3544 {{#if .}} 3545 {{#.}} 3546 {{#each ProductsContainer}} 3547 {{>SearchProductsTemplate}} 3548 {{/each}} 3549 {{/.}} 3550 {{else}} 3551 <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable dw-mod"> 3552 @Translate("Your search gave 0 results") 3553 </li> 3554 {{/if}} 3555 </ul> 3556 {{#.}} 3557 {{#each FacetGroups}} 3558 <div class="dropdown__column-header">{{name}}</div> 3559 <ul class="dropdown__list u-full-width u-margin-bottom u-block dw-mod"> 3560 {{#each FacetOptions}} 3561 <li class="dropdown__item dropdown__item-block dw-mod"> 3562 <a href="{{link}}" class="u-bold js-typeahead-name" title="{{name}}">{{label}}</a> 3563 </li> 3564 {{/each}} 3565 </ul> 3566 {{/each}} 3567 {{/.}} 3568 </script> 3569 3570 <script id="SearchProductsTemplateWrapGrid" type="text/x-template"> 3571 <div class="grid__col-sm-6 grid__col--bleed-y"> 3572 <div class="dropdown__column-header">@Translate("Products")</div> 3573 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 3574 {{#if .}} 3575 {{#.}} 3576 {{#each ProductsContainer}} 3577 {{>SearchProductsTemplate}} 3578 {{/each}} 3579 {{/.}} 3580 {{else}} 3581 <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable dw-mod"> 3582 @Translate("Your search gave 0 results") 3583 </li> 3584 {{/if}} 3585 </ul> 3586 </div> 3587 <div class="grid__col-sm-6 grid__col--bleed-y"> 3588 {{#.}} 3589 {{#each FacetGroups}} 3590 <div class="dropdown__column-header">{{name}}</div> 3591 <ul class="dropdown__list u-full-width u-margin-bottom u-block dw-mod"> 3592 {{#if FacetOptions}} 3593 {{#.}} 3594 {{#each FacetOptions}} 3595 <li class="dropdown__item dropdown__item-block dw-mod"> 3596 <a href="{{link}}" class="u-bold js-typeahead-name" title="{{label}}">{{label}}</a> 3597 </li> 3598 {{/each}} 3599 {{#if link}} 3600 {{>SearchMoreFacets}} 3601 {{/if}} 3602 {{/.}} 3603 {{else}} 3604 <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable dw-mod"> 3605 @Translate("Your search gave 0 results") 3606 </li> 3607 {{/if}} 3608 </ul> 3609 {{/each}} 3610 {{/.}} 3611 </div> 3612 </script> 3613 } 3614 3615 @helper RenderDesktopActionsMenuNavigationLinksCustom() 3616 { 3617 var itemCustom = Model.Area.Item.GetItem("Custom"); 3618 if (itemCustom != null) 3619 { 3620 var itemCustomSettings = itemCustom.GetItem("CustomSettings"); 3621 if (itemCustomSettings != null) 3622 { 3623 var itemNavigationLinks = itemCustomSettings.GetItems("NavigationLinks"); 3624 if (itemNavigationLinks != null) 3625 { 3626 foreach (var link in itemNavigationLinks) 3627 { 3628 <li class="menu__item menu__item--horizontal dw-mod in-hidden"> 3629 <a href="@link.GetString("NavigationLinkLink")" class="menu__link menu-tools__link-navigation-link menu__link--icon dw-mod"> 3630 <i class="@link.GetString("NavigationLinkIcon") fac-1_5x"></i> 3631 @link.GetString("NavigationLinkName") 3632 </a> 3633 </li> 3634 } 3635 } 3636 } 3637 } 3638 } 3639 3640 @helper RenderFavoritesCustom() 3641 { 3642 var navigationItemsHideFavorites = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideFavorites"); 3643 var signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 3644 var myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 3645 3646 var linkStart = "/Default.aspx?ID="; 3647 if (Model.CurrentUser.ID <= 0) 3648 { 3649 linkStart = linkStart + signInProfilePageId + "&RedirectPageId="; 3650 } 3651 3652 var myFavoritesPageLink = linkStart + myFavoritesPageId; 3653 3654 <li class="menu__item menu__item--horizontal dw-mod u-hidden-xxs"> 3655 <a href="@myFavoritesPageLink" class="menu__link menu-tools__link-favorite menu__link--icon dw-mod"> 3656 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue fac-red fac-1_5x"></i> 3657 @Translate("Favorites") 3658 </a> 3659 </li> 3660 } 3661 3662 @helper RenderMiniCartCustom() 3663 { 3664 var navigationItemsHideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 3665 var miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 3666 var cartPageId = GetPageIdByNavigationTag("CartPage"); 3667 var onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 3668 var cartClass = new string[] { "CartPage", "CartPageEmpty" }.Contains(Pageview.Page.NavigationTag) ? "u-hidden" : ""; 3669 3670 if (!onlyPreview && !navigationItemsHideCart) 3671 { 3672 <li class="menu__item menu__item--horizontal @cartClass dw-mod" id="miniCartWrapper" onmouseenter="Cart.UpdateMiniCart('miniCartWrapper', 'miniCart', 'cartCounter', '/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart')"> 3673 <div class="mini-cart dw-mod"> 3674 <a href="/Default.aspx?ID=@cartPageId&Purge=True" id="miniCartCounterWrap" class="menu__link menu-tools__link-cart menu__link--icon dw-mod js-mini-cart-button"> 3675 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue fac-green fac-1_5x"></i> 3676 <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"> 3677 <div class="js-mini-cart-counter-content"> 3678 @string.Format(Translate("Cart ({0})"), Model.Cart.TotalProductsCount.ToString()) 3679 </div> 3680 </div> 3681 </a> 3682 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 3683 { 3684 <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> 3685 } 3686 </div> 3687 </li> 3688 } 3689 } 3690 3691 @helper RenderMiniCartScriptTemplatesCustom() 3692 { 3693 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMiniCartTemplates").OrderBy(item => item.SortId).ToList(); 3694 3695 int cartPageId = GetPageIdByNavigationTag("CartPage"); 3696 bool showPriceInMiniCartCounter = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 3697 showPriceInMiniCartCounter = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue == "right" ? showPriceInMiniCartCounter : false; 3698 showPriceInMiniCartCounter = Pageview.Device.ToString() == "Mobile" ? false : showPriceInMiniCartCounter; 3699 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")) && cookieBot.Statistics; 3700 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 3701 string addingToCartNotification = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType").SelectedValue : ""; 3702 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 3703 3704 3705 <script id="MiniCartCounterContent" type="text/x-template"> 3706 {{#.}} 3707 <div class="js-mini-cart-counter-content dw-mod"> 3708 @string.Format(Translate("Cart ({0})"), "{{numberofproducts}}") 3709 </div> 3710 {{/.}} 3711 </script> 3712 3713 <script id="MiniMobileCartCounterContent" type="text/x-template"> 3714 {{#.}} 3715 <div class="js-mini-cart-counter-content sp-mobile-cart-counter u-brand-color-five--bg"> 3716 {{numberofproducts}} 3717 </div> 3718 {{/.}} 3719 </script> 3720 3721 <script id="MiniCartContent" type="text/x-template"> 3722 {{#.}} 3723 @if (useGoogleTagManager) 3724 { 3725 <text>{{{googleEnchantImpressionEmptyCart OrderLines}}}</text> 3726 } 3727 <div class="mini-cart-dropdown__inner {{isempty}} dw-mod"> 3728 <h4 class="u-ta-center u-no-margin u-margin-bottom u-margin-top">@Translate("Shopping cart")</h4> 3729 <div class="mini-cart-dropdown__body dw-mod"> 3730 <table class="table mini-cart-table dw-mod"> 3731 @RenderBlockList(subBlocks) 3732 </table> 3733 </div> 3734 3735 <table class="table mini-cart-table dw-mod"> 3736 <tr class="mini-cart-orderlines__footer dw-mod"> 3737 <td colspan="2">@*<button type="button" class="btn btn--tertiary u-pull--left u-no-margin dw-mod btn--sm" onclick="googleEnchantImpressionEmptyCart(); Cart.EmptyCart(event);">@Translate("Empty cart")</button>*@</td> 3738 <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> 3739 </tr> 3740 </table> 3741 </div> 3742 {{/.}} 3743 </script> 3744 3745 <script id="MiniCartOrderline" type="text/x-template"> 3746 <tr class="{{isempty}}"> 3747 <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> 3748 <td> 3749 <a href="{{link}}" class="mini-cart-orderlines__name" title="{{name}}">{{name}}</a> 3750 {{#if variantname}} 3751 <a href="{{link}}" class="mini-cart-orderlines__name mini-cart-orderlines__name--small">{{variantname}}</a> 3752 {{/if}} 3753 {{#if unitname}} 3754 <div class="mini-cart-orderlines__name mini-cart-orderlines__name--small">{{unitname}}</div> 3755 {{/if}} 3756 </td> 3757 <td class="u-ta-right">{{quantity}}</td> 3758 <td class="u-ta-right"> 3759 {{#if pointsTotal}} 3760 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 3761 {{else}} 3762 {{totalprice}} 3763 {{/if}} 3764 </td> 3765 </tr> 3766 {{#Discounts}} 3767 {{>MiniCartOrderlineDiscount}} 3768 {{/Discounts}} 3769 </script> 3770 3771 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 3772 <tr class="table__row--no-border {{isempty}}"> 3773 <td>&nbsp;</td> 3774 <td><div class="mini-cart-orderlines__name dw-mod">{{name}}</div></td> 3775 <td class="u-ta-right">&nbsp;</td> 3776 <td class="u-ta-right">{{totalprice}}</td> 3777 </tr> 3778 </script> 3779 3780 if (!onlyPreview && addingToCartNotification == "modal") 3781 { 3782 <div id="LastAddedProductModal" data-template="LastAddedProductTemplate"></div> 3783 3784 <script id="LastAddedProductTemplate" type="text/x-template"> 3785 <!-- Trigger for the login modal --> 3786 <input type="checkbox" id="LastAddedProductModalTrigger" class="modal-trigger" /> 3787 3788 <!-- Login modal --> 3789 <div class="modal-container"> 3790 <label for="LastAddedProductModalTrigger" class="modal-overlay"></label> 3791 <div class="modal modal--md"> 3792 <div class="modal__header"> 3793 <h2>@Translate("Product is added to the cart")</h2> 3794 </div> 3795 <div class="modal__body"> 3796 <div class="grid"> 3797 <div class="grid__col-2"> 3798 <a href="{{productInfo.link}}"> 3799 <img src="{{productInfo.image}}" alt="{{productInfo.name}}" class="dw-mod" /> 3800 </a> 3801 </div> 3802 <div class="u-padding grid--align-self-center"> 3803 <span>{{quantity}}</span> x 3804 </div> 3805 <div class="grid__col-auto grid--align-self-center"> 3806 <div>{{productInfo.name}}</div> 3807 {{#if productInfo.variantName}} 3808 <small class="u-margin-bottom-5px">{{productInfo.variantName}}</small> 3809 {{/if}} 3810 {{#if productInfo.unitName}} 3811 <small class="u-margin-bottom-5px">{{productInfo.unitName}}</small> 3812 {{/if}} 3813 </div> 3814 </div> 3815 <div class="modal__footer u-margin-top--lg"> 3816 <label class="btn btn--secondary u-pull--left u-no-margin dw-mod btn--sm" for="LastAddedProductModalTrigger">@Translate("Continue shopping")</label> 3817 <a href="/cart" class="btn btn--primary u-pull--right u-no-margin dw-mod btn--sm">@Translate("Proceed to checkout")</a> 3818 </div> 3819 </div> 3820 <label class="modal__close-btn" for="LastAddedProductModalTrigger"></label> 3821 </div> 3822 </div> 3823 </script> 3824 <script> 3825 document.addEventListener('addToCart', function (event) { 3826 Cart.ShowLastAddedProductModal(event.detail); 3827 }); 3828 </script> 3829 } 3830 else if (!onlyPreview && addingToCartNotification == "toggle") 3831 { 3832 <script> 3833 document.addEventListener('cartUpdated', function () { 3834 var wrapperId = "miniCartWrapper", 3835 containerId = "miniCart", 3836 counterId = "cartCounter", 3837 miniCartFeedPageId = "@miniCartFeedPageId"; 3838 3839 Cart.UpdateMiniCart(wrapperId, containerId, counterId, '/Default.aspx?ID=' + miniCartFeedPageId + '&feedType=MiniCart') 3840 3841 document.addEventListener('contentLoaded', function () { 3842 Cart.HideMiniCart(containerId, 2800); 3843 }); 3844 }); 3845 </script> 3846 } 3847 } 3848 3849 @helper RenderMiniCartSubTotalCustom() 3850 { 3851 <tr> 3852 <td colspan="2">@Translate("Subtotal")</td> 3853 <td colspan="2" class="u-ta-right" width="130">{{subtotalprice}}</td> 3854 </tr> 3855 } 3856 3857 @helper RenderMiniCartFeesCustom() 3858 { 3859 <tr class="{{hidePaymentfee}}"> 3860 <td><i class="fas fa-credit-card"></i></td> 3861 <td>{{paymentmethod}}</td> 3862 <td colspan="2" class="u-ta-right" width="130">{{paymentfee}}</td> 3863 </tr> 3864 <tr class="{{hideShippingfee}}"> 3865 <td><i class="fas fa-truck"></i></td> 3866 <td>{{shippingmethod}}</td> 3867 <td colspan="2" class="u-ta-right" width="130">{{shippingfee}}</td> 3868 </tr> 3869 } 3870 3871 @helper RenderMiniCartVATCustom() 3872 { 3873 <tr> 3874 <td colspan="2">@Translate("VAT")</td> 3875 <td colspan="2" class="u-ta-right" width="130">{{totalvat}}</td> 3876 </tr> 3877 } 3878 3879 @helper RenderDesktopNavigationCustom() 3880 { 3881 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopNavigation").OrderBy(item => item.SortId).ToList(); 3882 3883 <nav class="main-navigation dw-mod u-position-relative" onmouseleave="closeMegaMenu()"> 3884 <div class="center-container top-container__center-container grid grid--align-center dw-mod u-reset-position"> 3885 @RenderBlockList(subBlocks) 3886 </div> 3887 <div class="menu mega-menu dw-mod js-custom-mega-nav-wrap custom-mega-nav-wrap"> 3888 3889 </div> 3890 </nav> 3891 } 3892 3893 @helper RenderDesktopMenuCustom() 3894 { 3895 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 3896 string menuAlignment = topLayout == "two-lines-centered" || topLayout == "minimal-right" ? "u-pull--right" : ""; 3897 3898 bool megaMenu = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("NavigationMegaMenu").SelectedValue.ToLower() == "true" ? true : false; 3899 string megamenuPromotionImage = Model.Area.Item.GetItem("Layout").GetItem("Header").GetFile("MegamenuPromotionImage") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetFile("MegamenuPromotionImage").PathUrlEncoded : ""; 3900 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 3901 int startLevel = renderPagesInToolBar ? 1 : 0; 3902 3903 <div class="grid__cell u-reset-position"> 3904 <div class="@menuAlignment"> 3905 @if (Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("NavigationMegaMenu").SelectedValue.ToLower() == "custom") 3906 { 3907 @RenderNavigation(new 3908 { 3909 id = "topnavigation", 3910 cssclass = "menu dw-mod dwnavigation u-full-max-width", 3911 startLevel = @startLevel, 3912 ecomStartLevel = @startLevel + 1, 3913 endlevel = 5, 3914 promotionImage = megamenuPromotionImage, 3915 promotionLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("MegamenuPromotionLink"), 3916 breakepoint = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("SpNavigationMegamenuBreakepoint"), 3917 expandmode = "all", 3918 template = "SpBaseMegaMenuCustom.xslt" 3919 }); 3920 } 3921 else if (!megaMenu) 3922 { 3923 @RenderNavigation(new 3924 { 3925 id = "topnavigation", 3926 cssclass = "menu dw-mod dwnavigation u-full-max-width", 3927 startLevel = @startLevel, 3928 ecomStartLevel = @startLevel + 1, 3929 endlevel = 5, 3930 expandmode = "all", 3931 template = "BaseMenuWithDropdown.xslt" 3932 }); 3933 } 3934 else 3935 { 3936 @RenderNavigation(new 3937 { 3938 id = "topnavigation", 3939 cssclass = "menu dw-mod dwnavigation u-full-max-width", 3940 startLevel = @startLevel, 3941 ecomStartLevel = @startLevel + 1, 3942 endlevel = 5, 3943 promotionImage = megamenuPromotionImage, 3944 promotionLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("MegamenuPromotionLink"), 3945 expandmode = "all", 3946 template = "BaseMegaMenu.xslt" 3947 }); 3948 } 3949 </div> 3950 </div> 3951 } 3952 3953 @helper LoginModalCustom() 3954 { 3955 int pageId = Model.TopPage.ID; 3956 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 3957 string userSignedInErrorText = ""; 3958 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 3959 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 3960 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 3961 3962 if (Model.LogOnFailed) { 3963 switch (Model.LogOnFailedReason) 3964 { 3965 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordLengthInvalid: 3966 userSignedInErrorText = Translate("Password length is invalid"); 3967 break; 3968 case Dynamicweb.Security.UserManagement.LogOnFailedReason.IncorrectLogin: 3969 userSignedInErrorText = Translate("Invalid email or password"); 3970 break; 3971 case Dynamicweb.Security.UserManagement.LogOnFailedReason.ExceededFailedLogOnLimit: 3972 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 3973 break; 3974 case Dynamicweb.Security.UserManagement.LogOnFailedReason.LoginLocked: 3975 userSignedInErrorText = Translate("The user account is temporarily locked"); 3976 break; 3977 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordExpired: 3978 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 3979 break; 3980 default: 3981 userSignedInErrorText = Translate("An unknown error occured"); 3982 break; 3983 } 3984 } 3985 3986 <!-- Trigger for the login modal --> 3987 <input type="checkbox" id="SignInModalTrigger" class="modal-trigger" @userSignedInError /> 3988 3989 <!-- Login modal --> 3990 <div class="modal-container"> 3991 <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> 3992 <div class="modal modal--xs" id="SignInModal"> 3993 <div class="modal__header"> 3994 <h2>@Translate("Sign in")</h2> 3995 </div> 3996 <div class="modal__body"> 3997 <form method="post" id="LoginForm" class="u-no-margin"> 3998 <input type="hidden" name="ID" value="@pageId" /> 3999 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 4000 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 4001 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Customer Number")" /> 4002 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 4003 <div class="field-error dw-mod">@userSignedInErrorText</div> 4004 4005 <div class="form__field-group dw-mod"> 4006 <input type="checkbox" id="LoginRememberMe" name="Autologin" checked="checked" value="True" class="form__control"> 4007 <label for="LoginRememberMe"> 4008 @Translate("Remember me", "Remember me") 4009 </label> 4010 </div> 4011 4012 <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> 4013 4014 <a class="btn btn--link-clean dw-mod" href="@forgotPasswordPageLink">@Translate("Forgot your password?", "Forgot your password?")</a> 4015 4016 <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> 4017 </form> 4018 </div> 4019 </div> 4020 </div> 4021 } 4022 4023 @helper RenderFooterNewsletterSignUpCustom() 4024 { 4025 <h3 class="footer__heading dw-mod">@Translate("Mailing list")</h3> 4026 <div class="footer__content dw-mod"> 4027 <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> 4028 <button class="btn btn--primary btn--condensed dw-mod js-trigger-newsletter-popup">@Translate("Sign up", "Sign up")</button> 4029 </div> 4030 } 4031 4032 @helper RenderColliModalWithMultiplum() 4033 { 4034 <input type="checkbox" id="PackagesMessageModalWithMultiplumTrigger" class="modal-trigger" /> 4035 4036 <div class="modal-container"> 4037 <label for="PackagesMessageModalWithMultiplumTrigger" id="PackagesMessageModalWithMultiplumOverlay" class="modal-overlay"></label> 4038 <div class="modal modal--md" id="PackagesMessageModal"> 4039 <div class="modal__header"> 4040 <h2>@Translate("ANTALLET ER BLEVET OPSKREVET")</h2> 4041 </div> 4042 <div class="modal__body"> 4043 <label> 4044 @Translate("Det ønskede antal stemmer ikke overens med kollisstørrelsen Antallet er derfor opskrevet til") 4045 <span class="js-closest-colli"></span> 4046 </label> 4047 <hr /> 4048 <div class="grid"> 4049 <div class="grid__col-xs-6"> 4050 <button class="btn btn--full js-cancel-add-to-cart-from-modal" onclick="document.getElementById('PackagesMessageModalWithMultiplumTrigger').click()">@Translate("Annuller")</button> 4051 </div> 4052 <div class="grid__col-xs-6"> 4053 <button class="btn btn--full btn--secondary dw-mod js-add-to-cart-from-modal">@Translate("Forsæt")</button> 4054 </div> 4055 </div> 4056 </div> 4057 </div> 4058 </div> 4059 } 4060 4061 @helper RenderColliModalWithoutMultiplum() 4062 { 4063 <input type="checkbox" id="PackagesMessageModalWithoutMultiplumTrigger" class="modal-trigger" /> 4064 4065 <div class="modal-container"> 4066 <label for="PackagesMessageModalWithoutMultiplumTrigger" id="PackagesMessageModalWithoutMultiplumOverlay" class="modal-overlay"></label> 4067 <div class="modal modal--md" id="PackagesMessageModal"> 4068 <div class="modal__header"> 4069 <h2>@Translate("INFORMATION OM PAKKESTØRRELSE")</h2> 4070 </div> 4071 <div class="modal__body"> 4072 <label> 4073 @Translate("Du kan sagtens bestille det ønskede antal. Ønsker du et helt kolli skal du bestille") 4074 <span class="js-colli">count</span> 4075 </label> 4076 <hr /> 4077 <div class="grid"> 4078 <div class="grid__col-6"> 4079 <button class="btn btn--full js-add-current-quantity">@Translate("Fortsæt")</button> 4080 </div> 4081 <div class="grid__col-6"> 4082 <button class="btn btn--full btn--secondary dw-mod js-add-colli-to-cart">@Translate("Opskriv til kolli")</button> 4083 </div> 4084 </div> 4085 </div> 4086 </div> 4087 </div> 4088 } 4089 4090 @helper RenderAlertBoxModal() 4091 { 4092 <input type="checkbox" id="AlertBoxModalTrigger" class="modal-trigger" /> 4093 4094 <div class="modal-container"> 4095 <label for="AlertBoxModalTrigger" id="AlertBoxModalOverlay" class="modal-overlay"></label> 4096 <div class="modal modal--md" id="AlertBoxModal"> 4097 <div class="modal__header"> 4098 <h2>-</h2> 4099 </div> 4100 <div class="modal__body"> 4101 <label> 4102 - 4103 </label><br /> 4104 <button class="btn btn--secondary u-no-margin btn--full dw-mod" onclick="document.getElementById('AlertBoxModalTrigger').click();">@Translate("Close")</button> 4105 </div> 4106 </div> 4107 </div> 4108 } 4109 4110 @helper RenderNewsletterPopup() 4111 { 4112 @RenderParagraphContent(Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItem("SpNewsletterPopup").ParagraphID) 4113 } 4114 4115 @helper RenderPrimaryBottomSnippetsCustom() 4116 { 4117 bool isWireframeMode = Model.Area.Item.GetItem("Settings").GetBoolean("WireframeMode"); 4118 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")) && cookieBot.Statistics; 4119 4120 if (isWireframeMode) 4121 { 4122 <script> 4123 Wireframe.Init(true); 4124 </script> 4125 } 4126 4127 if (useGoogleTagManager) 4128 { 4129 <script> 4130 document.addEventListener('addToCart', function(event) { 4131 var googleImpression = event.detail.productInfo.googleImpression; 4132 dataLayer.push({ 4133 'event': 'addToCart', 4134 'ecommerce': { 4135 'currencyCode': '@Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency().Code', 4136 'add': { 4137 'products': [{ 4138 'name': googleImpression.name, 4139 'id': googleImpression.id, 4140 'price': googleImpression.price, 4141 'brand': googleImpression.brand, 4142 'category': googleImpression.category, 4143 'variant': googleImpression.variant, 4144 'quantity': event.detail.quantity 4145 }] 4146 } 4147 } 4148 }); 4149 }); 4150 </script> 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 } 4183 4184 <!--@Javascripts--> 4185 } 4186 4187 @helper RenderGoogleTagManagerCustom() 4188 { 4189 string googleTagManagerId = Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID"); 4190 bool useGoogleTagManager = !string.IsNullOrEmpty(googleTagManagerId) && cookieBot.Statistics; 4191 4192 if (useGoogleTagManager) 4193 { 4194 <script> 4195 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 4196 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 4197 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 4198 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 4199 })(window,document,'script','dataLayer','@googleTagManagerId'); 4200 </script> 4201 <!-- Google Tag Manager (noscript) --> 4202 <noscript> 4203 <iframe src="https://www.googletagmanager.com/ns.html?id=@googleTagManagerId" 4204 height="0" width="0" style="display:none;visibility:hidden"></iframe> 4205 </noscript> 4206 <!-- End Google Tag Manager (noscript) --> 4207 } 4208 } 4209 4210 @helper RenderFacebookPixelCustom() 4211 { 4212 string FacebookPixelID = Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID") != null ? Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID") : ""; 4213 4214 if (!string.IsNullOrWhiteSpace(FacebookPixelID) && cookieBot.Marketing) 4215 { 4216 <!-- Facebook Pixel Code --> 4217 <script> 4218 !function(f,b,e,v,n,t,s) 4219 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 4220 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 4221 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 4222 n.queue=[];t=b.createElement(e);t.async=!0; 4223 t.src=v;s=b.getElementsByTagName(e)[0]; 4224 s.parentNode.insertBefore(t,s)}(window, document,'script', 4225 'https://connect.facebook.net/en_US/fbevents.js'); 4226 fbq('init', '@FacebookPixelID'); 4227 fbq('track', 'PageView'); 4228 </script> 4229 <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=@FacebookPixelID&ev=PageView&noscript=1" alt="" /></noscript> 4230 } 4231 } 4232 4233 @{ 4234 // todo: move this to back-end. 4235 var requestUsername = Dynamicweb.Context.Current.Request["Username"]; 4236 var requestUserToken = Dynamicweb.Context.Current.Request["PwTokenRecovery"]; 4237 if (!string.IsNullOrEmpty(requestUsername) && !string.IsNullOrEmpty(requestUserToken)) 4238 { 4239 var user = Dynamicweb.Security.UserManagement.User.GetUserByUserName(requestUsername); 4240 if (user != null) 4241 { 4242 var userToken = Dynamicweb.Frontend.LogOnHandler.GetLoginToken(user.UserName, user.Password); 4243 if (userToken == requestUserToken) 4244 { 4245 user.PasswordRecoveryToken = Guid.NewGuid().ToString(); 4246 user.PasswordRecoveryTokenExpirationTime = DateTime.Now.AddHours(24); 4247 user.Save(); 4248 4249 HttpContext.Current.Response.Redirect("/Default.aspx?ID=" + GetPageIdByNavigationTag("SignInPage") + "&RecoveryToken=" + user.PasswordRecoveryToken); 4250 } 4251 } 4252 } 4253 } 4254 4255 4256 @helper RenderDesktopLogoCustom() 4257 { 4258 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 4259 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4260 string alignClass = topLayout == "two-lines-centered" || topLayout == "two-lines" ? "grid--align-self-center" : ""; 4261 string logo = Model.Area.Item.GetItem("Layout").GetFile("LogoImage") != null ? Model.Area.Item.GetItem("Layout").GetFile("LogoImage").PathUrlEncoded : "/Files/Images/logo-dynamicweb.png"; 4262 string alt = Model.Area.Item.GetItem("Settings").GetString("BusinessName") != null ? Model.Area.Item.GetItem("Settings").GetString("BusinessName") : ""; 4263 string logoHeight = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetString("LogoHeight")) ? Model.Area.Item.GetItem("Layout").GetString("LogoHeight") : "40"; 4264 logoHeight = logoHeight != "0" ? logoHeight : "40"; 4265 if (Path.GetExtension(logo).ToLower() != ".svg") 4266 { 4267 logo = "/Admin/Public/GetImage.ashx?height=" + logoHeight + "&amp;crop=5&amp;Compression=75&amp;image=" + logo; 4268 4269 if (Pageview.Device.ToString() == "Mobile") 4270 { 4271 logoHeight = "40"; 4272 } 4273 } 4274 else 4275 { 4276 logo = HttpUtility.UrlDecode(logo); 4277 } 4278 4279 <div class="logo @alignClass dw-mod"> 4280 <a href="/Default.aspx?ID=@firstPageId" class="logo__img dw-mod u-block"> 4281 <img class="grid__cell-img logo__img dw-mod" src="@logo" alt="@alt" /> 4282 </a> 4283 </div> 4284 } 4285 4286 4287 @helper RenderAxExceptions() 4288 { 4289 <script type="text/javascript"> 4290 4291 @{ 4292 List<Exception> axExceptions = System.Web.HttpContext.Current.Items["Smartpage:AxExceptions"] as List<Exception>; 4293 } 4294 4295 var axExceptions = @Newtonsoft.Json.JsonConvert.SerializeObject(axExceptions); 4296 4297 if (axExceptions != null && axExceptions.length > 0) { 4298 //for (var i = 0; i < axExceptions.length; i++) { 4299 // alert(axExceptions[i].Message); 4300 //} 4301 4302 var headerAx = "@Translate("Smartpage:Ax.CalculateOrder.ErrorMessageHeader", "Error")"; 4303 var messageAx = "@Translate("Smartpage:Ax.CalculateOrder.ErrorMessage", "An error occurred while processing your order")"; 4304 4305 alertBoxModal(headerAx, messageAx); 4306 } 4307 </script> 4308 } 4309 4310 <!DOCTYPE html> 4311 4312 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 4313 <head> 4314 <meta charset="utf-8" /> 4315 <title>@Model.Title</title> 4316 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> 4317 <meta name="robots" content="index, follow"> 4318 4319 @Model.MetaTags 4320 4321 <!-- Favicon --> 4322 <link href="@favicon" rel="icon" type="image/png"> 4323 4324 <!-- Font awesome --> 4325 @if (useFontAwesomePro) 4326 { 4327 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/fonts/FontAwesomePro/css/fontawesome-all.min.css" type="text/css"> 4328 } 4329 else 4330 { 4331 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/fonts/FontAwesomeFree/css/fontawesome-all.min.css" type="text/css"> 4332 } 4333 <!-- Flag icon --> 4334 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.1.0/css/flag-icon.min.css" type="text/css"> 4335 4336 <!-- Base (Default, wireframe) styles --> 4337 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css?V=20" type="text/css"> 4338 4339 <!-- Rapido Css from Website Settings --> 4340 <link id="rapidoCss" rel="stylesheet" href="@autoCssLink?V=20" type="text/css"> 4341 4342 <!-- Ignite Css (Custom site specific styles) --> 4343 <link id="igniteCss" type="text/css" href="/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css?V=20" rel="stylesheet"> 4344 4345 <!-- Google fonts --> 4346 @{ 4347 var family = string.Join("%7C", fonts.Where(x => !string.IsNullOrEmpty(x)).Distinct().Select(x => string.Format("{0}:100,200,300,400,500,600,700,800,900", x))); 4348 } 4349 <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet"> 4350 4351 @Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("SpScriptHeadAfter") 4352 4353 </head> 4354 4355 <body> 4356 4357 @Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("SpScriptBodyBefore") 4358 4359 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 4360 @RenderBlockList(masterPage.BlocksRoot.BlocksList) 4361 4362 4363 @helper RenderMasterHeader() 4364 { 4365 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterHeader").OrderBy(item => item.SortId).ToList(); 4366 bool isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 4367 string stickyTop = isNavigationStickyMenu ? "top-container--sticky" : ""; 4368 4369 <header class="top-container @stickyTop dw-mod" id="Top"> 4370 @RenderBlockList(subBlocks) 4371 </header> 4372 } 4373 4374 @helper RenderMain() 4375 { 4376 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMain").OrderBy(item => item.SortId).ToList(); 4377 4378 <main class="site dw-mod"> 4379 @RenderBlockList(subBlocks) 4380 </main> 4381 } 4382 4383 @helper RenderPageContent() 4384 { 4385 bool isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 4386 string pagePos = isNavigationStickyMenu ? "js-page-pos" : ""; 4387 4388 <div id="Page" class="page @pagePos"> 4389 <section class="center-container content-container dw-mod" id="content"> 4390 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4391 4392 4393 @{ 4394 string columnClass = "12"; 4395 bool isProductPage = HttpContext.Current.Request.QueryString.Get("ProductID") != null ? true : false; 4396 string backgroundColorClass = Model.PropertyItem.GetString("BackgroundColor") != null && !isProductPage ? "u-" + Model.PropertyItem.GetList("BackgroundColor").SelectedValue + "--bg" : ""; 4397 } 4398 4399 @if (Model.PropertyItem.GetList("ShowBreadcrumb").SelectedValue == "True") 4400 { 4401 <div class="grid__col-12 grid__col--bleed-y"> 4402 @RenderNavigation(new 4403 { 4404 id = "breadcrumb", 4405 template = "Breadcrumb.xslt" 4406 }) 4407 </div> 4408 } 4409 4410 <div class="grid"> 4411 @if (Model.PropertyItem.GetList("LeftMenu") != null && Model.PropertyItem.GetList("LeftMenu").SelectedValue == "True" && (Pageview.Page.NavigationSettings == null || !Pageview.Page.NavigationSettings.UseEcomGroups)) 4412 { 4413 var navigationMarkup = RenderNavigation(new 4414 { 4415 id = "leftnav", 4416 cssclass = "dwnavigation", 4417 startLevel = 2, 4418 expandmode = "all", 4419 endlevel = 5, 4420 template = "LeftNavigation.xslt" 4421 }); 4422 4423 if (!string.IsNullOrEmpty(navigationMarkup)) 4424 { 4425 <nav class="grid__col-md-3"> 4426 <div class="grid__cell"> 4427 @navigationMarkup 4428 </div> 4429 </nav> 4430 columnClass = "9"; 4431 } 4432 } 4433 <div class="grid__col-md-@columnClass grid__col--bleed"> 4434 <div class="grid"> 4435 @Model.Placeholder("dwcontent", "content", "default:true;sort:1") 4436 </div> 4437 </div> 4438 </div> 4439 4440 4441 @* Very small hack to make it cleanly, and easily possible to change the background color on a single page *@ 4442 @if (backgroundColorClass != "") 4443 { 4444 <script> 4445 document.getElementById("Page").classList.add("@backgroundColorClass"); 4446 </script> 4447 } 4448 </section> 4449 </div> 4450 } 4451 <input class="js-buy-all-multiplum-error-headertext" type="hidden" value="@Translate("Enkelte produkter er blevet opskrevet")" /> 4452 <input class="js-buy-all-multiplum-error-bodytext" type="hidden" value="@Translate("Vi har opskrevet alle produkter markeret med rødt til nærmeste antal der kan købes.")" /> 4453 <input class="js-blockui-calculation-message" type="hidden" value="@Translate(string.Format("OBS: Opdatér venligst ikke siden, imens ordren behandles {0}(kan tage op til 1 min.)", "<br>"))" /> 4454 </body> 4455 </html> 4456 4457