Error executing template "Designs/Rapido/_parsed/Page_custom.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_e2a88cb19526474b8daa64967da11833.b__62_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Gotcha\hjmf.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page_custom.parsed.cshtml:line 2659
   at CompiledRazorTemplates.Dynamic.RazorEngine_e2a88cb19526474b8daa64967da11833.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Gotcha\hjmf.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page_custom.parsed.cshtml:line 175
   at CompiledRazorTemplates.Dynamic.RazorEngine_e2a88cb19526474b8daa64967da11833.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Gotcha\hjmf.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page_custom.parsed.cshtml:line 139
   at CompiledRazorTemplates.Dynamic.RazorEngine_e2a88cb19526474b8daa64967da11833.b__61_0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Gotcha\hjmf.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page_custom.parsed.cshtml:line 2643
   at CompiledRazorTemplates.Dynamic.RazorEngine_e2a88cb19526474b8daa64967da11833.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Gotcha\hjmf.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page_custom.parsed.cshtml:line 175
   at CompiledRazorTemplates.Dynamic.RazorEngine_e2a88cb19526474b8daa64967da11833.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Gotcha\hjmf.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page_custom.parsed.cshtml:line 139
   at CompiledRazorTemplates.Dynamic.RazorEngine_e2a88cb19526474b8daa64967da11833.<>c__DisplayClass3_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Gotcha\hjmf.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page_custom.parsed.cshtml:line 180
   at CompiledRazorTemplates.Dynamic.RazorEngine_e2a88cb19526474b8daa64967da11833.<>c__DisplayClass2_0.b__0(TextWriter __razor_helper_writer) in D:\dynamicweb.net\Solutions\Gotcha\hjmf.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page_custom.parsed.cshtml:line 139
   at CompiledRazorTemplates.Dynamic.RazorEngine_e2a88cb19526474b8daa64967da11833.Execute() in D:\dynamicweb.net\Solutions\Gotcha\hjmf.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\_parsed\Page_custom.parsed.cshtml:line 2627
   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 *@ 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 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 string PageId = "page-id-" + Pageview.Page.ID; 61 string TemplateName = "page-template-"; 62 63 if (!string.IsNullOrEmpty(Pageview.Page.LayoutTemplate)) { 64 TemplateName += Pageview.Page.LayoutTemplate.ToLower().Replace(".cshtml", ""); 65 } else if (!string.IsNullOrEmpty(Pageview.Area.LayoutTemplate)) { 66 TemplateName += Pageview.Area.LayoutTemplate.Substring(Pageview.Area.LayoutTemplate.LastIndexOf("/")).ToLower().Replace("/", "").Replace(".cshtml", ""); 67 } 68 } 69 70 @{ 71 Block master = new Block() 72 { 73 Id = "Master", 74 BlocksList = new List<Block> { 75 new Block { 76 Id = "MasterTopSnippets", 77 SortId = 10 78 }, 79 new Block { 80 Id = "MasterMain", 81 SortId = 20, 82 Template = RenderMain(), 83 SkipRenderBlocksList = true, 84 BlocksList = new List<Block> { 85 new Block 86 { 87 Id = "MasterHeader", 88 SortId = 10, 89 Template = RenderMasterHeader(), 90 SkipRenderBlocksList = true 91 }, 92 new Block { 93 Id = "MasterPageContent", 94 SortId = 20, 95 Template = RenderPageContent() 96 } 97 } 98 }, 99 new Block { 100 Id = "MasterPreFooter", 101 SortId = 25, 102 Template = RenderPreFooter() 103 }, 104 new Block { 105 Id = "MasterFooter", 106 SortId = 30 107 }, 108 new Block { 109 Id = "MasterReferences", 110 SortId = 40 111 }, 112 new Block { 113 Id = "MasterBottomSnippets", 114 SortId = 50 115 } 116 } 117 }; 118 masterPage.Add(master); 119 } 120 121 @* Include the required Grid builder (Contains the methods @RenderBlockList and @RenderBlock) *@ 122 @using System.Text.RegularExpressions 123 @using System.Collections.Generic 124 @using Dynamicweb.Rapido.Blocks 125 126 127 @*--- START: Base block renderers ---*@ 128 129 @helper RenderBlockList(List<Block> blocks) 130 { 131 blocks = blocks.OrderBy(item => item.SortId).ToList(); 132 133 foreach (Block item in blocks) 134 { 135 <!-- START: @item.Id --> 136 137 if (item.Design == null) 138 { 139 @RenderBlock(item) 140 } 141 else if (item.Design.RenderType != RenderType.Hide) 142 { 143 if (item.Design.RenderType == RenderType.Row) 144 { 145 <div class="grid grid--align-content-start"> 146 @RenderBlock(item) 147 </div> 148 } 149 150 if (item.Design.RenderType == RenderType.Column) 151 { 152 string hidePadding = item.Design.HidePadding ? "u-no-padding" : ""; 153 string size = item.Design.Size != null ? item.Design.Size : "12"; 154 size = Regex.IsMatch(size, @"\d") ? "md-" + item.Design.Size : item.Design.Size; 155 156 <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"> 157 @RenderBlock(item) 158 </div> 159 } 160 161 if (item.SkipRenderBlocksList == true) 162 { 163 @RenderBlock(item) 164 } 165 } 166 167 <!-- END: @item.Id --> 168 } 169 } 170 171 @helper RenderBlock(Block item) 172 { 173 if (item.Template != null) 174 { 175 @BlocksPage.RenderTemplate(item.Template) 176 } 177 178 if (item.BlocksList.Count > 0 && item.SkipRenderBlocksList == false) 179 { 180 @RenderBlockList(item.BlocksList) 181 } 182 } 183 184 @*--- END: Base block renderers ---*@ 185 186 187 @* Include the Blocks for the page *@ 188 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 189 190 @using System 191 @using System.Web 192 @using System.Collections.Generic 193 @using Dynamicweb.Rapido.Blocks.Extensibility 194 @using Dynamicweb.Rapido.Blocks 195 196 @{ 197 BlocksPage topSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 198 199 Block tagManager = new Block() 200 { 201 Id = "TagManager", 202 SortId = 1, 203 Template = RenderGoogleTagManager() 204 }; 205 206 Block facebookPixel = new Block() 207 { 208 Id = "FacebookPixel", 209 SortId = 2, 210 Template = RenderFacebookPixel() 211 }; 212 213 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, tagManager); 214 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, facebookPixel); 215 } 216 217 @helper RenderGoogleTagManager() { 218 string GoogleTagManagerID = Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID") != null ? Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID") : ""; 219 220 if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 221 { 222 <!-- Google Tag Manager (noscript) --> 223 <noscript> 224 <iframe src="https://www.googletagmanager.com/ns.html?id=@GoogleTagManagerID" 225 height="0" width="0" style="display:none;visibility:hidden"></iframe> 226 </noscript> 227 <!-- End Google Tag Manager (noscript) --> 228 } 229 } 230 231 @helper RenderFacebookPixel() { 232 string FacebookPixelID = Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID") != null ? Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID") : ""; 233 234 if (!string.IsNullOrWhiteSpace(FacebookPixelID)) 235 { 236 <!-- Facebook Pixel Code --> 237 <script> 238 !function(f,b,e,v,n,t,s) 239 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 240 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 241 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 242 n.queue=[];t=b.createElement(e);t.async=!0; 243 t.src=v;s=b.getElementsByTagName(e)[0]; 244 s.parentNode.insertBefore(t,s)}(window, document,'script', 245 'https://connect.facebook.net/en_US/fbevents.js'); 246 fbq('init', '@FacebookPixelID'); 247 fbq('track', 'PageView'); 248 </script> 249 <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=@FacebookPixelID&ev=PageView&noscript=1" alt="" /></noscript> 250 } 251 } 252 253 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 254 255 @using System 256 @using System.Web 257 @using System.Collections.Generic 258 @using Dynamicweb.Rapido.Blocks.Extensibility 259 @using Dynamicweb.Rapido.Blocks 260 261 262 @{ 263 BlocksPage loginBlocksPage = BlocksPage.GetBlockPage("Master"); 264 265 Block loginModal = new Block() 266 { 267 Id = "LoginModal", 268 SortId = 10, 269 Template = LoginModal() 270 }; 271 272 loginBlocksPage.Add(MasterBlockId.MasterTopSnippets, loginModal); 273 } 274 275 @helper LoginModal() { 276 int pageId = Model.TopPage.ID; 277 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 278 string userSignedInErrorText = ""; 279 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 280 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 281 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 282 283 if (Model.LogOnFailed) { 284 switch (Model.LogOnFailedReason) 285 { 286 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordLengthInvalid: 287 userSignedInErrorText = Translate("Password length is invalid"); 288 break; 289 case Dynamicweb.Security.UserManagement.LogOnFailedReason.IncorrectLogin: 290 userSignedInErrorText = Translate("Invalid email or password"); 291 break; 292 case Dynamicweb.Security.UserManagement.LogOnFailedReason.ExceededFailedLogOnLimit: 293 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 294 break; 295 case Dynamicweb.Security.UserManagement.LogOnFailedReason.LoginLocked: 296 userSignedInErrorText = Translate("The user account is temporarily locked"); 297 break; 298 case Dynamicweb.Security.UserManagement.LogOnFailedReason.PasswordExpired: 299 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 300 break; 301 default: 302 userSignedInErrorText = Translate("An unknown error occured"); 303 break; 304 } 305 } 306 307 <!-- Trigger for the login modal --> 308 <input type="checkbox" id="SignInModalTrigger" class="modal-trigger" @userSignedInError /> 309 310 <!-- Login modal --> 311 <div class="modal-container"> 312 <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> 313 <div class="modal modal--xs" id="SignInModal"> 314 <div class="modal__header"> 315 <h2>@Translate("Sign in")</h2> 316 </div> 317 <div class="modal__body"> 318 <form method="post" id="LoginForm" class="u-no-margin"> 319 <input type="hidden" name="ID" value="@pageId" /> 320 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 321 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 322 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 323 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 324 <div class="field-error dw-mod">@userSignedInErrorText</div> 325 326 <div class="form__field-group dw-mod"> 327 <input type="checkbox" id="rememberMe" name="Autologin" checked="checked" value="True" class="form__control"> 328 <label for="rememberMe"> 329 @Translate("Remember me", "Remember me") 330 </label> 331 </div> 332 333 <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> 334 335 <a class="btn btn--link-clean dw-mod" href="@forgotPasswordPageLink">@Translate("Forgot your password?", "Forgot your password?")</a> 336 337 <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> 338 </form> 339 </div> 340 </div> 341 </div> 342 } 343 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 344 { 345 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 346 347 @using System 348 @using System.Web 349 @using System.Collections.Generic 350 @using Dynamicweb.Rapido.Blocks.Extensibility 351 @using Dynamicweb.Rapido.Blocks 352 353 354 @functions { 355 BlocksPage mobileHeaderBlocksPage = BlocksPage.GetBlockPage("Master"); 356 } 357 358 @{ 359 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"; 360 361 Block mobileHeader = new Block() 362 { 363 Id = "MobileTop", 364 SortId = 10, 365 Template = RenderMobileTop(), 366 SkipRenderBlocksList = true 367 }; 368 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeader); 369 370 Block mobileHeaderNavigation = new Block() 371 { 372 Id = "MobileHeaderNavigation", 373 SortId = 10, 374 Template = RenderMobileHeaderNavigation(), 375 SkipRenderBlocksList = true, 376 BlocksList = new List<Block> { 377 new Block { 378 Id = "MobileHeaderNavigationTrigger", 379 SortId = 10, 380 Template = RenderMobileHeaderNavigationTrigger() 381 } 382 } 383 }; 384 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderNavigation); 385 386 387 Block mobileHeaderLogo = new Block() 388 { 389 Id = "MobileHeaderLogo", 390 SortId = 20, 391 Template = RenderMobileHeaderLogo(), 392 SkipRenderBlocksList = true 393 }; 394 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderLogo); 395 396 Block mobileHeaderActions = new Block() 397 { 398 Id = "MobileHeaderActions", 399 SortId = 30, 400 Template = RenderMobileTopActions(), 401 SkipRenderBlocksList = true 402 }; 403 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderActions); 404 405 Block mobileHeaderSearch = new Block 406 { 407 Id = "MobileHeaderSearch", 408 SortId = 10, 409 Template = RenderMobileTopSearch() 410 }; 411 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderSearch); 412 413 Block mobileHeaderMiniCart = new Block 414 { 415 Id = "MobileHeaderMiniCart", 416 SortId = 20, 417 Template = RenderMobileTopMiniCart() 418 }; 419 420 Block mobileHeaderSearchBar = new Block() 421 { 422 Id = "MobileHeaderSearchBar", 423 SortId = 30, 424 Template = RenderMobileTopSearchBar() 425 }; 426 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeaderSearchBar); 427 428 switch (mobileTopLayout) 429 { 430 case "nav-left": 431 mobileHeaderNavigation.SortId = 10; 432 mobileHeaderLogo.SortId = 20; 433 mobileHeaderActions.SortId = 30; 434 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 435 break; 436 case "nav-right": 437 mobileHeaderLogo.SortId = 10; 438 mobileHeaderActions.SortId = 20; 439 mobileHeaderNavigation.SortId = 30; 440 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 441 break; 442 case "nav-search-left": 443 mobileHeaderNavigation.SortId = 10; 444 mobileHeaderLogo.SortId = 20; 445 mobileHeaderActions.SortId = 30; 446 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 447 break; 448 case "search-left": 449 mobileHeaderActions.SortId = 10; 450 mobileHeaderLogo.SortId = 20; 451 mobileHeaderNavigation.SortId = 30; 452 mobileHeaderMiniCart.SortId = 0; 453 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 454 break; 455 } 456 } 457 458 459 @helper RenderMobileTop() { 460 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileTop").OrderBy(item => item.SortId).ToList(); 461 462 <nav class="main-navigation-mobile dw-mod"> 463 <div class="center-container top-container__center-container dw-mod"> 464 <div class="grid grid--align-center"> 465 @RenderBlockList(subBlocks) 466 </div> 467 </div> 468 </nav> 469 } 470 471 @helper RenderMobileHeaderNavigation() { 472 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderNavigation").OrderBy(item => item.SortId).ToList(); 473 474 <div class="grid__col-auto-width"> 475 <ul class="menu dw-mod"> 476 @RenderBlockList(subBlocks) 477 </ul> 478 </div> 479 } 480 481 @helper RenderMobileHeaderNavigationTrigger() { 482 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 483 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link menu__link--icon menu__link--mobile dw-mod"></label> 484 </li> 485 } 486 487 @helper RenderMobileHeaderLogo() { 488 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderLogo").OrderBy(item => item.SortId).ToList(); 489 490 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 491 string businessName = Model.Area.Item.GetItem("Settings").GetString("BusinessName"); 492 493 string mobileLogo = Model.Area.Item.GetItem("Layout").GetFile("LogoImage") != null ? Model.Area.Item.GetItem("Layout").GetFile("LogoImage").PathUrlEncoded : "/Files/Images/logo-dynamicweb.png"; 494 string mobileLogoHeight = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetString("LogoHeight")) ? Model.Area.Item.GetItem("Layout").GetString("LogoHeight") : "40"; 495 mobileLogoHeight = mobileLogoHeight != "0" ? mobileLogoHeight : "40"; 496 if (Model.Area.Item.GetItem("Layout").GetItem("MobileTop") != null && Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo") != null) 497 { 498 mobileLogo = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo").PathUrlEncoded; 499 } 500 501 if (Path.GetExtension(mobileLogo).ToLower() != ".svg") 502 { 503 mobileLogo = "/Admin/Public/GetImage.ashx?height=" + mobileLogoHeight + "&amp;crop=5&amp;Compression=75&amp;image=" + mobileLogo; 504 } 505 else 506 { 507 mobileLogo = HttpUtility.UrlDecode(mobileLogo); 508 } 509 510 <div class="grid__col-auto"> 511 <div class="logo dw-mod"> 512 <a href="/Default.aspx?ID=@firstPageId"> 513 <img class="grid__cell-img logo__img logo__img--mobile dw-mod" src="@mobileLogo" alt="@businessName" /> 514 </a> 515 </div> 516 517 @RenderBlockList(subBlocks) 518 </div> 519 } 520 521 @helper RenderMobileTopActions() { 522 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderActions").OrderBy(item => item.SortId).ToList(); 523 524 <div class="grid__col-auto-width"> 525 <ul class="menu dw-mod"> 526 @RenderBlockList(subBlocks) 527 </ul> 528 </div> 529 } 530 531 @helper RenderMobileTopSearch() { 532 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 533 <label for="MobileSearchTrigger" class="menu__link menu__link--icon menu__link--mobile dw-mod"> 534 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue fa-1_5x"></i> 535 </label> 536 </li> 537 } 538 539 @helper RenderMobileTopMiniCart() { 540 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 541 int cartPageId = GetPageIdByNavigationTag("CartPage"); 542 double cartProductsCount = Model.Cart.TotalProductsCount; 543 544 <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')"> 545 <div class="mini-cart dw-mod"> 546 <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"> 547 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue fa-1_5x"></i> 548 </a> 549 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 550 { 551 <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> 552 } 553 </div> 554 </li> 555 } 556 557 @helper RenderMobileTopSearchBar() { 558 string searchFeedId = ""; 559 string searchSecondFeedId = ""; 560 int groupsFeedId; 561 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 562 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 563 string resultPageLink; 564 string searchPlaceholder; 565 string searchType = "product-search"; 566 string searchTemplate; 567 string searchContentTemplate = ""; 568 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") != null ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 569 bool showGroups = true; 570 571 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 572 { 573 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 574 resultPageLink = contentSearchPageLink; 575 searchPlaceholder = Translate("Search page"); 576 groupsFeedId = 0; 577 searchType = "content-search"; 578 searchTemplate = "SearchPagesTemplate"; 579 showGroups = false; 580 } 581 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 582 { 583 searchFeedId = productsPageId + "&feed=true"; 584 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 585 resultPageLink = Converter.ToString(productsPageId); 586 searchPlaceholder = Translate("Search products or pages"); 587 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 588 searchType = "combined-search"; 589 searchTemplate = "SearchProductsTemplateWrap"; 590 searchContentTemplate = "SearchPagesTemplateWrap"; 591 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 592 } 593 else 594 { 595 resultPageLink = Converter.ToString(productsPageId); 596 searchFeedId = productsPageId + "&feed=true"; 597 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 598 searchPlaceholder = Translate("Search products"); 599 searchTemplate = "SearchProductsTemplate"; 600 searchType = "product-search"; 601 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 602 } 603 604 605 <input type="checkbox" id="MobileSearchTrigger" class="mobile-search-trigger" /> 606 607 <div class="main-navigation-mobile typeahead-mobile dw-mod"> 608 <div class="center-container top-container__center-container dw-mod"> 609 <div class="grid"> 610 <div class="grid__col-auto"> 611 <div class="typeahead-mobile__search-field dw-mod js-typeahead" data-page-size="@(searchType == "combined-search" ? 4 : 8)" id="MobileProductSearch" data-search-feed-id="@searchFeedId" data-search-second-feed-id="@searchSecondFeedId" data-result-page-id="@resultPageLink" data-search-type="@searchType"> 612 <input type="text" class="js-typeahead-search-field u-w160px u-no-margin" placeholder="@searchPlaceholder" value="@searchValue"> 613 @if (string.IsNullOrEmpty(searchSecondFeedId)) 614 { 615 <ul class="dropdown dropdown--absolute-position u-min-w220px u-full-width js-handlebars-root js-typeahead-search-content dw-mod" id="MobileProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></ul> 616 } 617 else 618 { 619 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--combined-mobile grid"> 620 <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> 621 <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> 622 </div> 623 } 624 <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> 625 </div> 626 </div> 627 <div class="grid__col-auto-width"> 628 <ul class="menu dw-mod"> 629 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 630 <label for="MobileSearchTrigger" class="menu__link menu__link--icon menu__link--mobile dw-mod"> 631 <i class="fas fa-times fa-1_5x"></i> 632 </label> 633 </li> 634 </ul> 635 </div> 636 </div> 637 </div> 638 </div> 639 } 640 </text> 641 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 642 643 @using System 644 @using System.Web 645 @using System.Collections.Generic 646 @using Dynamicweb.Rapido.Blocks.Extensibility 647 @using Dynamicweb.Rapido.Blocks 648 649 @functions { 650 BlocksPage mobileNavigationBlocksPage = BlocksPage.GetBlockPage("Master"); 651 } 652 653 @{ 654 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 655 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideAccount"); 656 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 657 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 658 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 659 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 660 661 Block mobileNavigation = new Block() 662 { 663 Id = "MobileNavigation", 664 SortId = 10, 665 Template = MobileNavigation(), 666 SkipRenderBlocksList = true 667 }; 668 mobileNavigationBlocksPage.Add(MasterBlockId.MasterTopSnippets, mobileNavigation); 669 670 if (Model.CurrentUser.ID > 0) 671 { 672 Block mobileNavigationSignIn = new Block 673 { 674 Id = "MobileNavigationSignIn", 675 SortId = 10, 676 Template = RenderMobileNavigationSignIn() 677 }; 678 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationSignIn); 679 } 680 681 Block mobileNavigationMenu = new Block 682 { 683 Id = "MobileNavigationMenu", 684 SortId = 20, 685 Template = RenderMobileNavigationMenu() 686 }; 687 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationMenu); 688 689 Block mobileNavigationActions = new Block 690 { 691 Id = "MobileNavigationActions", 692 SortId = 30, 693 Template = RenderMobileNavigationActions(), 694 SkipRenderBlocksList = true 695 }; 696 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationActions); 697 698 if (!navigationItemsHideSignIn) 699 { 700 if (Model.CurrentUser.ID <= 0) 701 { 702 Block mobileNavigationSignInAction = new Block 703 { 704 Id = "MobileNavigationSignInAction", 705 SortId = 10, 706 Template = RenderMobileNavigationSignInAction() 707 }; 708 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignInAction); 709 710 if (hideCreateAccountLink) 711 { 712 Block mobileNavigationCreateAccountAction = new Block 713 { 714 Id = "MobileNavigationCreateAccountAction", 715 SortId = 20, 716 Template = RenderMobileNavigationCreateAccountAction() 717 }; 718 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignInAction); 719 } 720 } 721 else 722 { 723 if (hideMyProfileLink) 724 { 725 Block mobileNavigationProfileAction = new Block 726 { 727 Id = "MobileNavigationProfileAction", 728 SortId = 10, 729 Template = RenderMobileNavigationProfileAction() 730 }; 731 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationProfileAction); 732 } 733 if (hideMyOrdersLink) 734 { 735 Block mobileNavigationOrdersAction = new Block 736 { 737 Id = "MobileNavigationOrdersAction", 738 SortId = 20, 739 Template = RenderMobileNavigationOrdersAction() 740 }; 741 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationOrdersAction); 742 } 743 if (hideMyFavoritesLink) 744 { 745 Block mobileNavigationFavoritesAction = new Block 746 { 747 Id = "MobileNavigationFavoritesAction", 748 SortId = 30, 749 Template = RenderMobileNavigationFavoritesAction() 750 }; 751 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationFavoritesAction); 752 } 753 754 Block mobileNavigationSignOutAction = new Block 755 { 756 Id = "MobileNavigationSignOutAction", 757 SortId = 40, 758 Template = RenderMobileNavigationSignOutAction() 759 }; 760 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignOutAction); 761 } 762 } 763 764 if (Model.Languages.Count > 1) 765 { 766 Block mobileNavigationLanguagesAction = new Block 767 { 768 Id = "MobileNavigationLanguagesAction", 769 SortId = 50, 770 Template = RenderMobileNavigationLanguagesAction() 771 }; 772 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationLanguagesAction); 773 } 774 } 775 776 777 @helper MobileNavigation() { 778 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigation").OrderBy(item => item.SortId).ToList(); 779 780 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 781 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 782 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 783 string mobileTopDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileTop") != null ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 784 string position = mobileTopDesign == "nav-left" || mobileTopDesign == "nav-search-left" ? "left" : "right"; 785 786 <!-- Trigger for mobile navigation --> 787 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger mobile-nav-trigger--@position" autocomplete="off" /> 788 789 <!-- Mobile navigation --> 790 <nav class="mobile-navigation mobile-navigation--@position dw-mod"> 791 @RenderBlockList(subBlocks) 792 </nav> 793 794 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 795 796 if (!onlyPreview) 797 { 798 <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> 799 } 800 } 801 802 @helper RenderMobileNavigationSignIn() { 803 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 804 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 805 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 806 string myProfilePageLink = linkStart + myProfilePageId; 807 string userName = Model.CurrentUser.FirstName != null ? Model.CurrentUser.FirstName : ""; 808 userName += " " + Model.CurrentUser.LastName != null ? Model.CurrentUser.LastName : ""; 809 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 810 811 <ul class="menu menu-mobile"> 812 <li class="menu-mobile__item"> 813 <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> 814 </li> 815 </ul> 816 } 817 818 @helper RenderMobileNavigationMenu() { 819 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 820 string menuTemplate = isSlidesDesign ? "BaseMenuForMobileSlides.xslt" : "BaseMenuForMobileExpandable.xslt"; 821 string levels = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels") : "3"; 822 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 823 int startLevel = renderPagesInToolBar ? 1 : 0; 824 825 @RenderNavigation(new 826 { 827 id = "mobilenavigation", 828 cssclass = "menu menu-mobile dwnavigation", 829 startLevel = @startLevel, 830 ecomStartLevel = @startLevel + 1, 831 endlevel = @levels, 832 expandmode = "all", 833 template = @menuTemplate 834 }) 835 836 if (renderPagesInToolBar) 837 { 838 @RenderNavigation(new 839 { 840 id = "topToolsMobileNavigation", 841 cssclass = "menu menu-mobile dwnavigation", 842 template = "ToolsMenuForMobile.xslt" 843 }) 844 } 845 } 846 847 @helper RenderMobileNavigationActions() { 848 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigationActions").OrderBy(item => item.SortId).ToList(); ; 849 850 <ul class="menu menu-mobile"> 851 @RenderBlockList(subBlocks) 852 </ul> 853 } 854 855 @helper RenderMobileNavigationSignInAction() { 856 <li class="menu-mobile__item"> 857 <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> 858 </li> 859 } 860 861 @helper RenderMobileNavigationCreateAccountAction() { 862 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 863 864 <li class="menu-mobile__item"> 865 <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> 866 </li> 867 } 868 869 @helper RenderMobileNavigationProfileAction() { 870 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 871 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 872 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 873 string myProfilePageLink = linkStart + myProfilePageId; 874 875 <li class="menu-mobile__item"> 876 <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> 877 </li> 878 } 879 880 @helper RenderMobileNavigationOrdersAction() { 881 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 882 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 883 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 884 string myOrdersPageLink = linkStart + myOrdersPageId; 885 886 <li class="menu-mobile__item"> 887 <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> 888 </li> 889 } 890 891 @helper RenderMobileNavigationFavoritesAction() { 892 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 893 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 894 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 895 string myFavoritesPageLink = linkStart + myFavoritesPageId; 896 897 <li class="menu-mobile__item"> 898 <a href="@myFavoritesPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("My Favorites")</a> 899 </li> 900 } 901 902 @helper RenderMobileNavigationSignOutAction() { 903 int pageId = Model.TopPage.ID; 904 905 <li class="menu-mobile__item"> 906 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId"><i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue menu-mobile__link-icon"></i> @Translate("Sign out")</a> 907 </li> 908 } 909 910 @helper RenderMobileNavigationLanguagesAction() { 911 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 912 913 string selectedLanguage = ""; 914 foreach (var lang in Model.Languages) 915 { 916 if (lang.IsCurrent) 917 { 918 selectedLanguage = lang.Name; 919 } 920 } 921 922 <li class="menu-mobile__item dw-mod"> 923 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 924 <div class="menu-mobile__link__wrap"> 925 <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> 926 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger"></label> 927 </div> 928 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 929 @if (isSlidesDesign) 930 { 931 <li class="menu-mobile__item dw-mod"> 932 <div class="menu-mobile__link__wrap"> 933 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger menu-mobile__trigger--back"></label> 934 <label for="MobileMenuCheck_Language" class="menu-mobile__link dw-mod ">Back</label> 935 </div> 936 </li> 937 } 938 @foreach (var lang in Model.Languages) 939 { 940 <li class="menu-mobile__item dw-mod"> 941 <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> 942 </li> 943 } 944 </ul> 945 </li> 946 }</text> 947 } 948 else 949 { 950 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 951 952 @using System 953 @using System.Web 954 @using System.Collections.Generic 955 @using Dynamicweb.Rapido.Blocks.Extensibility 956 @using Dynamicweb.Rapido.Blocks 957 958 @functions { 959 BlocksPage headerBlocksPage = BlocksPage.GetBlockPage("Master"); 960 } 961 962 @{ 963 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 964 bool navigationActionHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 965 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 966 bool showSearchIcon = false; 967 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 968 969 if (topLayout == "minimal" || topLayout == "minimal-right" || topLayout == "two-lines" || topLayout == "two-lines-centered") 970 { 971 showSearchIcon = true; 972 } 973 bool headerOnlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 974 975 if (renderPagesInToolBar && Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 976 { 977 Block masterTools = new Block() 978 { 979 Id = "MasterDesktopTools", 980 SortId = 5, 981 Template = RenderDesktopTools(), 982 SkipRenderBlocksList = true, 983 BlocksList = new List<Block> 984 { 985 new Block { 986 Id = "MasterDesktopToolsNavigation", 987 SortId = 5, 988 Template = RenderDesktopToolsNavigation(), 989 Design = new Design 990 { 991 Size = "8", 992 HidePadding = true, 993 RenderType = RenderType.Column 994 } 995 }, 996 new Block { 997 Id = "MasterDesktopToolsText", 998 SortId = 20, 999 Template = RenderDesktopToolsText(), 1000 Design = new Design 1001 { 1002 Size = "4", 1003 HidePadding = true, 1004 RenderType = RenderType.Column 1005 } 1006 } 1007 } 1008 }; 1009 headerBlocksPage.Add(MasterBlockId.MasterHeader, masterTools); 1010 }; 1011 1012 Block masterDesktopExtra = new Block() 1013 { 1014 Id = "MasterDesktopExtra", 1015 SortId = 10, 1016 Template = RenderDesktopExtra(), 1017 SkipRenderBlocksList = true 1018 }; 1019 headerBlocksPage.Add(MasterBlockId.MasterHeader, masterDesktopExtra); 1020 1021 Block masterDesktopInfoBar = new Block() 1022 { 1023 Id = "MasterDesktopInfoBar", 1024 SortId = 19, 1025 Template = RenderDesktopInfoBar(), 1026 SkipRenderBlocksList = true 1027 }; 1028 headerBlocksPage.Add(MasterBlockId.MasterHeader, masterDesktopInfoBar); 1029 1030 Block masterDesktopNavigation = new Block() 1031 { 1032 Id = "MasterDesktopNavigation", 1033 SortId = 20, 1034 Template = RenderDesktopNavigation(), 1035 SkipRenderBlocksList = true 1036 }; 1037 headerBlocksPage.Add(MasterBlockId.MasterHeader, masterDesktopNavigation); 1038 1039 Block masterDesktopLogo = new Block 1040 { 1041 Id = "MasterDesktopLogo", 1042 SortId = 10, 1043 Template = RenderDesktopLogo(), 1044 Design = new Design 1045 { 1046 Size = "auto-width", 1047 HidePadding = true, 1048 RenderType = RenderType.Column 1049 } 1050 }; 1051 1052 Block masterDesktopMenu = new Block 1053 { 1054 Id = "MasterDesktopMenu", 1055 SortId = 20, 1056 Template = RenderDesktopMenu(), 1057 Design = new Design() 1058 { 1059 Size = "auto", 1060 HidePadding = true, 1061 RenderType = RenderType.Column 1062 } 1063 }; 1064 1065 Block masterDesktopActionsMenuContainer = new Block 1066 { 1067 Id = "MasterDesktopActionsMenuContainer", 1068 SortId = 30, 1069 Design = new Design 1070 { 1071 RenderType = RenderType.Column, 1072 Size = "auto" 1073 } 1074 }; 1075 1076 Block masterDesktopActionsMenu = new Block 1077 { 1078 Id = "MasterDesktopActionsMenu", 1079 SortId = 10, 1080 Template = RenderDesktopActionsMenu(), 1081 SkipRenderBlocksList = true 1082 }; 1083 1084 if (!navigationActionHideSearch && showSearchIcon) 1085 { 1086 Block masterDesktopActionsMenuSearch = new Block 1087 { 1088 Id = "MasterDesktopActionsMenuSearch", 1089 SortId = 10, 1090 Template = RenderMiniSearch() 1091 }; 1092 masterDesktopActionsMenu.Add(masterDesktopActionsMenuSearch); 1093 } 1094 1095 Block masterDesktopActionsMenuSignIn = new Block 1096 { 1097 Id = "MasterDesktopActionsMenuSignIn", 1098 SortId = 20, 1099 Template = RenderSignIn() 1100 }; 1101 masterDesktopActionsMenu.Add(masterDesktopActionsMenuSignIn); 1102 1103 if (!hideMyFavoritesLink && Model.CurrentUser.ID > 0) 1104 { 1105 Block masterDesktopActionsMenuFavorites = new Block 1106 { 1107 Id = "MasterDesktopActionsMenuFavorites", 1108 SortId = 30, 1109 Template = RenderFavorites() 1110 }; 1111 masterDesktopActionsMenu.Add(masterDesktopActionsMenuFavorites); 1112 } 1113 1114 Block masterDesktopActionsMenuLanguageSelector = new Block 1115 { 1116 Id = "MasterDesktopActionsMenuLanguageSelector", 1117 SortId = 40, 1118 Template = RenderLanguageSelector() 1119 }; 1120 masterDesktopActionsMenu.Add(masterDesktopActionsMenuLanguageSelector); 1121 1122 if (!headerOnlyPreview) 1123 { 1124 Block masterDesktopActionsMenuMiniCart = new Block 1125 { 1126 Id = "MasterDesktopActionsMenuMiniCart", 1127 SortId = 50, 1128 Template = RenderMiniCart() 1129 }; 1130 masterDesktopActionsMenu.Add(masterDesktopActionsMenuMiniCart); 1131 } 1132 1133 if (!string.IsNullOrWhiteSpace(Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonLink"))) 1134 { 1135 Block masterDesktopActionsHeaderButton = new Block 1136 { 1137 Id = "MasterDesktopActionsHeaderButton", 1138 SortId = 60, 1139 Template = RenderHeaderButton() 1140 }; 1141 masterDesktopActionsMenu.Add(masterDesktopActionsHeaderButton); 1142 } 1143 1144 Block searchBar = new Block() 1145 { 1146 Id = "SearchBar", 1147 SortId = 40, 1148 Template = RenderSearchBar(), 1149 Design = new Design() 1150 { 1151 Size = "auto", 1152 HidePadding = true, 1153 RenderType = RenderType.Column 1154 } 1155 }; 1156 1157 if (Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) 1158 { 1159 Block impersonationBar = new Block() 1160 { 1161 Id = "ImpersonationBar", 1162 SortId = 50, 1163 Template = RenderImpersonationBar(), 1164 Design = new Design() 1165 { 1166 Size = "auto-width", 1167 HidePadding = true, 1168 RenderType = RenderType.Column 1169 } 1170 }; 1171 headerBlocksPage.Add(MasterBlockId.MasterHeader, impersonationBar); 1172 } 1173 1174 switch (topLayout) 1175 { 1176 case "condensed": //2 1177 masterDesktopLogo.SortId = 10; 1178 masterDesktopLogo.Design.Size = "auto-width"; 1179 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopLogo); 1180 masterDesktopMenu.SortId = 20; 1181 masterDesktopMenu.Design.Size = "auto"; 1182 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1183 masterDesktopActionsMenuContainer.SortId = 30; 1184 masterDesktopActionsMenuContainer.Design.Size = "auto-width"; 1185 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopActionsMenuContainer); 1186 if (!navigationActionHideSearch) 1187 { 1188 searchBar.SortId = 40; 1189 searchBar.Design.Size = "12"; 1190 masterDesktopExtra.SortId = 50; 1191 headerBlocksPage.Add("MasterDesktopExtra", searchBar); 1192 } 1193 break; 1194 case "minimal": //4 1195 masterDesktopLogo.SortId = 10; 1196 masterDesktopLogo.Design.Size = "auto-width"; 1197 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopLogo); 1198 masterDesktopMenu.SortId = 10; 1199 masterDesktopMenu.Design.Size = "auto"; 1200 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1201 masterDesktopActionsMenuContainer.SortId = 20; 1202 masterDesktopActionsMenuContainer.Design.Size = "auto-width"; 1203 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopActionsMenuContainer); 1204 break; 1205 case "minimal-right": //5 1206 masterDesktopLogo.SortId = 10; 1207 masterDesktopLogo.Design.Size = "auto-width"; 1208 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopLogo); 1209 masterDesktopMenu.SortId = 10; 1210 masterDesktopMenu.Design.Size = "auto"; 1211 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1212 masterDesktopActionsMenuContainer.SortId = 20; 1213 masterDesktopActionsMenuContainer.Design.Size = "auto-width"; 1214 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopActionsMenuContainer); 1215 break; 1216 case "two-lines": //6 1217 masterDesktopLogo.SortId = 10; 1218 masterDesktopLogo.Design.Size = "auto"; 1219 headerBlocksPage.Add("MasterDesktopExtra", masterDesktopLogo); 1220 masterDesktopMenu.SortId = 10; 1221 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1222 masterDesktopActionsMenuContainer.SortId = 20; 1223 masterDesktopActionsMenuContainer.Design.Size = "auto-width"; 1224 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopActionsMenuContainer); 1225 break; 1226 case "two-lines-centered": //7 1227 masterDesktopLogo.SortId = 10; 1228 masterDesktopLogo.Design.Size = "auto"; 1229 headerBlocksPage.Add("MasterDesktopExtra", masterDesktopLogo); 1230 masterDesktopMenu.SortId = 10; 1231 masterDesktopMenu.Design.Size = "auto"; 1232 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1233 masterDesktopActionsMenuContainer.SortId = 20; 1234 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopActionsMenuContainer); 1235 break; 1236 case "splitted": //3 1237 masterDesktopLogo.SortId = 10; 1238 masterDesktopLogo.Design.Size = "auto"; 1239 headerBlocksPage.Add("MasterDesktopExtra", masterDesktopLogo); 1240 if (!navigationActionHideSearch) 1241 { 1242 searchBar.SortId = 20; 1243 searchBar.Design.Size = "auto"; 1244 headerBlocksPage.Add("MasterDesktopExtra", searchBar); 1245 } 1246 masterDesktopMenu.SortId = 10; 1247 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1248 masterDesktopActionsMenuContainer.SortId = 20; 1249 masterDesktopActionsMenuContainer.Design.Size = "auto-width"; 1250 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopActionsMenuContainer); 1251 break; 1252 case "normal": //1 1253 default: 1254 masterDesktopLogo.SortId = 10; 1255 headerBlocksPage.Add("MasterDesktopExtra", masterDesktopLogo); 1256 if (!navigationActionHideSearch) 1257 { 1258 searchBar.SortId = 20; 1259 headerBlocksPage.Add("MasterDesktopExtra", searchBar); 1260 } 1261 masterDesktopActionsMenuContainer.SortId = 30; 1262 headerBlocksPage.Add("MasterDesktopExtra", masterDesktopActionsMenuContainer); 1263 masterDesktopMenu.SortId = 10; 1264 masterDesktopActionsMenuContainer.Design.Size = "auto-width"; 1265 headerBlocksPage.Add("MasterDesktopNavigation", masterDesktopMenu); 1266 break; 1267 } 1268 1269 headerBlocksPage.Add("MasterDesktopActionsMenuContainer", masterDesktopActionsMenu); 1270 } 1271 1272 @helper RenderDesktopTools() 1273 { 1274 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopTools").OrderBy(item => item.SortId).ToList(); 1275 1276 <div class="tools-navigation dw-mod"> 1277 <div class="center-container grid top-container__center-container dw-mod"> 1278 @RenderBlockList(subBlocks) 1279 </div> 1280 </div> 1281 } 1282 1283 @helper RenderDesktopInfoBar() { 1284 <div class="info-bar"> 1285 <span> 1286 <span class="icon-fragt"> 1287 <svg id="b99d1fc7-a6b7-4942-a265-17d1252281b4" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>fragt</title><g id="b1fe2b97-238e-4f4a-87ae-a5b1cda8eafc" data-name="Shipping-Delivery Shipment shipment-upload"><g id="a50fb731-1f22-4cc9-9004-6c3121700d05" data-name="Group 43"><g id="ecf728d0-6c9f-4ca3-a769-7a2481111e49" data-name="shipment-upload"><path id="b9db74fc-ec64-44a7-ad56-7b764d22c0ea" data-name="Shape 221" d="M12,.75.75,5.25,12,9.75l11.25-4.5Z" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="eb8769ff-d891-47c7-b9de-8a871b6d810e" data-name="Shape 222" d="M.75,5.25v13.5L12,23.25V9.75Z" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="b9a27760-5045-4640-93dc-600e20862287" data-name="Shape 223" d="M23.25,5.25v13.5L12,23.25V9.75Z" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="a62b984f-805a-4ac7-b621-4a4fa700d47d" data-name="Shape 224" d="M18.187,7.275l-11.25-4.5" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="b0589827-32b9-4485-a87f-8310d03083db" data-name="Shape 225" d="M20.625,16.5l-1.875.75" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/></g></g></g></svg> 1288 </span> 1289 <strong>Fri fragt over 299,-</strong> Ellers 49 kr. 1290 </span> 1291 <span> 1292 <span class="icon-tung-fragt"> 1293 <svg id="fe143567-484e-46c7-b582-f0cf6ea455f3" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22.5 22.5"><title>tung_fragt</title><g id="f019a7a4-d232-4beb-9fac-959803f67c31" data-name="Shipping-Delivery Warehouse Fullfilment warehouse-packages"><g id="e430e407-aeab-4f98-9509-0f865cb378d1" data-name="Group 15"><g id="b2b3e927-f60b-4074-a63e-44bb069254f5" data-name="warehouse-packages"><path id="b8d4311c-49bc-46bb-b1bd-3e6df2516888" data-name="Shape 77" d="M.75,21.75h21" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="a2ee9382-4b16-433f-b8a4-bfd2397b7c2f" data-name="Shape 78" d="M.75,18.75h21" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="f71cb368-6d39-41bb-8dfc-fb79daf512ad" data-name="Shape 79" d="M2.25,18.75v3" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="ae0ae398-c340-4321-818e-3944c15916bf" data-name="Shape 80" d="M20.25,18.75v3" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="a8d03317-673b-47ac-93b0-96c94ce3a270" data-name="Shape 81" d="M8.25,18.75v3" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="b771ce21-01ec-4fc4-83f5-31551cb07ec9" data-name="Shape 82" d="M14.25,18.75v3" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="a3ba2762-39a2-49ae-a5ce-59c652b3aac0" data-name="Shape 83" d="M11.25,8.25H3.75a1.5,1.5,0,0,0-1.5,1.5v4.5a1.5,1.5,0,0,0,1.5,1.5h6a1.5,1.5,0,0,0,1.5-1.5Z" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="b18efe06-1dd7-4b02-8b1c-5d126f9c58dd" data-name="Shape 84" d="M18.75,8.25h-7.5v6a1.5,1.5,0,0,0,1.5,1.5h6a1.5,1.5,0,0,0,1.5-1.5V9.75A1.5,1.5,0,0,0,18.75,8.25Z" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="a856b953-0cf6-4660-b6d0-fdf03fa48cf7" data-name="Shape 85" d="M14.25.75h-6a1.5,1.5,0,0,0-1.5,1.5v6h9v-6A1.5,1.5,0,0,0,14.25.75Z" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="a9883f5b-5381-4d6f-b81c-1c9fa1a927ec" data-name="Shape 86" d="M11.25.75v3" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="af5a2b54-7392-4d3c-b6f3-07b9f6e0b559" data-name="Shape 87" d="M6.75,8.25v3" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="a72212af-394f-4356-b46a-f188c58eb226" data-name="Shape 88" d="M15.75,8.25v3" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/></g></g></g></svg> 1294 </span> 1295 <strong>Tung fragt 299 kr.</strong> 1296 </span> 1297 <span> 1298 <span class="icon icon-kundeservice"> 1299 <svg id="baad8211-80fa-4801-917b-98078dec3ce1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>kundeservice</title><g id="e4612943-24af-4a7a-b446-f7dcebb9f2aa" data-name="Interface-Essential Help headphones-customer-support"><g id="a84487e2-b095-4492-9e53-c6aafcddc53f" data-name="Group 199"><g id="f5ab7d05-ac24-46b7-b754-759fa8a06eac" data-name="headphones-customer-support"><path id="bcef2443-1f0d-497e-8412-156547aae9a9" data-name="Shape 886" d="M4.5,18H3.75a3,3,0,0,1-3-3V12a3,3,0,0,1,3-3H4.5a.75.75,0,0,1,.75.75v7.5A.75.75,0,0,1,4.5,18Z" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="b9cba412-fd5a-400b-88e8-ad788ddb4a3a" data-name="Shape 887" d="M20.25,18H19.5a.75.75,0,0,1-.75-.75V9.75A.75.75,0,0,1,19.5,9h.75a3,3,0,0,1,3,3v3A3,3,0,0,1,20.25,18Z" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="e2f55b7e-656a-4057-a8dc-433bb6c1f96f" data-name="Shape 888" d="M3.75,9A8.25,8.25,0,0,1,12,.75h0A8.25,8.25,0,0,1,20.25,9h0" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="bc3c30a7-7ff2-4271-9370-46416177aa17" data-name="Shape 889" d="M15,21.75h2.25a3,3,0,0,0,3-3h0V18" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/><path id="e1e9f3fa-eed5-48a8-87b7-9678f32bb11a" data-name="Shape 890" d="M13.5,23.25H12a1.5,1.5,0,0,1-1.5-1.5h0a1.5,1.5,0,0,1,1.5-1.5h1.5a1.5,1.5,0,0,1,1.5,1.5h0A1.5,1.5,0,0,1,13.5,23.25Z" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"/></g></g></g></svg> 1300 </span> 1301 <strong>Kundeservice kl. 10 - 15.</strong> <a href="/kundeservice">Kontakt os</a> 1302 </span> 1303 </div> 1304 } 1305 1306 @helper RenderDesktopToolsNavigation() 1307 { 1308 <div class="u-margin-bottom--lg u-margin-top--lg"> 1309 <div class="icon"><a href="https://certifikat.emaerket.dk/hjallerupmaskinforretning.dk" target="_blank"><img src="/Files/Templates/Designs/Rapido/images/e-maerket.png" height="28" width="28" alt="" /></a></div> 1310 <div class="icon"><a href="https://www.facebook.com/HjallerupMaskinforretning.dk" target="_blank"><img src="/Files/Templates/Designs/Rapido/images/facebook.svg" height="28" width="28" alt="" /></a></div> 1311 1312 @RenderNavigation(new 1313 { 1314 id = "topToolsNavigation", 1315 cssclass = "menu menu-tools dw-mod dwnavigation", 1316 template = "TopMenu.xslt" 1317 }) 1318 </div> 1319 } 1320 1321 @helper RenderDesktopToolsText() 1322 { 1323 string toolsText = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("ToolsText"); 1324 1325 <div class="u-margin-bottom--lg u-margin-top--lg u-ta-right">@toolsText</div> 1326 } 1327 1328 @helper RenderDesktopNavigation() 1329 { 1330 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopNavigation").OrderBy(item => item.SortId).ToList(); 1331 1332 <nav class="main-navigation dw-mod"> 1333 <div class="center-container top-container__center-container grid grid--align-center dw-mod"> 1334 @RenderBlockList(subBlocks) 1335 </div> 1336 </nav> 1337 } 1338 1339 @helper RenderDesktopExtra() 1340 { 1341 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopExtra").OrderBy(item => item.SortId).ToList(); 1342 1343 if (subBlocks.Count > 0) 1344 { 1345 <div class="header header-top dw-mod"> 1346 <div class="center-container top-container__center-container grid grid--align-center dw-mod"> 1347 @RenderBlockList(subBlocks) 1348 </div> 1349 </div> 1350 } 1351 } 1352 1353 @helper RenderDesktopLogo() 1354 { 1355 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 1356 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1357 string alignClass = topLayout == "two-lines-centered" || topLayout == "two-lines" ? "grid--align-self-center" : ""; 1358 string logo = Model.Area.Item.GetItem("Layout").GetFile("LogoImage") != null ? Model.Area.Item.GetItem("Layout").GetFile("LogoImage").PathUrlEncoded : "/Files/Images/logo-dynamicweb.png"; 1359 string logoHeight = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetString("LogoHeight")) ? Model.Area.Item.GetItem("Layout").GetString("LogoHeight") : "40"; 1360 logoHeight = logoHeight != "0" ? logoHeight : "40"; 1361 if (Path.GetExtension(logo).ToLower() != ".svg") 1362 { 1363 logo = "/Admin/Public/GetImage.ashx?height=" + logoHeight + "&amp;crop=5&amp;Compression=75&amp;image=" + logo; 1364 1365 if (Pageview.Device.ToString() == "Mobile") 1366 { 1367 logoHeight = "40"; 1368 } 1369 } 1370 else 1371 { 1372 logo = HttpUtility.UrlDecode(logo); 1373 } 1374 1375 <div class="logo @alignClass dw-mod"> 1376 <a href="/Default.aspx?ID=896" class="logo__img dw-mod u-block"> 1377 <img class="grid__cell-img logo__img dw-mod" src="@logo" /> 1378 </a> 1379 </div> 1380 } 1381 1382 @helper RenderDesktopMenu() 1383 { 1384 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1385 string menuAlignment = topLayout == "two-lines-centered" || topLayout == "minimal-right" ? "u-pull--right" : ""; 1386 1387 bool megaMenu = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("NavigationMegaMenu").SelectedValue.ToLower() == "true" ? true : false; 1388 string megamenuPromotionImage = Model.Area.Item.GetItem("Layout").GetItem("Header").GetFile("MegamenuPromotionImage") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetFile("MegamenuPromotionImage").PathUrlEncoded : ""; 1389 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 1390 int startLevel = renderPagesInToolBar ? 1 : 0; 1391 1392 <div class="grid__cell"> 1393 <div class="@menuAlignment"> 1394 @if (!megaMenu) 1395 { 1396 @RenderNavigation(new 1397 { 1398 id = "topnavigation", 1399 cssclass = "menu dw-mod dwnavigation u-full-max-width", 1400 startLevel = @startLevel, 1401 ecomStartLevel = @startLevel + 1, 1402 endlevel = 5, 1403 expandmode = "all", 1404 template = "BaseMenuWithDropdown.xslt" 1405 }); 1406 } 1407 else 1408 { 1409 @RenderNavigation(new 1410 { 1411 id = "topnavigation", 1412 cssclass = "menu dw-mod dwnavigation u-full-max-width", 1413 startLevel = @startLevel, 1414 ecomStartLevel = @startLevel + 1, 1415 endlevel = 5, 1416 promotionImage = megamenuPromotionImage, 1417 promotionLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("MegamenuPromotionLink"), 1418 expandmode = "all", 1419 template = "BaseMegaMenu_custom.xslt" 1420 }); 1421 } 1422 </div> 1423 </div> 1424 } 1425 1426 @helper RenderDesktopActionsMenu() 1427 { 1428 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopActionsMenu").OrderBy(item => item.SortId).ToList(); 1429 1430 <ul class="menu dw-mod"> 1431 @RenderBlockList(subBlocks) 1432 </ul> 1433 } 1434 1435 @helper RenderLanguageSelector() 1436 { 1437 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1438 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"; 1439 string menuLinkClass = topLayout != "normal" ? "menu__link" : "header-menu__link"; 1440 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() : ""; 1441 1442 if (Model.Languages.Count > 1) 1443 { 1444 <li class="@liClasses is-dropdown is-dropdown--no-icon"> 1445 <div class="@menuLinkClass menu__link--icon dw-mod u-ta-center"> 1446 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("LanguageIcon").SelectedValue fa-1_5x"></i> 1447 <div class="languages__text">@Translate("Languages")</div> 1448 </div> 1449 <div class="menu menu--dropdown dw-mod"> 1450 @foreach (var lang in Model.Languages) 1451 { 1452 string langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>" + lang.Name; 1453 1454 if (languageViewType == "flag") 1455 { 1456 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + "\"></span>"; 1457 } 1458 1459 if (languageViewType == "name") 1460 { 1461 langInfo = lang.Name; 1462 } 1463 1464 <a href="/Default.aspx?AreaID=@Dynamicweb.Services.Pages.GetPage(lang.Page.ID).Area.ID" class="menu-dropdown__item menu-dropdown__item--link dw-mod">@langInfo</a> 1465 } 1466 </div> 1467 </li> 1468 } 1469 } 1470 1471 @helper RenderMiniCart() 1472 { 1473 bool navigationItemsHideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 1474 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 1475 int cartPageId = GetPageIdByNavigationTag("CartPage"); 1476 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 1477 1478 if (!onlyPreview && !navigationItemsHideCart) 1479 { 1480 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1481 string liClasses = topLayout != "normal" ? "menu__item menu__item--horizontal menu__item--top-level dw-mod" : "menu__item menu__item--horizontal menu--clean dw-mod"; 1482 string menuLinkClass = topLayout != "normal" ? "menu__link" : "header-menu__link"; 1483 string cartProductsCount = Model.Cart.TotalProductsCount.ToString(); 1484 string counterPosition = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue; 1485 bool showPrice = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 1486 string cartProductsTotalPrice = showPrice && Model.Cart.TotalPrice != null ? Model.Cart.TotalPrice.Price.Formatted : ""; 1487 cartProductsTotalPrice = counterPosition == "right" ? cartProductsTotalPrice : ""; 1488 1489 if (showPrice && counterPosition == "right") 1490 { 1491 cartProductsCount = Translate("Cart") + "(" + cartProductsCount + ")"; 1492 } 1493 1494 1495 <li class="@liClasses" id="miniCartWrapper" onmouseenter="Cart.UpdateMiniCart('miniCartWrapper', 'miniCart', 'cartCounter', '/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart')"> 1496 <div class="mini-cart dw-mod"> 1497 <a href="/Default.aspx?ID=@cartPageId&Purge=True" id="miniCartCounterWrap" class="@menuLinkClass menu__link--icon dw-mod js-mini-cart-button u-ta-center"> 1498 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue fa-1_5x"></i> 1499 <div class="mini-cart__text">@Translate("Shopping cart") ( 1500 <div class="mini-cart__counter dw-mod"> 1501 <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"> 1502 <div class="js-mini-cart-counter-content">@cartProductsCount @cartProductsTotalPrice</div> 1503 </div> 1504 </div> 1505 )</div> 1506 </a> 1507 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 1508 { 1509 <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> 1510 } 1511 </div> 1512 </li> 1513 } 1514 } 1515 1516 @helper RenderSignIn() 1517 { 1518 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 1519 string userInitials = ""; 1520 int pageId = Model.TopPage.ID; 1521 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 1522 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 1523 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 1524 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 1525 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 1526 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 1527 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 1528 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideAccount"); 1529 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 1530 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 1531 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 1532 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 1533 1534 string linkStart = "/Default.aspx?ID="; 1535 if (Model.CurrentUser.ID <= 0) 1536 { 1537 linkStart = linkStart + signInProfilePageId + "&RedirectPageId="; 1538 } 1539 1540 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 1541 string myProfilePageLink = linkStart + myProfilePageId; 1542 string myOrdersPageLink = linkStart + myOrdersPageId; 1543 string myFavoritesPageLink = linkStart + myFavoritesPageId; 1544 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 1545 1546 if (Model.CurrentUser.ID != 0) 1547 { 1548 if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) 1549 { 1550 string[] names = Model.CurrentUser.Name.Split(' '); 1551 userInitials += Model.CurrentUser.Name.Substring(0, 1); 1552 1553 if (names.Length > 1) 1554 { 1555 userInitials += names[names.Length - 1].Substring(0, 1); 1556 } 1557 } 1558 else 1559 { 1560 userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; 1561 userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; 1562 userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; 1563 userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; 1564 userInitials += userInitials == "" ? Model.CurrentUser.UserName.Substring(0, 2) : ""; 1565 } 1566 } 1567 1568 if (!navigationItemsHideSignIn) 1569 { 1570 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1571 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"; 1572 string menuLinkClass = topLayout != "normal" ? "menu__link" : "header-menu__link"; 1573 1574 <li class="@liClasses is-dropdown is-dropdown--no-icon"> 1575 <!--div class="@menuLinkClass menu__link--icon dw-mod u-ta-center"> 1576 @if (Model.CurrentUser.ID <= 0) 1577 { 1578 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignInProfileIcon").SelectedValue fa-1_5x"></i> 1579 <div class="sign-in__text">@Translate("Profile")</div> 1580 } 1581 else 1582 { 1583 <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit"><div class="circle-icon-btn">@userInitials.ToUpper()</div></a> 1584 } 1585 </div--> 1586 <div class="menu menu--dropdown sign-in-dropdown dw-mod"> 1587 <ul class="list list--clean dw-mod"> 1588 @if (Model.CurrentUser.ID <= 0) 1589 { 1590 <li> 1591 <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> 1592 </li> 1593 if (!hideCreateAccountLink) 1594 { 1595 <li> 1596 <a href="/default.aspx?ID=@createAccountPageId" class="list__link dw-mod">@Translate("Create account")</a> 1597 </li> 1598 } 1599 <li> 1600 <a href="@forgotPasswordPageLink" class="list__link dw-mod">@Translate("Forgot your password?")</a> 1601 </li> 1602 if (!hideMyProfileLink || !hideMyOrdersLink || !hideMyFavoritesLink || !hideMySavedCardsLink) 1603 { 1604 <li class="list__seperator dw-mod"></li> 1605 } 1606 } 1607 @if (!hideMyProfileLink) 1608 { 1609 <li> 1610 <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> 1611 </li> 1612 } 1613 @if (!hideMyOrdersLink) 1614 { 1615 <li> 1616 <a href="@myOrdersPageLink" class="list__link dw-mod"><i class="fas fa-list u-margin-right"></i>@Translate("My Orders")</a> 1617 </li> 1618 } 1619 @if (!hideMyFavoritesLink) 1620 { 1621 <li> 1622 <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> 1623 </li> 1624 } 1625 @if (!hideMySavedCardsLink) 1626 { 1627 <li> 1628 <a href="@mySavedCardsPageLink" class="list__link dw-mod"><i class="fas fa-credit-card u-margin-right"></i>@Translate("My Saved cards")</a> 1629 </li> 1630 } 1631 @if (Model.CurrentUser.ID > 0) 1632 { 1633 if (!hideMyProfileLink || !hideMyOrdersLink || !hideMyFavoritesLink || !hideMySavedCardsLink) 1634 { 1635 <li class="list__seperator dw-mod"></li> 1636 } 1637 <li> 1638 <a href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId" class="list__link dw-mod">@Translate("Sign out")</a> 1639 </li> 1640 } 1641 </ul> 1642 </div> 1643 </li> 1644 } 1645 } 1646 1647 @helper RenderFavorites() 1648 { 1649 bool navigationItemsHideFavorites = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideFavorites"); 1650 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 1651 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 1652 1653 string linkStart = "/Default.aspx?ID="; 1654 if (Model.CurrentUser.ID <= 0) 1655 { 1656 linkStart = linkStart + signInProfilePageId + "&RedirectPageId="; 1657 } 1658 1659 string myFavoritesPageLink = linkStart + myFavoritesPageId; 1660 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 1661 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"; 1662 string menuLinkClass = topLayout != "normal" ? "menu__link" : "header-menu__link"; 1663 1664 <li class="@liClasses"> 1665 <a href="@myFavoritesPageLink" class="@menuLinkClass menu__link--icon dw-mod u-ta-center"> 1666 <i class="fas fa-@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue fa-1_5x"></i> 1667 <div class="favorites__text">@Translate("Favorites")</div> 1668 </a> 1669 </li> 1670 } 1671 1672 @helper RenderHeaderButton() 1673 { 1674 string headerButtonText = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonText"); 1675 string headerButtonLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonLink"); 1676 string headerButtonType = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("HeaderButtonType") != null ? "btn--" + Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("HeaderButtonType").SelectedName.ToLower() : ""; 1677 1678 <li class="menu__item menu__item--horizontal menu--clean dw-mod"> 1679 <a class="btn @headerButtonType dw-mod u-no-margin u-margin-top u-margin-left" href="@headerButtonLink">@headerButtonText</a> 1680 </li> 1681 } 1682 1683 @helper RenderSearchBar(string alignment = "left") 1684 { 1685 string searchFeedId = ""; 1686 string searchSecondFeedId = ""; 1687 int groupsFeedId; 1688 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 1689 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 1690 string resultPageLink; 1691 string searchPlaceholder; 1692 string searchType = "product-search"; 1693 string searchTemplate; 1694 string searchContentTemplate = ""; 1695 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") != null ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 1696 bool showGroups = true; 1697 1698 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 1699 { 1700 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 1701 resultPageLink = contentSearchPageLink; 1702 searchPlaceholder = Translate("Search page"); 1703 groupsFeedId = 0; 1704 searchType = "content-search"; 1705 searchTemplate = "SearchPagesTemplate"; 1706 showGroups = false; 1707 } 1708 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 1709 { 1710 searchFeedId = productsPageId + "&feed=true"; 1711 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 1712 resultPageLink = Converter.ToString(productsPageId); 1713 searchPlaceholder = Translate("Search products or pages"); 1714 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 1715 searchType = "combined-search"; 1716 searchTemplate = "SearchProductsTemplateWrap"; 1717 searchContentTemplate = "SearchPagesTemplateWrap"; 1718 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 1719 } 1720 else 1721 { 1722 resultPageLink = Converter.ToString(productsPageId); 1723 searchFeedId = productsPageId + "&feed=true"; 1724 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 1725 searchPlaceholder = Translate("Search products"); 1726 searchTemplate = "SearchProductsTemplate"; 1727 searchType = "product-search"; 1728 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 1729 } 1730 1731 <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"> 1732 @if (showGroups) 1733 { 1734 <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> 1735 <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> 1736 } 1737 <div class="typeahead-search-field"> 1738 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" placeholder="@searchPlaceholder" value="@searchValue"> 1739 @if (string.IsNullOrEmpty(searchSecondFeedId)) 1740 { 1741 <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> 1742 } 1743 else 1744 { 1745 <div class="dropdown dropdown--absolute-position dropdown--combined grid @(alignment == "right" ? "dropdown--right-aligned" : "")"> 1746 <div class="js-handlebars-root js-typeahead-search-content u-hidden" id="ProductSearchBarContent" data-template="@searchTemplate" data-json-feed="/Default.aspx?ID=@searchFeedId&feedType=productsOnly" data-init-onload="false"></div> 1747 <div class="js-handlebars-root js-typeahead-additional-search-content u-hidden" id="ContentSearchBarContent" data-template="@searchContentTemplate" data-json-feed="/Default.aspx?ID=@searchSecondFeedId" data-init-onload="false"></div> 1748 </div> 1749 } 1750 </div> 1751 <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> 1752 </div> 1753 } 1754 1755 @helper RenderMiniSearch() 1756 { 1757 string searchFeedId = ""; 1758 string searchSecondFeedId = ""; 1759 int groupsFeedId; 1760 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 1761 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 1762 string resultPageLink; 1763 string searchPlaceholder; 1764 string searchType = "product-search"; 1765 string searchTemplate; 1766 string searchContentTemplate = ""; 1767 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") != null ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 1768 bool showGroups = true; 1769 1770 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 1771 { 1772 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 1773 resultPageLink = contentSearchPageLink; 1774 searchPlaceholder = Translate("Search page"); 1775 groupsFeedId = 0; 1776 searchType = "content-search"; 1777 searchTemplate = "SearchPagesTemplate"; 1778 showGroups = false; 1779 } 1780 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 1781 { 1782 searchFeedId = productsPageId + "&feed=true"; 1783 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 1784 resultPageLink = Converter.ToString(productsPageId); 1785 searchPlaceholder = Translate("Search products or pages"); 1786 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 1787 searchType = "combined-search"; 1788 searchTemplate = "SearchProductsTemplateWrap"; 1789 searchContentTemplate = "SearchPagesTemplateWrap"; 1790 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 1791 } 1792 else 1793 { 1794 resultPageLink = Converter.ToString(productsPageId); 1795 searchFeedId = productsPageId + "&feed=true"; 1796 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 1797 searchPlaceholder = Translate("Search products"); 1798 searchTemplate = "SearchProductsTemplate"; 1799 searchType = "product-search"; 1800 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 1801 } 1802 1803 <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()"> 1804 <div class="menu__link menu__link--icon dw-mod"> 1805 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SearchIcon").SelectedValue fa-1_5x"></i> 1806 </div> 1807 <div class="menu menu--dropdown u-w380px top-micro-search dw-mod"> 1808 <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"> 1809 <div class="typeahead-search-field"> 1810 <input type="text" class="u-no-margin u-full-width js-typeahead-search-field" id="headerSearch" placeholder="@searchPlaceholder" value="@searchValue"> 1811 @if (string.IsNullOrEmpty(searchSecondFeedId)) 1812 { 1813 <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> 1814 } 1815 else 1816 { 1817 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--right-aligned"> 1818 <div class="js-handlebars-root js-typeahead-search-content grid__col-sm-7 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> 1819 <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> 1820 </div> 1821 } 1822 </div> 1823 </div> 1824 </div> 1825 </li> 1826 } 1827 1828 @helper RenderImpersonationBar() 1829 { 1830 int impersonationPageId = GetPageIdByNavigationTag("Impersonation"); 1831 1832 <div class="u-color-warning--bg"> 1833 <div class="center-container top-container__center-container dw-mod"> 1834 @*Impersonation*@ 1835 <div class="grid"> 1836 <div class="grid--align-self-center grid__col-x"> 1837 @if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 1838 { 1839 string stopImpersonateTranslation = Translate("Stop impersonation"); 1840 string username = ""; 1841 if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) 1842 { 1843 username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; 1844 } 1845 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) 1846 { 1847 username = Model.CurrentSecondaryUser.Name; 1848 } 1849 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) 1850 { 1851 username = Model.CurrentSecondaryUser.Email; 1852 } 1853 else 1854 { 1855 username = Model.CurrentSecondaryUser.UserName; 1856 } 1857 <div class="grid-cell"> 1858 <div class="u-pull--left u-bold u-margin-top"> 1859 <i class="fas fa-user-secret"></i> 1860 @Pageview.User.UserName<text>&nbsp;</text>@Translate("is impersonating")<text>&nbsp;</text>@username 1861 </div> 1862 <form method="post" class="u-pull--right u-no-margin"> 1863 <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 1864 </form> 1865 </div> 1866 } 1867 else 1868 { 1869 string viewListTranslation = Translate("View the list of users you can impersonate"); 1870 <div class="grid-cell u-bold"> 1871 <i class="fas fa-user-secret"></i> 1872 <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> 1873 </div> 1874 } 1875 </div> 1876 </div> 1877 </div> 1878 </div> 1879 } 1880 1881 </text> 1882 } 1883 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 1884 1885 @using System 1886 @using System.Web 1887 @using System.Collections.Generic 1888 @using Dynamicweb.Rapido.Blocks.Extensibility 1889 @using Dynamicweb.Rapido.Blocks 1890 1891 @functions { 1892 BlocksPage footerBlocksPage = BlocksPage.GetBlockPage("Master"); 1893 } 1894 1895 @{ 1896 string footerColumnOneContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne").GetString("Content") : ""; 1897 string footerColumnTwoContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo").GetString("Content") : ""; 1898 string footerColumnThreeContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree").GetString("Content") : ""; 1899 string footerColumnFourContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnFour") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnFour").GetString("Content") : ""; 1900 string footerColumnFiveContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnFive") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnFive").GetString("Content") : ""; 1901 string footerColumnOneHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne").GetString("Header") : ""; 1902 string footerColumnTwoHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo").GetString("Header") : ""; 1903 string footerColumnThreeHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree").GetString("Header") : ""; 1904 string footerColumnFourHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnFour") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnFour").GetString("Header") : ""; 1905 string footerColumnFiveHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnFive") != null ? Model.Area.Item.GetItem("Layout").GetItem("FooterColumnFive").GetString("Header") : ""; 1906 1907 Block masterFooterContent = new Block() 1908 { 1909 Id = "MasterFooterContent", 1910 SortId = 10, 1911 Template = RenderFooter(), 1912 SkipRenderBlocksList = true 1913 }; 1914 footerBlocksPage.Add(MasterBlockId.MasterFooter, masterFooterContent); 1915 1916 if (!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) 1917 { 1918 Block masterFooterColumnOne = new Block 1919 { 1920 Id = "MasterFooterColumnOne", 1921 SortId = 10, 1922 Template = RenderFooterColumn(footerColumnOneHeader, footerColumnOneContent), 1923 Design = new Design { 1924 Size = "auto", 1925 RenderType = RenderType.Column 1926 } 1927 }; 1928 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnOne); 1929 } 1930 1931 if (!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) 1932 { 1933 Block masterFooterColumnTwo = new Block 1934 { 1935 Id = "MasterFooterColumnTwo", 1936 SortId = 20, 1937 Template = RenderFooterColumn(footerColumnTwoHeader, footerColumnTwoContent), 1938 Design = new Design 1939 { 1940 Size = "auto", 1941 RenderType = RenderType.Column 1942 } 1943 }; 1944 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnTwo); 1945 } 1946 1947 if (!string.IsNullOrEmpty(footerColumnThreeContent) || !string.IsNullOrEmpty(footerColumnThreeHeader)) 1948 { 1949 Block masterFooterColumnThree = new Block 1950 { 1951 Id = "MasterFooterColumnThree", 1952 SortId = 30, 1953 Template = RenderFooterColumn(footerColumnThreeHeader, footerColumnThreeContent), 1954 Design = new Design 1955 { 1956 Size = "auto", 1957 RenderType = RenderType.Column 1958 } 1959 }; 1960 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnThree); 1961 } 1962 1963 if (!string.IsNullOrEmpty(footerColumnFourContent) || !string.IsNullOrEmpty(footerColumnFourHeader)) 1964 { 1965 Block masterFooterColumnFour = new Block 1966 { 1967 Id = "MasterFooterColumnFour", 1968 SortId = 30, 1969 Template = RenderFooterColumn(footerColumnFourHeader, footerColumnFourContent), 1970 Design = new Design 1971 { 1972 Size = "auto", 1973 RenderType = RenderType.Column 1974 } 1975 }; 1976 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnFour); 1977 } 1978 1979 if (!string.IsNullOrEmpty(footerColumnFiveContent) || !string.IsNullOrEmpty(footerColumnFiveHeader)) 1980 { 1981 Block masterFooterColumnFive = new Block 1982 { 1983 Id = "MasterFooterColumnFive", 1984 SortId = 30, 1985 Template = RenderFooterColumn(footerColumnFiveHeader, footerColumnFiveContent), 1986 Design = new Design 1987 { 1988 Size = "auto", 1989 RenderType = RenderType.Column 1990 } 1991 }; 1992 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnFive); 1993 } 1994 1995 if (Model.Area.Item.GetItem("Layout").GetBoolean("FooterNewsletterSignUp")) 1996 { 1997 Block masterFooterNewsletterSignUp = new Block 1998 { 1999 Id = "MasterFooterNewsletterSignUp", 2000 SortId = 40, 2001 Template = RenderFooterNewsletterSignUp(), 2002 Design = new Design 2003 { 2004 Size = "auto", 2005 RenderType = RenderType.Column 2006 } 2007 }; 2008 footerBlocksPage.Add("MasterFooterContent", masterFooterNewsletterSignUp); 2009 } 2010 2011 if (!string.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetString("FooterCopyrightText"))) { 2012 Block masterFooterCopyright = new Block 2013 { 2014 Id = "MasterFooterCopyright", 2015 SortId = 70, 2016 Template = RenderFooterCopyright(), 2017 Design = new Design 2018 { 2019 Size = "12", 2020 RenderType = RenderType.Column 2021 } 2022 }; 2023 footerBlocksPage.Add("MasterFooterContent", masterFooterCopyright); 2024 } 2025 } 2026 2027 @helper RenderFooter() { 2028 List<Block> subBlocks = this.footerBlocksPage.GetBlockListById("MasterFooterContent").OrderBy(item => item.SortId).ToList(); 2029 2030 <footer class="footer dw-mod"> 2031 <div class="center-container top-container__center-container dw-mod"> 2032 <div class="grid grid--external-bleed-x"> 2033 @RenderBlockList(subBlocks) 2034 </div> 2035 </div> 2036 </footer> 2037 } 2038 2039 @helper RenderFooterColumn(string header, string content) { 2040 <h3 class="footer__heading dw-mod">@header</h3> 2041 <div class="footer__content dw-mod"> 2042 @content 2043 </div> 2044 } 2045 2046 @helper RenderFooterNewsletterSignUp() { 2047 string newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp").ToString(); 2048 2049 <h3 class="footer__heading dw-mod">@Translate("Mailing list")</h3> 2050 <div class="footer__content dw-mod"> 2051 <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> 2052 <form class="form dw-mod" name="NewsletterRedirect" action='/Default.aspx' method="get" enctype="multipart/form-data"> 2053 <input name="ID" value="@newsletterSignUpPageId" type="hidden" /> 2054 <div class="form__field-combi"> 2055 <input name="NewsletterEmail" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' /> 2056 <input class="btn btn--primary btn--condensed dw-mod" type="submit" id="Submitter" value='@Translate("Go", "Go")' /> 2057 </div> 2058 </form> 2059 </div> 2060 } 2061 2062 @helper RenderFooterCopyright() { 2063 <div class="grid__col-12 footer__copyright dw-mod"> 2064 <p>@Model.Area.Item.GetItem("Layout").GetString("FooterCopyrightText")</p> 2065 </div> 2066 } 2067 2068 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2069 2070 @using System 2071 @using System.Web 2072 @using System.Collections.Generic 2073 @using Dynamicweb.Rapido.Blocks.Extensibility 2074 @using Dynamicweb.Rapido.Blocks 2075 2076 @{ 2077 BlocksPage miniCartBlocksPage = BlocksPage.GetBlockPage("Master"); 2078 bool navigationItemsHideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 2079 2080 if (!navigationItemsHideCart) 2081 { 2082 Block miniCartScriptTemplates = new Block() 2083 { 2084 Id = "MasterMiniCartTemplates", 2085 SortId = 1, 2086 Template = RenderMiniCartScriptTemplates(), 2087 SkipRenderBlocksList = true, 2088 BlocksList = new List<Block> 2089 { 2090 new Block { 2091 Id = "MiniCartHeader", 2092 SortId = 10, 2093 Template = RenderMiniCartHeader() 2094 }, 2095 new Block { 2096 Id = "MiniCartOrderLines", 2097 SortId = 20, 2098 Template = RenderMiniCartOrderLines() 2099 }, 2100 new Block { 2101 Id = "MiniCartFees", 2102 SortId = 30, 2103 Template = RenderMiniCartFees() 2104 }, 2105 new Block { 2106 Id = "MiniCartPoints", 2107 SortId = 40, 2108 Template = RenderMiniCartPoints() 2109 }, 2110 new Block { 2111 Id = "MiniCartTotal", 2112 SortId = 50 , 2113 Template = RenderMiniCartTotal() 2114 } 2115 } 2116 }; 2117 2118 miniCartBlocksPage.Add(MasterBlockId.MasterBottomSnippets, miniCartScriptTemplates); 2119 } 2120 } 2121 2122 @helper RenderMiniCartScriptTemplates() 2123 { 2124 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMiniCartTemplates").OrderBy(item => item.SortId).ToList(); 2125 2126 int cartPageId = GetPageIdByNavigationTag("CartPage"); 2127 bool showPriceInMiniCartCounter = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 2128 showPriceInMiniCartCounter = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue == "right" ? showPriceInMiniCartCounter : false; 2129 showPriceInMiniCartCounter = Pageview.Device.ToString() == "Mobile" ? false : showPriceInMiniCartCounter; 2130 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 2131 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 2132 string addingToCartNotification = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType").SelectedValue : ""; 2133 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 2134 2135 2136 <script id="MiniCartCounterContent" type="text/x-template"> 2137 {{#.}} 2138 <div class="js-mini-cart-counter-content dw-mod"> 2139 @if (showPriceInMiniCartCounter) { 2140 @Translate("Cart")<text>({{numberofproducts}}) {{totalprice}}</text> 2141 } else { 2142 <text>{{numberofproducts}}</text> 2143 } 2144 </div> 2145 {{/.}} 2146 </script> 2147 2148 <script id="MiniCartContent" type="text/x-template"> 2149 {{#.}} 2150 @if (useGoogleTagManager) 2151 { 2152 <text>{{{googleEnchantImpressionEmptyCart OrderLines}}}</text> 2153 } 2154 <div class="mini-cart-dropdown__inner {{isempty}} dw-mod"> 2155 <h4 class="u-margin-bottom u-margin-top">@Translate("Shopping cart")</h4> 2156 <div class="mini-cart-dropdown__body dw-mod"> 2157 <table class="table mini-cart-table dw-mod"> 2158 @RenderBlockList(subBlocks) 2159 </table> 2160 </div> 2161 2162 <table class="table mini-cart-table dw-mod"> 2163 <tr class="mini-cart-orderlines__footer dw-mod"> 2164 <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> 2165 <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> 2166 </tr> 2167 </table> 2168 </div> 2169 {{/.}} 2170 </script> 2171 2172 <script id="MiniCartOrderline" type="text/x-template"> 2173 <tr class="{{isempty}}"> 2174 <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> 2175 <td> 2176 <a href="{{link}}" class="mini-cart-orderlines__name" title="{{name}}">{{name}}</a> 2177 {{#if variantname}} 2178 <a href="{{link}}" class="mini-cart-orderlines__name mini-cart-orderlines__name--small">{{variantname}}</a> 2179 {{/if}} 2180 {{#if unitname}} 2181 <div class="mini-cart-orderlines__name mini-cart-orderlines__name--small">{{unitname}}</div> 2182 {{/if}} 2183 </td> 2184 <td class="u-ta-right">{{quantity}}</td> 2185 <td class="u-ta-right"> 2186 {{#if pointsTotal}} 2187 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 2188 {{else}} 2189 {{totalprice}} 2190 {{/if}} 2191 </td> 2192 </tr> 2193 </script> 2194 2195 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 2196 <tr class="table__row--no-border {{isempty}}"> 2197 <td>&nbsp;</td> 2198 <td><div class="mini-cart-orderlines__name dw-mod">{{name}}</div></td> 2199 <td class="u-ta-right">&nbsp;</td> 2200 <td class="u-ta-right">{{totalprice}}</td> 2201 </tr> 2202 </script> 2203 2204 if (!onlyPreview && addingToCartNotification == "modal") 2205 { 2206 <div id="LastAddedProductModal" data-template="LastAddedProductTemplate"></div> 2207 2208 <script id="LastAddedProductTemplate" type="text/x-template"> 2209 <!-- Trigger for the login modal --> 2210 <input type="checkbox" id="LastAddedProductModalTrigger" class="modal-trigger" /> 2211 2212 <!-- Login modal --> 2213 <div class="modal-container"> 2214 <label for="LastAddedProductModalTrigger" class="modal-overlay"></label> 2215 <div class="modal modal--md"> 2216 <div class="modal__header"> 2217 <h2>@Translate("Product is added to the cart")</h2> 2218 </div> 2219 <div class="modal__body"> 2220 <div class="grid"> 2221 <div> 2222 <a href="{{productInfo.link}}"><img src="{{productInfo.image}}" alt="{{productInfo.name}}" /></a> 2223 </div> 2224 <div class="u-padding"> 2225 <span>{{quantity}}</span> x 2226 </div> 2227 <div class="grid__col-auto"> 2228 <div>{{productInfo.name}}</div> 2229 {{#if productInfo.variantName}} 2230 <small class="u-margin-bottom-5px">{{productInfo.variantName}}</small> 2231 {{/if}} 2232 {{#if productInfo.unitName}} 2233 <small class="u-margin-bottom-5px">{{productInfo.unitName}}</small> 2234 {{/if}} 2235 </div> 2236 </div> 2237 <div class="modal__footer u-margin-top--lg"> 2238 <label class="btn btn--secondary u-pull--left u-no-margin dw-mod btn--sm" for="LastAddedProductModalTrigger">@Translate("Continue shopping")</label> 2239 <a href="/cart" class="btn btn--primary u-pull--right u-no-margin dw-mod btn--sm">@Translate("Proceed to checkout")</a> 2240 </div> 2241 </div> 2242 <label class="modal__close-btn" for="LastAddedProductModalTrigger"></label> 2243 </div> 2244 </div> 2245 </script> 2246 <script> 2247 document.addEventListener('addToCart', function (event) { 2248 Cart.ShowLastAddedProductModal(event.detail); 2249 }); 2250 </script> 2251 } 2252 else if (!onlyPreview && addingToCartNotification == "toggle") 2253 { 2254 <script> 2255 document.addEventListener('addToCart', function () { 2256 Cart.ToggleMiniCart('miniCartWrapper', 'miniCart', 'cartCounter', '@miniCartFeedPageId'); 2257 }); 2258 </script> 2259 } 2260 } 2261 2262 @helper RenderMiniCartHeader() { 2263 <thead> 2264 <tr> 2265 <td>&nbsp;</td> 2266 <td>@Translate("Product")</td> 2267 <td class="u-ta-right">@Translate("Qty")</td> 2268 <td class="u-ta-right" width="120">@Translate("Price")</td> 2269 </tr> 2270 </thead> 2271 } 2272 2273 @helper RenderMiniCartOrderLines() { 2274 <text> 2275 {{#OrderLines}} 2276 {{#ifCond template "===" "CartOrderline"}} 2277 {{>MiniCartOrderline}} 2278 {{/ifCond}} 2279 {{#ifCond template "===" "CartOrderlineMobile"}} 2280 {{>MiniCartOrderline}} 2281 {{/ifCond}} 2282 {{#ifCond template "===" "CartOrderlineDiscount"}} 2283 {{>MiniCartOrderlineDiscount}} 2284 {{/ifCond}} 2285 {{/OrderLines}} 2286 </text> 2287 } 2288 2289 @helper RenderMiniCartFees() { 2290 <tr> 2291 <td><i class="fas fa-credit-card"></i></td> 2292 <td>{{paymentmethod}}</td> 2293 <td colspan="2" class="u-ta-right" width="130">{{paymentfee}}</td> 2294 </tr> 2295 <tr> 2296 <td><i class="fas fa-truck"></i></td> 2297 <td>{{shippingmethod}}</td> 2298 <td colspan="2" class="u-ta-right" width="130">{{shippingfee}}</td> 2299 </tr> 2300 } 2301 2302 @helper RenderMiniCartPoints() { 2303 <text> 2304 {{#if earnings}} 2305 <tr> 2306 <td colspan="2">@Translate("Earnings")</td> 2307 <td colspan="2" class="u-ta-right" width="130"><span class="u-color--loyalty-points">{{earnings}}</span> @Translate("points")</td> 2308 </tr> 2309 {{/if}} 2310 </text> 2311 } 2312 2313 @helper RenderMiniCartTotal() { 2314 <tr class="mini-cart-totals dw-mod"> 2315 <td colspan="2">@Translate("Total")</td> 2316 <td class="u-ta-right">{{numberofproducts}}</td> 2317 <td class="u-ta-right" width="130">{{totalprice}}</td> 2318 </tr> 2319 } 2320 2321 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2322 2323 @using System 2324 @using System.Web 2325 @using System.Collections.Generic 2326 @using Dynamicweb.Rapido.Blocks.Extensibility 2327 @using Dynamicweb.Rapido.Blocks 2328 @using Dynamicweb.Ecommerce.Common 2329 2330 @{ 2331 BlocksPage referencesBlocksPage = BlocksPage.GetBlockPage("Master"); 2332 2333 Block masterScriptReferences = new Block() 2334 { 2335 Id = "MasterScriptReferences", 2336 SortId = 1, 2337 Template = RenderMasterScriptReferences() 2338 }; 2339 referencesBlocksPage.Add(MasterBlockId.MasterReferences, masterScriptReferences); 2340 } 2341 2342 @helper RenderMasterScriptReferences() { 2343 <script src="/Files/Templates/Designs/Rapido/js/handlebars-v4.0.11.js"></script> 2344 <script src="/Files/Templates/Designs/Rapido/js/master.min.js"></script> 2345 2346 if (Model.Area.Item.GetItem("Settings").GetBoolean("UseCustomJavascript")) 2347 { 2348 <script src="/Files/Templates/Designs/Rapido/js/custom.min.js"></script> 2349 } 2350 2351 <script src="/Files/Templates/Designs/Rapido/js/custom.min.js"></script> 2352 } 2353 2354 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2355 2356 @using System 2357 @using System.Web 2358 @using System.Collections.Generic 2359 @using Dynamicweb.Rapido.Blocks.Extensibility 2360 @using Dynamicweb.Rapido.Blocks 2361 2362 @{ 2363 BlocksPage searchBlocksPage = BlocksPage.GetBlockPage("Master"); 2364 bool navigationItemsHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 2365 2366 if (!navigationItemsHideSearch) 2367 { 2368 Block masterSearchScriptTemplates = new Block() 2369 { 2370 Id = "MasterSearchScriptTemplates", 2371 SortId = 1, 2372 Template = RenderSearchScriptTemplates() 2373 }; 2374 2375 searchBlocksPage.Add(MasterBlockId.MasterBottomSnippets, masterSearchScriptTemplates); 2376 } 2377 } 2378 2379 @helper RenderSearchScriptTemplates() 2380 { 2381 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 2382 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 2383 bool useFacebookPixel = !string.IsNullOrWhiteSpace(Pageview.AreaSettings.GetItem("Settings").GetString("FacebookPixelID")); 2384 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 2385 bool useGoogleTagManager = !string.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID")); 2386 2387 <script id="SearchGroupsTemplate" type="text/x-template"> 2388 {{#.}} 2389 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 2390 {{/.}} 2391 </script> 2392 2393 <script id="SearchProductsTemplate" type="text/x-template"> 2394 {{#each .}} 2395 {{#Product}} 2396 {{#ifCond template "!==" "SearchMore"}} 2397 <li class="dropdown__item dropdown__item--seperator dw-mod"> 2398 @if (useFacebookPixel) 2399 { 2400 <text>{{{facebookPixelSearch name number priceDouble currency searchParameter}}}</text> 2401 } 2402 @if (useGoogleTagManager) 2403 { 2404 <text>{{{googleEnchantImpression 'Search results' currency googleImpression}}}</text> 2405 } 2406 <div> 2407 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left" onclick="{{googleImpressionClick}}" title="{{name}}"> 2408 <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> 2409 <div class="u-pull--left"> 2410 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 2411 @if (!onlyPreview) 2412 { 2413 <div>{{price}}</div> 2414 } 2415 </div> 2416 </a> 2417 <div class="u-margin-left u-pull--right u-w80px"> 2418 <button class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside" 2419 onclick="Cart.AddToCart(event, { 2420 id: '{{productId}}', 2421 quantity: 1, 2422 productInfo: {{productInfo}} 2423 }); {{facebookPixelAction}}"> 2424 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue js-ignore-click-outside"></i> 2425 </button> 2426 <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> 2427 </div> 2428 </div> 2429 </li> 2430 {{/ifCond}} 2431 {{#ifCond template "===" "SearchMore"}} 2432 {{>SearchMoreProducts}} 2433 {{/ifCond}} 2434 {{/Product}} 2435 {{else}} 2436 <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable dw-mod"> 2437 <small><em>@Translate("Your search gave 0 results")</em></small> 2438 </li> 2439 {{/each}} 2440 </script> 2441 2442 <script id="SearchMoreProducts" type="text/x-template"> 2443 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 2444 <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 2445 @Translate("View all") 2446 </a> 2447 </li> 2448 </script> 2449 2450 <script id="SearchMorePages" type="text/x-template"> 2451 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 2452 <a href="/Default.aspx?ID=@contentSearchPageLink&Search={{searchParameter}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 2453 @Translate("View all") 2454 </a> 2455 </li> 2456 </script> 2457 2458 <script id="SearchPagesTemplate" type="text/x-template"> 2459 {{#each .}} 2460 {{#ifCond template "!==" "SearchMore"}} 2461 <li class="dropdown__item dropdown__item--seperator dw-mod"> 2462 <div> 2463 <a href="/Default.aspx?ID={{id}}" class="js-typeahead-link u-pull--left u-color-inherit"> 2464 <div class="u-margin-right u-pull--left"><i class="fa {{icon}} u-w20px u-ta-center"></i></div> 2465 <div class="u-pull--left"> 2466 <div class="u-bold u-truncate-text u-max-w220px js-typeahead-name">{{name}}</div> 2467 </div> 2468 </a> 2469 </div> 2470 </li> 2471 {{/ifCond}} 2472 {{#ifCond template "===" "SearchMore"}} 2473 {{>SearchMorePages}} 2474 {{/ifCond}} 2475 {{else}} 2476 <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable dw-mod"> 2477 <small><em>@Translate("Your search gave 0 results")</em></small> 2478 </li> 2479 {{/each}} 2480 </script> 2481 2482 <script id="SearchPagesTemplateWrap" type="text/x-template"> 2483 <div class="dropdown__column-header">@Translate("Pages")</div> 2484 <ul class="dropdown__list u-full-width dw-mod"> 2485 {{>SearchPagesTemplate}} 2486 </ul> 2487 </script> 2488 2489 <script id="SearchProductsTemplateWrap" type="text/x-template"> 2490 <div class="dropdown__column-header">@Translate("Products")</div> 2491 <ul class="dropdown__list u-full-width dw-mod"> 2492 {{>SearchProductsTemplate}} 2493 </ul> 2494 </script> 2495 } 2496 2497 2498 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2499 2500 @using System 2501 @using System.Web 2502 @using System.Collections.Generic 2503 @using Dynamicweb.Rapido.Blocks.Extensibility 2504 @using Dynamicweb.Rapido.Blocks 2505 2506 @{ 2507 BlocksPage bottomSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 2508 2509 Block primaryBottomSnippets = new Block() 2510 { 2511 Id = "MasterJavascriptInitializers", 2512 SortId = 1, 2513 Template = RenderPrimaryBottomSnippets() 2514 }; 2515 bottomSnippetsBlocksPage.Add(MasterBlockId.MasterReferences, primaryBottomSnippets); 2516 } 2517 2518 @helper RenderPrimaryBottomSnippets() { 2519 bool isWireframeMode = Model.Area.Item.GetItem("Settings").GetBoolean("WireframeMode") != null ? Model.Area.Item.GetItem("Settings").GetBoolean("WireframeMode") : false; 2520 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 2521 2522 <script> 2523 Wireframe.Init(@Converter.ToString(isWireframeMode).ToLower()); 2524 </script> 2525 2526 2527 if (useGoogleTagManager) 2528 { 2529 <script> 2530 document.addEventListener('addToCart', function(event) { 2531 var googleImpression = event.detail.cartItem.productInfo.googleImpression; 2532 dataLayer.push({ 2533 'event': 'addToCart', 2534 'ecommerce': { 2535 'currencyCode': '@Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency()', 2536 'add': { 2537 'products': [{ 2538 'name': googleImpression.name, 2539 'id': googleImpression.id, 2540 'price': googleImpression.price, 2541 'brand': googleImpression.brand, 2542 'category': googleImpression.category, 2543 'variant': googleImpression.variant, 2544 'quantity': event.detail.cartItem.quantity 2545 }] 2546 } 2547 } 2548 }); 2549 }); 2550 </script> 2551 } 2552 2553 <!--@Javascripts--> 2554 } 2555 2556 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2557 2558 @using System 2559 @using System.Web 2560 @using System.Collections.Generic 2561 @using Dynamicweb.Rapido.Blocks 2562 2563 @{ 2564 BlocksPage masterBlocksBlocksPage = BlocksPage.GetBlockPage("Master"); 2565 2566 } 2567 2568 <!DOCTYPE html> 2569 2570 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 2571 <head> 2572 <meta charset="utf-8" /> 2573 <title>@Model.Title</title> 2574 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"> 2575 2576 <meta name="google-site-verification" content="mI1bhxKYffkzRSD96iUeUuFmHBFBFIFliTMTOsME3WM" /> 2577 2578 @if ( 2579 System.Web.HttpContext.Current.Request.Url.Host.Contains(".by.gotcha.dk") 2580 || 2581 System.Web.HttpContext.Current.Request.Url.Host.Contains(".dynamicweb-cms.com") 2582 ) { 2583 <meta name="robots" content="noindex,nofollow" /> 2584 } 2585 2586 <!-- Favicon --> 2587 <link href="@favicon" rel="icon" type="image/png"> 2588 2589 <!-- Font awesome --> 2590 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/fonts/FontAwesomePro/css/fontawesome-all.min.css" type="text/css"> 2591 2592 <!-- Flag icon --> 2593 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/3.1.0/css/flag-icon.min.css" type="text/css"> 2594 2595 <!-- Base (Default, wireframe) styles --> 2596 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css" type="text/css"> 2597 2598 <!-- Rapido Css from Website Settings --> 2599 <link id="rapidoCss" rel="stylesheet" href="@autoCssLink" type="text/css"> 2600 2601 <!-- Ignite Css (Custom site specific styles) --> 2602 <link id="igniteCss" type="text/css" href="/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css" rel="stylesheet"> 2603 2604 <!-- Google fonts --> 2605 @{ 2606 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))); 2607 } 2608 <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet"> 2609 @{ 2610 string GoogleTagManagerID = Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID") != null ? Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID") : ""; 2611 2612 if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 2613 { 2614 <script> 2615 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 2616 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 2617 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 2618 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 2619 })(window,document,'script','dataLayer','@GoogleTagManagerID'); 2620 </script> 2621 } 2622 } 2623 </head> 2624 2625 <body class='@PageId @TemplateName'> 2626 2627 @RenderBlockList(masterPage.BlocksRoot.BlocksList) 2628 2629 @helper RenderMasterHeader() { 2630 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterHeader").OrderBy(item => item.SortId).ToList(); 2631 bool isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 2632 string stickyTop = isNavigationStickyMenu ? "top-container--sticky" : ""; 2633 2634 <header class="top-container @stickyTop dw-mod" id="Top"> 2635 @RenderBlockList(subBlocks) 2636 </header> 2637 } 2638 2639 @helper RenderMain() { 2640 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMain").OrderBy(item => item.SortId).ToList(); 2641 2642 <main class="site dw-mod"> 2643 @RenderBlockList(subBlocks) 2644 </main> 2645 } 2646 2647 @helper RenderPageContent() { 2648 bool isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 2649 string pagePos = isNavigationStickyMenu ? "js-page-pos" : ""; 2650 2651 <div id="Page" class="page @pagePos"> 2652 <section class="center-container content-container dw-mod" id="content"> 2653 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2654 2655 2656 @{ 2657 string columnClass = "12"; 2658 bool isProductPage = HttpContext.Current.Request.QueryString.Get("ProductID") != null ? true : false; 2659 string backgroundColorClass = Model.PropertyItem.GetString("BackgroundColor") != null && !isProductPage ? "u-" + Model.PropertyItem.GetList("BackgroundColor").SelectedValue + "--bg" : ""; 2660 } 2661 2662 @if (Model.PropertyItem.GetList("ShowBreadcrumb").SelectedValue == "True") 2663 { 2664 <div class="grid__col-12 grid__col--bleed-y"> 2665 @RenderNavigation(new 2666 { 2667 id = "breadcrumb", 2668 template = "Breadcrumb.xslt" 2669 }) 2670 </div> 2671 } 2672 2673 <div class="grid"> 2674 @if (Model.PropertyItem.GetList("LeftMenu") != null && Model.PropertyItem.GetList("LeftMenu").SelectedValue == "True" && (Pageview.Page.NavigationSettings == null || !Pageview.Page.NavigationSettings.UseEcomGroups)) 2675 { 2676 var navigationMarkup = RenderNavigation(new 2677 { 2678 id = "leftnav", 2679 cssclass = "dwnavigation", 2680 startLevel = 2, 2681 expandmode = "all", 2682 endlevel = 5, 2683 template = "LeftNavigation.xslt" 2684 }); 2685 2686 if (!string.IsNullOrEmpty(navigationMarkup)) 2687 { 2688 <nav class="grid__col-md-3"> 2689 <div class="grid__cell"> 2690 @navigationMarkup 2691 </div> 2692 </nav> 2693 columnClass = "9"; 2694 } 2695 } 2696 <div class="grid__col-md-@columnClass grid__col--bleed"> 2697 <div class="grid"> 2698 @Model.Placeholder("dwcontent", "content", "default:true;sort:1") 2699 </div> 2700 </div> 2701 </div> 2702 2703 2704 @* Very small hack to make it cleanly, and easily possible to change the background color on a single page *@ 2705 @if (backgroundColorClass != "") 2706 { 2707 <script> 2708 document.getElementById("Page").classList.add("@backgroundColorClass"); 2709 </script> 2710 } 2711 2712 </section> 2713 </div> 2714 } 2715 2716 @helper RenderPreFooter() { 2717 <div class="prefooter"> 2718 <div class="center-container top-container__center-container dw-mod"> 2719 <div class="grid grid--external-bleed-x grid--justify-space-between grid--align-center"> 2720 <div class="collection dw-mod"> 2721 @foreach (var brand in Model.Area.Item.GetItem("Layout").GetItems("FooterBrands")) { 2722 string brandName = brand.GetString("Name"); 2723 string brandImage = brand.GetString("Image"); 2724 string brandLink = brand.GetString("Link"); 2725 2726 <div class="footer__brand-type"> 2727 <a href="@brandLink"> 2728 <img src="@brandImage" alt="@brandName" title="@brandName" /> 2729 </a> 2730 </div> 2731 } 2732 </div> 2733 2734 @if (Model.Area.Item.GetItem("Layout").GetItems("FooterPayments") != null && Model.Area.Item.GetItem("Layout").GetItems("FooterPayments").Count > 0) { 2735 <div class="collection u-ta-right dw-mod"> 2736 @foreach (var payment in Model.Area.Item.GetItem("Layout").GetItems("FooterPayments")) { 2737 var paymentItem = payment.GetValue("CardTypeOrVerifiedPayment") as Dynamicweb.Frontend.ListViewModel; 2738 string paymentImage = null; 2739 string paymentTitle = paymentItem.SelectedName; 2740 ListOptionViewModel selected = paymentItem.SelectedOptions.FirstOrDefault(); 2741 if (selected != null) 2742 { 2743 paymentImage = selected.Icon; 2744 } 2745 2746 <div class="footer__card-type"> 2747 <img src="/Admin/Public/GetImage.ashx?width=60&Compression=75&image=@paymentImage" alt="@paymentTitle" title="@paymentTitle" /> 2748 </div> 2749 } 2750 </div> 2751 } 2752 </div> 2753 </div> 2754 </div> 2755 } 2756 2757 </body> 2758 </html> 2759 2760