Error executing template "Designs/HD2412/_parsed/Page.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at S_DW_HD2412.CustomCode.Seo.Canonical.Url(PageView pageView, String domain, String rawUrl) in D:\a\1\s\S_DW_HD2412\CustomCode\Seo\Canonical.cs:line 22
   at CompiledRazorTemplates.Dynamic.RazorEngine_5a54b4c6b0af4bf0aab2febe5558241c.Execute() in D:\dynamicweb.net\Solutions\S_DW_HD2412\Files\Templates\Designs\HD2412\_parsed\Page.parsed.cshtml:line 70
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 3 @using Dynamicweb.Frontend 4 @using Dynamicweb.Frontend.Devices 5 @using Dynamicweb.Extensibility 6 @using Dynamicweb.Content 7 @using Dynamicweb.Security 8 @using Dynamicweb.Core 9 @using Dynamicweb.Environment.Web 10 @using System 11 @using System.Web 12 @using System.IO 13 @using Dynamicweb.Rapido.Blocks 14 @using System.Net 15 @using Co3.Espresso.Website.Services 16 @using Dynamicweb.Admin.dk.dynamicweb.templates 17 @using Dynamicweb.Analytics 18 @using Dynamicweb.Ecommerce.International 19 @using NuGet.Protocol.Core.Types 20 @using Page = System.Web.UI.Page 21 @using UserAgent = Dynamicweb.Analytics.UserAgent 22 @using S_DW_HD2412.CustomCode.Seo; 23 24 @functions { 25 BlocksPage masterPage = BlocksPage.GetBlockPage("Master"); 26 27 string getFontFamily(params string[] items) 28 { 29 var itemParent = Pageview.AreaSettings; 30 foreach (var item in items) 31 { 32 itemParent = itemParent.GetItem(item); 33 if (itemParent == null) 34 { 35 return null; 36 } 37 } 38 var googleFont = itemParent.GetGoogleFont("FontFamily"); 39 if (googleFont == null) 40 { 41 return null; 42 } 43 return googleFont.Family.Replace(" ", "+"); 44 } 45 } 46 47 @{ 48 //Font settings 49 var fonts = new string[] { 50 getFontFamily("Layout", "HeaderFont"), 51 getFontFamily("Layout", "SubheaderFont"), 52 getFontFamily("Layout", "TertiaryHeaderFont"), 53 getFontFamily("Layout", "Header", "ToolsFont"), 54 getFontFamily("Layout", "Header", "NavigationFont"), 55 getFontFamily("Layout", "MobileNavigation", "Font"), 56 getFontFamily("ProductList", "Facets", "HeaderFont"), 57 getFontFamily("ProductPage", "PriceFontDesign"), 58 getFontFamily("Ecommerce", "SaleSticker", "Font"), 59 getFontFamily("Ecommerce", "NewSticker", "Font"), 60 getFontFamily("Ecommerce", "CustomSticker", "Font") 61 }; 62 63 string autoCssLink = "/Files/Templates/Designs/HD2412/css/rapido/rapido_" + Model.Area.ID.ToString() + ".min.css?ticks=" + Model.Area.UpdatedDate.Ticks; 64 string favicon = Model.Area.Item.GetItem("Layout").GetFile("LogoFavicon") != null ? Model.Area.Item.GetItem("Layout").GetFile("LogoFavicon").Path : "/Files/Images/favicon.png"; 65 bool useFontAwesomePro = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetBoolean("UseFontAwesomePro"); 66 string fontAwesomeCssLink = "/Files/Templates/Designs/HD2412/css/fonts/FontAwesomeFree/css/all.min.css"; 67 string siteURL = Pageview.SearchFriendlyUrl.ToString(); 68 string domainUrl = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 69 PageView pageview = PageView.Current(); 70 string canonical = Canonical.Url(Pageview, domainUrl, Dynamicweb.Context.Current.Request.Url.ToString()); 71 string metaDesc = Pageview.Page.Description; 72 int queryIndex = canonical.IndexOf("?"); 73 if (queryIndex > 0) 74 { 75 canonical = canonical.Substring(0, queryIndex); 76 } 77 // Open Graph fields 78 string ogType = ""; 79 string ogTitle = ""; 80 string ogDesc = ""; 81 string ogImage = ""; 82 if (Model != null && Model.PropertyItem != null) 83 { 84 ogType = !string.IsNullOrEmpty(Model.PropertyItem.GetString("Type")) ? Model.PropertyItem.GetString("Type") : ""; 85 ogTitle = !string.IsNullOrEmpty(Model.PropertyItem.GetString("Title")) ? Model.PropertyItem.GetString("Title") : Model.Title; 86 ogDesc = !string.IsNullOrEmpty(Model.PropertyItem.GetString("Description")) ? Model.PropertyItem.GetString("Description") : ""; 87 string ogImageFile = Model.PropertyItem.GetFile("Image")?.PathUrlEncoded ?? ""; 88 ogImage = "/Admin/Public/GetImage.ashx?width=1200&height=630&image=" + ogImageFile; 89 90 if (string.IsNullOrEmpty(ogImage)) 91 { 92 ogImageFile = Model.PropertyItem.GetFile("Spot_Image")?.PathUrlEncoded ?? ""; 93 ogImage = "/Admin/Public/GetImage.ashx?width=1200&height=630&image=" + ogImageFile; 94 } 95 } 96 97 // Product meta description 98 string productMetaDescription = string.Empty; 99 string ProductID = HttpContext.Current.Request.QueryString.Get("ProductID"); 100 if (!string.IsNullOrWhiteSpace(ProductID)) 101 { 102 var currentProduct = Dynamicweb.Ecommerce.Products.Product.GetProductById(ProductID); 103 productMetaDescription = currentProduct?.Meta?.Description; 104 } 105 106 // Group meta description 107 string groupMetaDescription = string.Empty; 108 string groupID = HttpContext.Current.Request.QueryString.Get("GroupID"); 109 if (!string.IsNullOrWhiteSpace(groupID)) 110 { 111 var currentGroup = Dynamicweb.Ecommerce.Products.Group.GetGroupById(groupID); 112 groupMetaDescription = currentGroup?.Meta?.Description; 113 } 114 115 if (!string.IsNullOrWhiteSpace(ProductID)) 116 { 117 ogDesc = productMetaDescription; 118 } 119 else if (!string.IsNullOrWhiteSpace(groupID)) 120 { 121 ogDesc = groupMetaDescription; 122 } 123 else if (string.IsNullOrEmpty(ogDesc)) 124 { 125 ogDesc = Pageview.Page.Description; 126 } 127 128 string businessName = Model.Area.Item.GetItem("Settings").GetString("BusinessName"); 129 130 if (useFontAwesomePro) 131 { 132 fontAwesomeCssLink = "/Files/Templates/Designs/HD2412/css/fonts/FontAwesomePro/css/all.min.css"; 133 } 134 135 //Custom Global Scripts 136 string headerScripts = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("HeaderScripts") != null ? Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("HeaderScripts") : ""; 137 string bodyScripts = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("BodyScripts") != null ? Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("BodyScripts") : ""; 138 139 //Custom Page Scripts 140 var pageHeaderScripts = !string.IsNullOrEmpty(Model.PropertyItem.GetString("HeaderScripts")) ? Model.PropertyItem.GetString("HeaderScripts") : ""; 141 var pageBodyScripts = !string.IsNullOrEmpty(Model.PropertyItem.GetString("BodyScripts")) ? Model.PropertyItem.GetString("BodyScripts") : ""; 142 } 143 144 @{ 145 Block master = new Block() 146 { 147 Id = "Master", 148 BlocksList = new List<Block> { 149 new Block { 150 Id = "MasterTopSnippets", 151 SortId = 10 152 }, 153 new Block { 154 Id = "MasterMain", 155 SortId = 20, 156 Template = RenderMain(), 157 SkipRenderBlocksList = true, 158 159 BlocksList = new List<Block> { 160 new Block { 161 Id = "MasterHeader", 162 SortId = 10, 163 Template = RenderMasterHeader(), 164 SkipRenderBlocksList = true 165 }, 166 new Block { 167 Id = "MasterPageContent", 168 SortId = 20, 169 Template = RenderPageContent() 170 } 171 } 172 }, 173 new Block { 174 Id = "MasterFooter", 175 SortId = 30 176 }, 177 new Block { 178 Id = "MasterReferences", 179 SortId = 40 180 }, 181 new Block { 182 Id = "MasterBottomSnippets", 183 SortId = 50 184 } 185 } 186 }; 187 188 masterPage.Add(master); 189 } 190 191 @* Include the required Grid builder (Contains the methods @RenderBlockList and @RenderBlock) *@ 192 193 194 @using System.Text.RegularExpressions 195 @using System.Reflection 196 @using System.Web.UI.HtmlControls 197 @using Dynamicweb.Rapido.Blocks.Components 198 @using Dynamicweb.Rapido.Blocks.Components.Articles 199 @using Dynamicweb.Rapido.Blocks.Components.Documentation 200 @using Dynamicweb.Rapido.Blocks 201 @using System 202 @using System.Web 203 @using System.Collections.Generic 204 @using Dynamicweb.Frontend 205 @*--- START: Base block renderers ---*@ 206 207 @helper RenderBlockList(List<Block> blocks) 208 { 209 blocks = blocks.OrderBy(item => item.SortId).ToList(); 210 211 foreach (Block item in blocks) 212 { 213 <!-- START: @item.Id --> 214 215 if (item.Design == null) 216 { 217 @RenderBlock(item) 218 } 219 else if (item.Design.RenderType == RenderType.None) 220 { 221 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 222 223 <div class="@cssClass dw-mod"> 224 @RenderBlock(item) 225 </div> 226 } 227 else if (item.Design.RenderType != RenderType.Hide) 228 { 229 string cssClass = item.Design.CssClass != null ? item.Design.CssClass : ""; 230 231 if (!item.SkipRenderBlocksList) 232 { 233 234 235 if (item.Design.RenderType == RenderType.Row) 236 { 237 238 //Custom if sentence to check if grid/container has the id "ArticleContainer" to change the Dynamic Article/Nyhedsside layout 239 240 if (item.Id == "ArticleContainer") 241 { 242 243 <div class="grid grid--align-content-start grid-custom-layout @cssClass dw-mod" id="Block__@item.Id"> 244 @RenderBlock(item) 245 </div> 246 } 247 248 else if (item.Id == "CaseContainer") 249 { 250 <div class="grid grid--align-content-start grid-custom-layout-third @cssClass dw-mod" id="Block__@item.Id"> 251 @RenderBlock(item) 252 </div> 253 } 254 255 else if (item.Id == "OrderContainerRow") 256 { 257 <div class="grid grid--align-content-start grid-custom-layout-third @cssClass mobile-order-container-row dw-mod" id="Block__@item.Id"> 258 @RenderBlock(item) 259 </div> 260 } 261 262 263 else 264 { 265 <div class="grid grid--align-content-start grid-custom-layout-third @cssClass dw-mod" id="Block__@item.Id"> 266 @RenderBlock(item) 267 </div> 268 269 } 270 271 272 } 273 274 if (item.Design.RenderType == RenderType.Column) 275 { 276 string hidePadding = item.Design.HidePadding ? "u-no-padding" : ""; 277 string size = item.Design.Size ?? "12"; 278 size = Regex.IsMatch(size, @"\d") ? "md-" + item.Design.Size : item.Design.Size; 279 280 //Custom if sentence to check if grid/container has the id "MasterFooter" to change the footer layout 281 if (item.Id.Contains("MasterFooter")) 282 { 283 <div class="@(item.Id.Contains("MasterFooterColumnOne") || item.Id.Contains("MasterFooterColumnTwo") ? "grid__col-lg-3 grid__col-6 mobile-flex-order" : "grid__col-12") @(item.Id.Contains("MasterFooterColumnThree") ? "grid__col-6 grid--align-end mobile-flex-order" : "grid__col-12") grid--align-content-space-between grid--justify-start @hidePadding @cssClass dw-mod" id="Block__@item.Id"> 284 @RenderBlock(item) 285 </div> 286 } 287 288 //Custom if sentence to check if grid/container has the id "ArticleParagraphImage" to change the Dynamic Article image to be full width on desktop 289 else if (item.Id.Contains("ArticleParagraph")) 290 { 291 292 <div class="grid__col-12 @hidePadding @cssClass dw-mod" id="Block__@item.Id "> 293 @RenderBlock(item) 294 </div> 295 } 296 297 298 else 299 { 300 <section class="grid__col-lg-@item.Design.Size grid__col-md-@item.Design.Size grid__col-sm-12 grid__col-xs-12 @hidePadding @cssClass dw-mod" id="Block__@item.Id"> 301 @RenderBlock(item) 302 </section> 303 } 304 305 } 306 307 308 if (item.Design.RenderType == RenderType.Table) 309 { 310 <table class="table @cssClass dw-mod" id="Block__@item.Id"> 311 @RenderBlock(item) 312 </table> 313 } 314 315 if (item.Design.RenderType == RenderType.TableRow) 316 { 317 <tr class="@cssClass dw-mod" id="Block__@item.Id"> 318 @RenderBlock(item) 319 </tr> 320 } 321 322 if (item.Design.RenderType == RenderType.TableColumn) 323 { 324 <td class="@cssClass dw-mod" id="Block__@item.Id"> 325 @RenderBlock(item) 326 </td> 327 } 328 329 if (item.Design.RenderType == RenderType.CardHeader) 330 { 331 <div class="card-header @cssClass dw-mod"> 332 @RenderBlock(item) 333 </div> 334 } 335 336 if (item.Design.RenderType == RenderType.CardBody) 337 { 338 <div class="card @cssClass dw-mod"> 339 @RenderBlock(item) 340 </div> 341 } 342 343 if (item.Design.RenderType == RenderType.CardFooter) 344 { 345 <div class="card-footer @cssClass dw-mod"> 346 @RenderBlock(item) 347 </div> 348 349 } 350 351 352 } 353 else 354 { 355 @RenderBlock(item) 356 } 357 } 358 359 <!-- END: @item.Id --> 360 } 361 } 362 363 @helper RenderBlock(Block item) 364 { 365 if (item.Template != null) 366 { 367 @BlocksPage.RenderTemplate(item.Template) 368 } 369 370 if (item.Component != null) 371 { 372 string methodName = item.Component.HelperName; 373 dynamic[] methodParameters = new dynamic[1]; 374 methodParameters[0] = item.Component; 375 Type methodType = this.GetType(); 376 MethodInfo generalMethod = methodType.GetMethod(methodName); 377 378 if (generalMethod != null) 379 { 380 @generalMethod.Invoke(this, methodParameters).ToString(); 381 } 382 else 383 { 384 throw new Exception(item.Component.GetType().Name + " method '" + methodName + "' could not be invoked"); 385 } 386 } 387 388 if (item.BlocksList.Count > 0 && !item.SkipRenderBlocksList) 389 { 390 @RenderBlockList(item.BlocksList) 391 } 392 } 393 394 @*--- END: Base block renderers ---*@ 395 396 397 @* Include the components *@ 398 @using Dynamicweb.Rapido.Blocks.Components 399 @using Dynamicweb.Rapido.Blocks.Components.General 400 @using Dynamicweb.Rapido.Blocks 401 402 403 @* Components *@ 404 @using System.Reflection 405 @using Dynamicweb.Rapido.Blocks.Components.General 406 407 408 @* Component *@ 409 410 @helper RenderIcon(Icon settings) { 411 if (settings != null) 412 { 413 dynamic[] methodParameters = new dynamic[1]; 414 methodParameters[0] = settings; 415 MethodInfo customMethod = this.GetType().GetMethod("RenderIconCustom"); 416 417 if (customMethod != null) 418 { 419 @customMethod.Invoke(this, methodParameters).ToString(); 420 } else { 421 string color = settings.Color != null ? "style=\"color: " + settings.Color + "\"" : ""; 422 423 if (settings.Name != null) 424 { 425 if (String.IsNullOrEmpty(settings.Label)) { 426 <i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i> 427 } else { 428 if (settings.LabelPosition == IconLabelPosition.Before) { 429 <span>@settings.Label <i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i></span> 430 } else { 431 <span><i class="@settings.Prefix @settings.Name @settings.CssClass" @color></i> @settings.Label</span> 432 } 433 } 434 } 435 } 436 } 437 } 438 @using System.Reflection 439 @using Dynamicweb.Rapido.Blocks.Components.General 440 @using Dynamicweb.Rapido.Blocks.Components 441 @using S_DW_HD2412.CustomCode 442 443 @* Component *@ 444 445 @helper RenderButtonExtended(ButtonExtended settings) 446 { 447 dynamic[] methodParameters = new dynamic[1]; 448 methodParameters[0] = settings; 449 MethodInfo customMethod = this.GetType().GetMethod("RenderButtonCustom"); 450 451 if (customMethod != null) 452 { 453 @customMethod.Invoke(this, methodParameters).ToString(); 454 } 455 else 456 { 457 string target; 458 string disabled = settings.Disabled ? "disabled" : ""; 459 string buttonType = settings.ButtonType == ButtonType.Submit ? "submit" : "button"; 460 buttonType = settings.ButtonType == ButtonType.Reset ? "reset" : buttonType; 461 string buttonLayout = settings.ButtonLayout.ToString().ToLower(); 462 string nofollow = settings.ButtonNofollow != false ? "rel='nofollow'" : null; 463 464 switch (settings.Target) 465 { 466 case LinkTargetType.Blank: 467 target = "_blank"; 468 break; 469 case LinkTargetType.Parent: 470 target = "_parent"; 471 break; 472 case LinkTargetType.Self: 473 target = "_self"; 474 break; 475 case LinkTargetType.Top: 476 target = "_top"; 477 break; 478 default: 479 target = "_self"; 480 break; 481 } 482 483 string onClickAction = settings.OnClick != null ? settings.OnClick : ""; 484 string noOpener = target == "_blank" ? "rel=\"noopener\"" : ""; 485 486 if (!String.IsNullOrEmpty(settings.ConfirmText)) 487 { 488 string modalId = settings.Id; 489 @RenderConfirmDialog(settings); 490 onClickAction = "document.getElementById('" + modalId + "ModalTrigger').checked = true"; 491 } 492 493 if (settings.Icon != null) 494 { 495 if (settings.IconPosition == null) 496 { 497 settings.Icon.LabelPosition = IconLabelPosition.After; 498 } 499 else 500 { 501 settings.Icon.LabelPosition = settings.IconPosition == IconPosition.Before ? IconLabelPosition.After : IconLabelPosition.Before; 502 } 503 if (settings.Icon.Label == null) 504 { 505 settings.Icon.Label = settings.Title; 506 } 507 } 508 string content = settings.Icon == null ? settings.Title : Convert.ToString(RenderIcon(settings.Icon)); 509 510 if (!String.IsNullOrEmpty(settings.Link) && String.IsNullOrEmpty(settings.ConfirmText)) 511 { 512 <a href="@settings.Link" target="@target" class="btn btn--@buttonLayout @settings.CssClass @disabled dw-mod" @nofollow onclick="@onClickAction" @ComponentMethods.AddAttributes(settings.ExtraAttributes) @disabled>@content</a> } 513 else 514 { 515 <button type="@buttonType" class="btn btn--@buttonLayout @settings.CssClass @disabled dw-mod" onclick="@onClickAction" @ComponentMethods.AddAttributes(settings.ExtraAttributes) @disabled>@content</button> 516 } 517 } 518 } 519 520 @helper RenderButton(Button settings) 521 { 522 dynamic[] methodParameters = new dynamic[1]; 523 methodParameters[0] = settings; 524 MethodInfo customMethod = this.GetType().GetMethod("RenderButtonCustom"); 525 526 if (customMethod != null) 527 { 528 @customMethod.Invoke(this, methodParameters).ToString(); 529 } 530 else 531 { 532 string target; 533 string disabled = settings.Disabled ? "disabled" : ""; 534 string buttonType = settings.ButtonType == ButtonType.Submit ? "submit" : "button"; 535 buttonType = settings.ButtonType == ButtonType.Reset ? "reset" : buttonType; 536 string buttonLayout = settings.ButtonLayout.ToString().ToLower(); 537 538 switch (settings.Target) 539 { 540 case LinkTargetType.Blank: 541 target = "_blank"; 542 break; 543 case LinkTargetType.Parent: 544 target = "_parent"; 545 break; 546 case LinkTargetType.Self: 547 target = "_self"; 548 break; 549 case LinkTargetType.Top: 550 target = "_top"; 551 break; 552 default: 553 target = "_self"; 554 break; 555 } 556 557 string onClickAction = settings.OnClick != null ? settings.OnClick : ""; 558 string noOpener = target == "_blank" ? "rel=\"noopener\"" : ""; 559 560 if (!String.IsNullOrEmpty(settings.ConfirmText)) 561 { 562 string modalId = settings.Id; 563 @RenderConfirmDialog(settings); 564 onClickAction = "document.getElementById('" + modalId + "ModalTrigger').checked = true"; 565 } 566 567 if (settings.Icon != null) 568 { 569 if (settings.IconPosition == null) 570 { 571 settings.Icon.LabelPosition = IconLabelPosition.After; 572 } 573 else 574 { 575 settings.Icon.LabelPosition = settings.IconPosition == IconPosition.Before ? IconLabelPosition.After : IconLabelPosition.Before; 576 } 577 if (settings.Icon.Label == null) 578 { 579 settings.Icon.Label = settings.Title; 580 } 581 } 582 string content = settings.Icon == null ? settings.Title : Convert.ToString(RenderIcon(settings.Icon)); 583 584 if (!String.IsNullOrEmpty(settings.Link) && String.IsNullOrEmpty(settings.ConfirmText)) 585 { 586 <a href="@settings.Link" target="@target" @noOpener class="btn btn--@buttonLayout @settings.CssClass @disabled dw-mod" onclick="@onClickAction" @ComponentMethods.AddAttributes(settings.ExtraAttributes) @disabled>@content</a> } 587 else 588 { 589 <button type="@buttonType" class="btn btn--@buttonLayout @settings.CssClass @disabled dw-mod" onclick="@onClickAction" @ComponentMethods.AddAttributes(settings.ExtraAttributes) @disabled>@content</button> 590 } 591 } 592 } 593 594 595 @helper RenderConfirmDialog(Button settings) 596 { 597 dynamic[] methodParameters = new dynamic[1]; 598 methodParameters[0] = settings; 599 MethodInfo customMethod = this.GetType().GetMethod("RenderConfirmDialogCustom"); 600 601 if (customMethod != null) 602 { 603 @customMethod.Invoke(this, methodParameters).ToString(); 604 } 605 else 606 { 607 string modalTriggerId = settings.Id + "ModalTrigger"; 608 609 <!-- Trigger for the confirm modal --> 610 <input type="checkbox" id="@modalTriggerId" class="modal-trigger" /> 611 612 <!-- Login modal --> 613 <div class="modal-container"> 614 <label for="@modalTriggerId" class="modal-overlay"></label> 615 <div class="modal modal--xs"> 616 <div class="modal__header"> 617 <h2>@settings.ConfirmText</h2> 618 </div> 619 <div class="modal__body"> 620 @RenderButton(new Button { Title = Translate("OK"), ButtonLayout = ButtonLayout.Primary, OnClick = settings.OnClick, CssClass = "u-full-width", Link = settings.Link }) 621 </div> 622 </div> 623 </div> 624 } 625 } 626 @using System.Reflection 627 @using Dynamicweb.Rapido.Blocks.Components 628 @using Dynamicweb.Rapido.Blocks.Components.General 629 @using Dynamicweb.Rapido.Blocks 630 631 632 @* Component *@ 633 634 @helper RenderRating(Rating settings) 635 { 636 dynamic[] methodParameters = new dynamic[1]; 637 methodParameters[0] = settings; 638 MethodInfo customMethod = this.GetType().GetMethod("RenderRatingCustom"); 639 640 if (customMethod != null) 641 { 642 @customMethod.Invoke(this, methodParameters).ToString(); 643 } else { 644 if (settings.Score > 0) 645 { 646 int rating = settings.Score; 647 string iconType = "fa-star"; 648 649 switch (settings.Type.ToString()) { 650 case "Stars": 651 iconType = "fa-star"; 652 break; 653 case "Hearts": 654 iconType = "fa-heart"; 655 break; 656 case "Lemons": 657 iconType = "fa-lemon"; 658 break; 659 case "Bombs": 660 iconType = "fa-bomb"; 661 break; 662 } 663 664 <div class="u-ta-right"> 665 @for (int i = 0; i < settings.OutOf; i++) 666 { 667 <i class="@(rating > i ? "fas" : "far") @iconType"></i> 668 } 669 </div> 670 } 671 } 672 } 673 @using System.Reflection 674 @using Dynamicweb.Rapido.Blocks.Components.General 675 @using Dynamicweb.Rapido.Blocks.Components 676 677 678 @* Component *@ 679 680 @helper RenderFieldListOption(FieldListOption settings) { 681 dynamic[] methodParameters = new dynamic[1]; 682 methodParameters[0] = settings; 683 MethodInfo customMethod = this.GetType().GetMethod("RenderFieldListOptionCustom"); 684 685 if (customMethod != null) 686 { 687 @customMethod.Invoke(this, methodParameters).ToString(); 688 } else { 689 string disabled = settings.Disabled ? "disabled" : ""; 690 string selected = settings.Checked ? "checked" : ""; 691 692 if (settings.Type.ToString() == "RadioButton") 693 { 694 <input class="form__control @disabled dw-mod" onchange="@settings.OnChange" onclick="@settings.OnClick" type="radio" name="@settings.Name" id="@settings.Id" value="@settings.Value" @selected @disabled @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 695 <label for="@settings.Id" class="u-inline @disabled dw-mod">@settings.Label</label> 696 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 697 } 698 699 if (settings.Type.ToString() == "Checkbox") 700 { 701 @RenderCheckboxField(settings) 702 } 703 704 if (settings.Type.ToString() == "SelectOption") 705 { 706 <option value="@settings.Value" id="@settings.Id" onclick="@settings.OnClick" class="@disabled" @disabled @selected @ComponentMethods.AddAttributes(settings.ExtraAttributes) >@settings.Name</option> 707 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 708 } 709 } 710 } 711 712 @using System.Reflection 713 @using Dynamicweb.Rapido.Blocks.Components.General 714 @using Dynamicweb.Rapido.Blocks.Components 715 716 717 @* Component *@ 718 719 @helper RenderNavigation(Navigation settings) { 720 dynamic[] methodParameters = new dynamic[1]; 721 methodParameters[0] = settings; 722 MethodInfo customMethod = this.GetType().GetMethod("RenderNavigationCustom"); 723 724 if (customMethod != null) 725 { 726 @customMethod.Invoke(this, methodParameters).ToString(); 727 } else { 728 @RenderNavigation(new 729 { 730 id = settings.Id, 731 cssclass = settings.CssClass, 732 startLevel = settings.StartLevel, 733 endlevel = settings.EndLevel, 734 expandmode = settings.Expandmode, 735 template = settings.Template 736 }) 737 } 738 } 739 @using System.Reflection 740 @using Dynamicweb.Rapido.Blocks.Components.General 741 @using Dynamicweb.Rapido.Blocks.Components 742 743 744 @* Component *@ 745 746 @helper RenderBreadcrumbNavigation(BreadcrumbNavigation settings) { 747 dynamic[] methodParameters = new dynamic[1]; 748 methodParameters[0] = settings; 749 MethodInfo customMethod = this.GetType().GetMethod("RenderBreadcrumbNavigationCustom"); 750 751 if (customMethod != null) 752 { 753 @customMethod.Invoke(this, methodParameters).ToString(); 754 } else { 755 settings.Id = String.IsNullOrEmpty(settings.Id) ? "breadcrumb" : settings.Id; 756 settings.Template = String.IsNullOrEmpty(settings.Template) ? "Breadcrumb.xslt" : settings.Template; 757 settings.StartLevel = settings.StartLevel == 0 ? 1 : settings.StartLevel; 758 settings.EndLevel = settings.EndLevel == 10 ? 1 : settings.EndLevel; 759 settings.Expandmode = String.IsNullOrEmpty(settings.Expandmode) ? "all" : settings.Expandmode; 760 761 @RenderNavigation(settings) 762 } 763 } 764 @using System.Reflection 765 @using Dynamicweb.Rapido.Blocks.Components.General 766 767 768 @* Component *@ 769 770 @helper RenderHeading(Heading settings) { 771 dynamic[] methodParameters = new dynamic[1]; 772 methodParameters[0] = settings; 773 MethodInfo customMethod = this.GetType().GetMethod("RenderHeadingCustom"); 774 775 if (customMethod != null) 776 { 777 @customMethod.Invoke(this, methodParameters).ToString(); 778 } else { 779 string startTag = "<h" + settings.Level.ToString() + " class=\"" + settings.CssClass + "\">"; 780 string endTag = "</h" + settings.Level.ToString() + "\">"; 781 782 if (settings.Icon != null) 783 { 784 if (settings.IconPosition == null) { 785 settings.Icon.LabelPosition = IconLabelPosition.After; 786 } else { 787 settings.Icon.LabelPosition = settings.IconPosition == IconPosition.Before ? IconLabelPosition.After : IconLabelPosition.Before; 788 } 789 if (settings.Icon.Label == null) { 790 settings.Icon.Label = settings.Title; 791 } 792 793 @startTag@RenderIcon(settings.Icon)@endTag 794 } else { 795 @startTag@settings.Title@endTag 796 } 797 } 798 } 799 @using System.Reflection 800 @using Dynamicweb.Rapido.Blocks.Components 801 @using Dynamicweb.Rapido.Blocks.Components.General 802 @using Dynamicweb.Rapido.Blocks 803 804 805 @* Component *@ 806 807 @helper RenderImage(Image settings) 808 { 809 if (settings.Path != null) 810 { 811 dynamic[] methodParameters = new dynamic[1]; 812 methodParameters[0] = settings; 813 MethodInfo customMethod = this.GetType().GetMethod("RenderImageCustom"); 814 815 if (customMethod != null) 816 { 817 @customMethod.Invoke(this, methodParameters).ToString(); 818 } else { 819 <div> 820 @if (settings.Link != null) 821 { 822 <a href="@settings.Link"> 823 @RenderTheImage(settings); 824 </a> 825 } 826 else 827 { 828 @RenderTheImage(settings); 829 } 830 </div> 831 } 832 } 833 } 834 835 @functions { 836 string getImagePathFromSettings(ImageSettings settings) 837 { 838 string result = ""; 839 840 if (settings != null) 841 { 842 result += settings.Width != 0 ? "Width=" + settings.Width + "&" : ""; 843 result += settings.Height != 0 ? "Height=" + settings.Height + "&" : ""; 844 result += "Crop=" + settings.Crop + "&"; 845 result += "Compression=" + settings.Compression + "&"; 846 result += "DoNotUpscale=" + settings.DoNotUpscale.ToString() + "&"; 847 result += "FillCanvas=" + settings.FillCanvas.ToString() + "&"; 848 } 849 850 return result; 851 } 852 } 853 854 @helper RenderTheImage(Image settings) 855 { 856 if (settings != null) 857 { 858 dynamic[] methodParameters = new dynamic[1]; 859 methodParameters[0] = settings; 860 MethodInfo customMethod = this.GetType().GetMethod("RenderTheImageCustom"); 861 862 if (customMethod != null) 863 { 864 @customMethod.Invoke(this, methodParameters).ToString(); 865 } else { 866 string placeholderImage = "/Files/Images/placeholder.gif"; 867 string imageEngine = "/Admin/Public/GetImage.ashx?"; 868 869 string imageStyle = ""; 870 871 switch (settings.Style) 872 { 873 case ImageStyle.Ball: 874 imageStyle = "grid__cell-img--ball"; 875 break; 876 } 877 878 if (settings.Style == ImageStyle.Ball || settings.Style == ImageStyle.Circle) 879 { 880 if (settings.ImageDefault != null) 881 { 882 settings.ImageDefault.Height = settings.ImageDefault.Width; 883 } 884 if (settings.ImageMedium != null) 885 { 886 settings.ImageMedium.Height = settings.ImageMedium.Width; 887 } 888 if (settings.ImageSmall != null) 889 { 890 settings.ImageSmall.Height = settings.ImageSmall.Width; 891 } 892 } 893 894 string defaultImage = imageEngine; 895 string imageSmall = ""; 896 string imageMedium = ""; 897 898 if (settings.DisableImageEngine) { 899 defaultImage = settings.Path; 900 } else { 901 if (settings.ImageDefault != null) 902 { 903 defaultImage += getImagePathFromSettings(settings.ImageDefault); 904 905 if (settings.Path.GetType() != typeof(string)) 906 { 907 defaultImage += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 908 defaultImage += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 909 } 910 else 911 { 912 defaultImage += settings.Path != null ? "Image=" + settings.Path : ""; 913 } 914 } 915 916 if (settings.ImageSmall != null) 917 { 918 imageSmall = "data-src-small=\"" + imageEngine; 919 imageSmall += getImagePathFromSettings(settings.ImageSmall); 920 921 if (settings.Path.GetType() != typeof(string)) 922 { 923 imageSmall += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 924 imageSmall += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 925 } 926 else 927 { 928 imageSmall += settings.Path != null ? "Image=" + settings.Path : ""; 929 } 930 931 imageSmall += "\""; 932 } 933 934 if (settings.ImageMedium != null) 935 { 936 imageMedium = "data-src-medium=\"" + imageEngine; 937 imageMedium += getImagePathFromSettings(settings.ImageMedium); 938 939 if (settings.Path.GetType() != typeof(string)) 940 { 941 imageMedium += settings.Path != null ? "Image=" + settings.Path.PathUrlEncoded : ""; 942 imageMedium += settings.Path != null ? "&" + settings.Path.GetFocalPointParameters() : ""; 943 } 944 else 945 { 946 imageMedium += settings.Path != null ? "Image=" + settings.Path : ""; 947 } 948 949 imageMedium += "\""; 950 } 951 } 952 953 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 954 if (!String.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick); } 955 if (!String.IsNullOrEmpty(settings.Title)) { optionalAttributes.Add("alt", settings.Title); } 956 957 if (settings.DisableLazyLoad) { 958 <img class="grid__cell-img @imageStyle @settings.CssClass dw-mod" src="@defaultImage" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) alt="@settings.Path" /> 959 } else { 960 <img class="grid__cell-img b-lazy @imageStyle @settings.CssClass dw-mod" src="@placeholderImage" data-src="@defaultImage" @imageSmall @imageMedium @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) alt="@settings.Path" /> 961 } 962 963 if (settings.Caption != null) 964 { 965 <span class="image-caption dw-mod">@settings.Caption</span> 966 } 967 } 968 } 969 } 970 @using System.Reflection 971 @using Dynamicweb.Rapido.Blocks.Components.General 972 @using Dynamicweb.Rapido.Blocks.Components 973 974 975 @* Component *@ 976 977 @helper RenderTextField(TextField settings) { 978 dynamic[] methodParameters = new dynamic[1]; 979 methodParameters[0] = settings; 980 MethodInfo customMethod = this.GetType().GetMethod("RenderTextFieldCustom"); 981 982 if (customMethod != null) 983 { 984 @customMethod.Invoke(this, methodParameters).ToString(); 985 } else { 986 int maxLength = settings.MaxLength != 0 ? settings.MaxLength : 524288; 987 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 988 if (settings.Type == TextFieldType.Password) { optionalAttributes.Add("autocomplete", "off"); }; 989 if (!String.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick.ToString()); } 990 if (!String.IsNullOrEmpty(settings.Placeholder)) { optionalAttributes.Add("placeholder", settings.Placeholder); } 991 if (settings.Disabled) { optionalAttributes.Add("disabled", settings.Disabled.ToString()); } 992 if (settings.Required) { optionalAttributes.Add("required", settings.Required.ToString()); } 993 if (settings.MaxLength != 0) { optionalAttributes.Add("maxlength", settings.MaxLength.ToString()); } 994 995 <div class="form__field-group dw-mod"> 996 @if (!String.IsNullOrEmpty(settings.Label)) 997 { 998 <label for="@settings.Id">@settings.Label</label> 999 } 1000 1001 <input type="@settings.Type" class="u-full-width @settings.CssClass dw-mod" name="@settings.Id" id="@(settings.Id)" value="@settings.Value" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 1002 1003 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1004 </div> 1005 } 1006 } 1007 @using System.Reflection 1008 @using Dynamicweb.Rapido.Blocks.Components.General 1009 @using Dynamicweb.Rapido.Blocks.Components 1010 1011 1012 @* Component *@ 1013 1014 @helper RenderNumberField(NumberField settings) { 1015 dynamic[] methodParameters = new dynamic[1]; 1016 methodParameters[0] = settings; 1017 MethodInfo customMethod = this.GetType().GetMethod("RenderNumberFieldCustom"); 1018 1019 if (customMethod != null) 1020 { 1021 @customMethod.Invoke(this, methodParameters).ToString(); 1022 } else { 1023 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 1024 if (!String.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick.ToString()); } 1025 if (settings.Disabled) { optionalAttributes.Add("disabled", settings.Disabled.ToString()); } 1026 if (settings.Required) { optionalAttributes.Add("required", settings.Required.ToString()); } 1027 if (settings.Max != 0) { optionalAttributes.Add("max", settings.Max.ToString()); } 1028 if (settings.Min != 0) { optionalAttributes.Add("min", settings.Min.ToString()); } 1029 if (settings.Step != 0) { optionalAttributes.Add("step", settings.Step.ToString()); } 1030 1031 <div class="form__field-group dw-mod"> 1032 @if (!String.IsNullOrEmpty(settings.Label)) 1033 { 1034 <div> 1035 <label for="@settings.Id">@settings.Label</label> 1036 </div> 1037 } 1038 1039 <input type="Number" class="u-w70px @settings.CssClass dw-mod" name="@settings.Id" id="@(settings.Id)" value="@settings.Value" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 1040 1041 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1042 </div> 1043 } 1044 } 1045 @using System.Reflection 1046 @using Dynamicweb.Rapido.Blocks.Components.General 1047 @using Dynamicweb.Rapido.Blocks.Components 1048 1049 1050 @* Component *@ 1051 1052 @helper RenderTextareaField(TextareaField settings) { 1053 dynamic[] methodParameters = new dynamic[1]; 1054 methodParameters[0] = settings; 1055 MethodInfo customMethod = this.GetType().GetMethod("RenderTextareaFieldCustom"); 1056 1057 if (customMethod != null) 1058 { 1059 @customMethod.Invoke(this, methodParameters).ToString(); 1060 } else { 1061 int maxLength = settings.MaxLength != 0 ? settings.MaxLength : 524288; 1062 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 1063 if (!String.IsNullOrEmpty(settings.OnClick)) { optionalAttributes.Add("onclick", settings.OnClick.ToString()); } 1064 if (!String.IsNullOrEmpty(settings.Placeholder)) { optionalAttributes.Add("placeholder", settings.Placeholder); } 1065 if (settings.Disabled) { optionalAttributes.Add("disabled", settings.Disabled.ToString()); } 1066 if (settings.Required) { optionalAttributes.Add("required", settings.Required.ToString()); } 1067 if (settings.MaxLength != 0) { optionalAttributes.Add("maxlength", settings.MaxLength.ToString()); } 1068 if (settings.Rows != 0) { optionalAttributes.Add("rows", settings.Rows.ToString()); } 1069 1070 <div class="form__field-group dw-mod"> 1071 @if (!String.IsNullOrEmpty(@settings.Label)) 1072 { 1073 <label for="@settings.Id">@settings.Label</label> 1074 } 1075 1076 <textarea class="u-full-width @settings.CssClass dw-mod" name="@settings.Id" id="@(settings.Id)" value="@settings.Value" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)></textarea> 1077 1078 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1079 </div> 1080 } 1081 } 1082 @using System.Reflection 1083 @using Dynamicweb.Rapido.Blocks.Components.General 1084 @using Dynamicweb.Rapido.Blocks.Components 1085 1086 1087 @* Component *@ 1088 1089 @helper RenderHiddenField(HiddenField settings) { 1090 dynamic[] methodParameters = new dynamic[1]; 1091 methodParameters[0] = settings; 1092 MethodInfo customMethod = this.GetType().GetMethod(settings.HelperName + "Custom"); 1093 1094 if (customMethod != null) 1095 { 1096 @customMethod.Invoke(this, methodParameters).ToString(); 1097 } else { 1098 <input type="hidden" name="@settings.Id" id="@(settings.Id)" value="@settings.Value" @ComponentMethods.AddAttributes(settings.ExtraAttributes)/> 1099 } 1100 } 1101 @using System.Reflection 1102 @using Dynamicweb.Rapido.Blocks.Components.General 1103 @using Dynamicweb.Rapido.Blocks.Components 1104 1105 1106 @* Component *@ 1107 1108 @helper RenderCheckboxField(dynamic settings) { 1109 dynamic[] methodParameters = new dynamic[1]; 1110 methodParameters[0] = settings; 1111 MethodInfo customMethod = this.GetType().GetMethod("RenderCheckboxFieldCustom"); 1112 1113 if (customMethod != null) 1114 { 1115 @customMethod.Invoke(this, methodParameters).ToString(); 1116 } else { 1117 settings.Type = FieldListOptionType.Checkbox; 1118 string disabled = settings.Disabled ? "disabled" : ""; 1119 string required = settings.Required ? "required" : ""; 1120 string checkedString = settings.Checked == true ? "checked" : ""; 1121 string id = settings.Id != null ? settings.Id : settings.Label.Replace(" ", ""); 1122 1123 <div class="form__field-group dw-mod"> 1124 <input type="checkbox" class="form__control @settings.CssClass @disabled dw-mod" name="@settings.Name" id="@id" value="@settings.Value" onclick="@settings.OnClick" @disabled @required @checkedString @ComponentMethods.AddAttributes(settings.ExtraAttributes) /> 1125 1126 @if (!String.IsNullOrEmpty(settings.Label)) 1127 { 1128 <label for="@id" class="@disabled dw-mod">@settings.Label</label> 1129 } 1130 1131 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1132 </div> 1133 } 1134 } 1135 @using System.Reflection 1136 @using Dynamicweb.Rapido.Blocks.Components.General 1137 @using Dynamicweb.Rapido.Blocks.Components 1138 1139 1140 @* Component *@ 1141 1142 @helper RenderCheckboxListField(CheckboxListField settings) { 1143 dynamic[] methodParameters = new dynamic[1]; 1144 methodParameters[0] = settings; 1145 MethodInfo customMethod = this.GetType().GetMethod("RenderCheckboxListFieldCustom"); 1146 1147 if (customMethod != null) 1148 { 1149 @customMethod.Invoke(this, methodParameters).ToString(); 1150 } else { 1151 string disabled = settings.Disabled ? "disabled" : ""; 1152 1153 <div class="form__field-group @settings.CssClass u-margin-bottom @disabled dw-mod" @disabled @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1154 @if (!String.IsNullOrEmpty(settings.Label)) 1155 { 1156 <div class="u-bold u-margin-bottom">@settings.Label</div> 1157 } 1158 1159 @foreach (var item in settings.Options) 1160 { 1161 item.Type = FieldListOptionType.Checkbox; 1162 @RenderFieldListOption(item) 1163 } 1164 1165 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1166 </div> 1167 } 1168 } 1169 1170 @using System.Reflection 1171 @using Dynamicweb.Rapido.Blocks.Components.General 1172 @using Dynamicweb.Rapido.Blocks.Components 1173 1174 1175 @* Component *@ 1176 1177 @helper RenderSelectField(SelectField settings) { 1178 dynamic[] methodParameters = new dynamic[1]; 1179 methodParameters[0] = settings; 1180 MethodInfo customMethod = this.GetType().GetMethod("RenderSelectFieldCustom"); 1181 1182 if (customMethod != null) 1183 { 1184 @customMethod.Invoke(this, methodParameters).ToString(); 1185 } else { 1186 string disabled = settings.Disabled ? "disabled" : ""; 1187 string required = settings.Required ? "required" : ""; 1188 1189 if (settings.Default != null) 1190 { 1191 settings.Default.Type = FieldListOptionType.SelectOption; 1192 } 1193 1194 <div class="form__field-group u-full-width dw-mod"> 1195 @if (!String.IsNullOrEmpty(settings.Label)) 1196 { 1197 <label for="@settings.Id">@settings.Label</label> 1198 } 1199 1200 <div class="form__field-combi u-no-margin dw-mod"> 1201 <select id="@settings.Id" class="u-full-width @settings.CssClass dw-mod" onchange="@settings.OnChange" @ComponentMethods.AddAttributes(settings.ExtraAttributes) > 1202 @if (settings.Default.Value != null) 1203 { 1204 @RenderFieldListOption(settings.Default) 1205 } 1206 1207 @foreach (var item in settings.Options) 1208 { 1209 item.Type = FieldListOptionType.SelectOption; 1210 @RenderFieldListOption(item) 1211 } 1212 </select> 1213 @if (settings.ActionButton.Link != null || settings.ActionButton.OnClick != null) { 1214 settings.ActionButton.CssClass += " btn--condensed u-no-margin"; 1215 @RenderButton(settings.ActionButton); 1216 } 1217 </div> 1218 1219 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1220 </div> 1221 } 1222 } 1223 @using System.Reflection 1224 @using Dynamicweb.Rapido.Blocks.Components.General 1225 @using Dynamicweb.Rapido.Blocks.Components 1226 1227 1228 @* Component *@ 1229 1230 @helper RenderRadioButtonField(RadioButtonField settings) { 1231 dynamic[] methodParameters = new dynamic[1]; 1232 methodParameters[0] = settings; 1233 MethodInfo customMethod = this.GetType().GetMethod("RenderRadioButtonFieldCustom"); 1234 1235 if (customMethod != null) 1236 { 1237 @customMethod.Invoke(this, methodParameters).ToString(); 1238 } else { 1239 string disabled = settings.Disabled ? "disabled" : ""; 1240 1241 <div class="form__field-group @settings.CssClass u-margin-bottom @disabled" @disabled @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1242 @if (!String.IsNullOrEmpty(settings.Label)) 1243 { 1244 <div class="u-bold u-margin-bottom">@settings.Label</div> 1245 } 1246 1247 @foreach (var item in settings.Options) 1248 { 1249 item.Type = FieldListOptionType.RadioButton; 1250 1251 if (settings.Name != null) 1252 { 1253 item.Name = settings.Name; 1254 } 1255 1256 if (settings.RenderOptionsInline) 1257 { 1258 @RenderFieldListOption(item) 1259 } 1260 else 1261 { 1262 <div> 1263 @RenderFieldListOption(item) 1264 </div> 1265 } 1266 } 1267 1268 @RenderNotificationMessage(new NotificationMessage { Message = settings.ErrorMessage }) 1269 </div> 1270 } 1271 } 1272 @using System.Reflection 1273 @using Dynamicweb.Rapido.Blocks.Components.General 1274 @using Dynamicweb.Rapido.Blocks.Components 1275 1276 1277 @* Component *@ 1278 1279 @helper RenderNotificationMessage(NotificationMessage settings) { 1280 dynamic[] methodParameters = new dynamic[1]; 1281 methodParameters[0] = settings; 1282 MethodInfo customMethod = this.GetType().GetMethod("RenderNotificationMessageCustom"); 1283 1284 if (customMethod != null) 1285 { 1286 @customMethod.Invoke(this, methodParameters).ToString(); 1287 } else { 1288 if (!String.IsNullOrEmpty(settings.Message)) 1289 { 1290 string messageTypeClass = settings.MessageType.ToString().ToLower(); 1291 <div class="field-@messageTypeClass @settings.CssClass u-full-width dw-mod">@settings.Message</div> 1292 } 1293 } 1294 } 1295 @using System.Reflection 1296 @using Dynamicweb.Rapido.Blocks.Components.General 1297 1298 1299 @* Component *@ 1300 1301 @helper RenderHandlebarsRoot(HandlebarsRoot settings) { 1302 dynamic[] methodParameters = new dynamic[1]; 1303 methodParameters[0] = settings; 1304 MethodInfo customMethod = this.GetType().GetMethod("RenderHandlebarsRootCustom"); 1305 1306 if (customMethod != null) 1307 { 1308 @customMethod.Invoke(this, methodParameters).ToString(); 1309 } else { 1310 string preRender = !String.IsNullOrEmpty(settings.PreRenderScriptTemplate) ? "data-pre-render-template=\"" + settings.PreRenderScriptTemplate + "\"" : ""; 1311 1312 <div class="@settings.CssClass dw-mod js-handlebars-root" id="@settings.Id" data-template="@settings.ScriptTemplate" data-json-feed="@settings.FeedUrl" data-init-onload="@settings.InitOnLoad.ToString()" data-preloader="@settings.Preloader" @preRender> 1313 @if (settings.SubBlocks != null) { 1314 @RenderBlockList(settings.SubBlocks) 1315 } 1316 </div> 1317 } 1318 } 1319 @using System.Reflection 1320 @using Dynamicweb.Rapido.Blocks.Components.General 1321 @using Dynamicweb.Rapido.Blocks.Components 1322 @using System.Text.RegularExpressions 1323 1324 1325 @* Component *@ 1326 1327 @helper RenderSticker(Sticker settings) { 1328 dynamic[] methodParameters = new dynamic[1]; 1329 methodParameters[0] = settings; 1330 MethodInfo customMethod = this.GetType().GetMethod("RenderStickerCustom"); 1331 1332 if (customMethod != null) 1333 { 1334 @customMethod.Invoke(this, methodParameters).ToString(); 1335 } 1336 else 1337 { 1338 if (!String.IsNullOrEmpty(settings.Title)) { 1339 string size = settings.Size.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Size.ToString().ToLower() : ""; 1340 string style = settings.Style.ToString() != "None" ? "" + "stickers-container__tag--" + settings.Style.ToString().ToLower() : ""; 1341 1342 Dictionary<String, String> optionalAttributes = new Dictionary<string, string>(); 1343 if (!String.IsNullOrEmpty(settings.Color) || !String.IsNullOrEmpty(settings.BackgroundColor)) { 1344 string styleTag = !String.IsNullOrEmpty(settings.Color) ? "color: " + settings.Color + "; " : ""; 1345 styleTag += !String.IsNullOrEmpty(settings.BackgroundColor) ? "background-color: " + settings.BackgroundColor + "; " : ""; 1346 optionalAttributes.Add("style", styleTag); 1347 } 1348 1349 <div class="stickers-container__tag @size @style @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(optionalAttributes) @ComponentMethods.AddAttributes(settings.ExtraAttributes)>@settings.Title</div> 1350 } 1351 } 1352 } 1353 1354 @using System.Reflection 1355 @using Dynamicweb.Rapido.Blocks.Components.General 1356 @using Dynamicweb.Rapido.Blocks.Components 1357 1358 1359 @* Component *@ 1360 1361 @helper RenderStickersCollection(StickersCollection settings) { 1362 dynamic[] methodParameters = new dynamic[1]; 1363 methodParameters[0] = settings; 1364 MethodInfo customMethod = this.GetType().GetMethod("RenderStickersCollectionCustom"); 1365 1366 if (customMethod != null) 1367 { 1368 @customMethod.Invoke(this, methodParameters).ToString(); 1369 } 1370 else 1371 { 1372 if (settings.Stickers.Count > 0) { 1373 string position = settings.Position != null ? "" + "stickers-container--" + Regex.Replace(settings.Position.ToString(), "([a-z])([A-Z])", "$1-$2").ToLower() : ""; 1374 1375 <div class="stickers-container @position @settings.CssClass dw-mod" @ComponentMethods.AddAttributes(settings.ExtraAttributes)> 1376 @foreach (Sticker sticker in settings.Stickers) 1377 { 1378 @RenderSticker(sticker) 1379 } 1380 </div> 1381 } 1382 } 1383 } 1384 1385 @using System.Reflection 1386 @using Dynamicweb.Rapido.Blocks.Components.General 1387 @using Dynamicweb.Rapido.Blocks.Components 1388 1389 1390 1391 @* Component *@ 1392 1393 @helper RenderField(Field settings) { 1394 dynamic[] methodParameters = new dynamic[1]; 1395 methodParameters[0] = settings; 1396 MethodInfo customMethod = this.GetType().GetMethod("RenderFieldCustom"); 1397 1398 if (customMethod != null) 1399 { 1400 @customMethod.Invoke(this, methodParameters).ToString(); 1401 } else { 1402 switch (settings.FieldType) 1403 { 1404 case FieldType.Checkbox: 1405 CheckboxField checkbox = new CheckboxField 1406 { 1407 Label = settings.Label, 1408 Id = settings.Id, 1409 Name = settings.Label.Replace(" ", ""), 1410 Value = settings.Value, 1411 Checked = Convert.ToBoolean(settings.Placeholder), 1412 OnClick = settings.OnClick, 1413 Disabled = settings.Disabled, 1414 Required = settings.Required, 1415 CssClass = settings.CssClass, 1416 ExtraAttributes = settings.ExtraAttributes, 1417 ErrorMessage = settings.ErrorMessage 1418 }; 1419 1420 @RenderCheckboxField(checkbox) 1421 break; 1422 case FieldType.Email: 1423 TextField emailField = new TextField 1424 { 1425 Label = settings.Label != null ? settings.Label : Translate("Email"), 1426 Id = settings.Id, 1427 Value = settings.Value, 1428 OnClick = settings.OnClick, 1429 Disabled = settings.Disabled, 1430 Required = settings.Required, 1431 CssClass = settings.CssClass, 1432 ExtraAttributes = settings.ExtraAttributes, 1433 ErrorMessage = settings.ErrorMessage, 1434 Placeholder = settings.Placeholder, 1435 Type = TextFieldType.Email 1436 }; 1437 1438 @RenderTextField(emailField) 1439 break; 1440 case FieldType.Hidden: 1441 HiddenField hiddenField = new HiddenField 1442 { 1443 Label = settings.Label, 1444 Id = settings.Id, 1445 Value = settings.Value, 1446 Disabled = settings.Disabled, 1447 Required = settings.Required, 1448 CssClass = settings.CssClass, 1449 ExtraAttributes = settings.ExtraAttributes, 1450 ErrorMessage = settings.ErrorMessage 1451 }; 1452 1453 @RenderHiddenField(hiddenField) 1454 break; 1455 case FieldType.Integer: 1456 NumberField numberField = new NumberField 1457 { 1458 Label = settings.Label, 1459 Id = settings.Id, 1460 Value = settings.Value.GetType() == typeof(int) ? Convert.ToInt32(settings.Value) : 1, 1461 OnClick = settings.OnClick, 1462 Disabled = settings.Disabled, 1463 Required = settings.Required, 1464 CssClass = settings.CssClass, 1465 ExtraAttributes = settings.ExtraAttributes, 1466 ErrorMessage = settings.ErrorMessage, 1467 Step = 1 1468 }; 1469 1470 @RenderNumberField(numberField) 1471 break; 1472 case FieldType.Password: 1473 TextField passwordField = new TextField 1474 { 1475 Label = settings.Label != null ? settings.Label : Translate("Password"), 1476 Id = settings.Id, 1477 Value = settings.Value, 1478 OnClick = settings.OnClick, 1479 Disabled = settings.Disabled, 1480 Required = settings.Required, 1481 CssClass = settings.CssClass, 1482 ExtraAttributes = settings.ExtraAttributes, 1483 ErrorMessage = settings.ErrorMessage, 1484 Placeholder = settings.Placeholder, 1485 Type = TextFieldType.Password 1486 }; 1487 1488 @RenderTextField(passwordField) 1489 break; 1490 case FieldType.Reset: 1491 Button resetField = new Button 1492 { 1493 Title = settings.Label != null ? settings.Label : Translate("Reset"), 1494 Id = settings.Id, 1495 OnClick = settings.OnClick, 1496 Disabled = settings.Disabled, 1497 CssClass = settings.CssClass, 1498 ExtraAttributes = settings.ExtraAttributes, 1499 ButtonLayout = ButtonLayout.Secondary, 1500 ButtonType = ButtonType.Reset 1501 }; 1502 1503 @RenderButton(resetField) 1504 break; 1505 case FieldType.Submit: 1506 Button submitField = new Button 1507 { 1508 Title = settings.Label != null ? settings.Label : Translate("Submit"), 1509 Id = settings.Id, 1510 OnClick = settings.OnClick, 1511 Disabled = settings.Disabled, 1512 CssClass = settings.CssClass, 1513 ExtraAttributes = settings.ExtraAttributes, 1514 ButtonLayout = ButtonLayout.Primary, 1515 ButtonType = ButtonType.Submit 1516 }; 1517 1518 @RenderButton(submitField) 1519 break; 1520 case FieldType.Tel: 1521 TextField telField = new TextField 1522 { 1523 Label = settings.Label != null ? settings.Label : Translate("Phone"), 1524 Id = settings.Id, 1525 Value = settings.Value, 1526 OnClick = settings.OnClick, 1527 Disabled = settings.Disabled, 1528 Required = settings.Required, 1529 CssClass = settings.CssClass, 1530 ExtraAttributes = settings.ExtraAttributes, 1531 ErrorMessage = settings.ErrorMessage, 1532 Placeholder = settings.Placeholder, 1533 Type = TextFieldType.Tel 1534 }; 1535 1536 @RenderTextField(telField) 1537 break; 1538 case FieldType.Text: 1539 TextField textField = new TextField 1540 { 1541 Label = settings.Label, 1542 Id = settings.Id, 1543 Value = settings.Value, 1544 OnClick = settings.OnClick, 1545 Disabled = settings.Disabled, 1546 Required = settings.Required, 1547 CssClass = settings.CssClass, 1548 ExtraAttributes = settings.ExtraAttributes, 1549 ErrorMessage = settings.ErrorMessage, 1550 Placeholder = settings.Placeholder, 1551 Type = TextFieldType.Text 1552 }; 1553 1554 @RenderTextField(textField) 1555 break; 1556 case FieldType.Textarea: 1557 TextareaField textareaField = new TextareaField 1558 { 1559 Label = settings.Label, 1560 Id = settings.Id, 1561 Value = settings.Value, 1562 OnClick = settings.OnClick, 1563 Disabled = settings.Disabled, 1564 Required = settings.Required, 1565 CssClass = settings.CssClass, 1566 ExtraAttributes = settings.ExtraAttributes, 1567 ErrorMessage = settings.ErrorMessage, 1568 Placeholder = settings.Placeholder 1569 }; 1570 1571 @RenderTextareaField(textareaField) 1572 break; 1573 default: 1574 TextField defaultField = new TextField 1575 { 1576 Label = settings.Label, 1577 Id = settings.Id, 1578 Value = settings.Value, 1579 OnClick = settings.OnClick, 1580 Disabled = settings.Disabled, 1581 Required = settings.Required, 1582 CssClass = settings.CssClass, 1583 ExtraAttributes = settings.ExtraAttributes, 1584 ErrorMessage = settings.ErrorMessage, 1585 Placeholder = settings.Placeholder, 1586 Type = TextFieldType.Text 1587 }; 1588 1589 @RenderTextField(defaultField) 1590 break; 1591 } 1592 } 1593 } 1594 1595 1596 @using Dynamicweb.Frontend 1597 @using System.Reflection 1598 @using Dynamicweb.Content.Items 1599 @using System.Web.UI.HtmlControls 1600 @using Dynamicweb.Rapido.Blocks.Components 1601 @using Dynamicweb.Rapido.Blocks 1602 1603 1604 @* Components for the articles - Remeber to make a NZ copy of this template - and change line NZheader.cshtml to [Include file 'NZHeader.cshtml' not found in 'Templates/Designs/HD2412/Components/ArticleComponents.cshtml'] *@ 1605 @using System.Reflection 1606 @using Dynamicweb.Rapido.Blocks.Components.Articles 1607 @using System.Text.RegularExpressions 1608 1609 1610 @* Component for the articles *@ 1611 1612 @helper RenderArticleBanner(dynamic settings) 1613 { 1614 string headline = settings.Heading; 1615 //Video 1616 //getting video ID from youtube URL 1617 string videoCode = ""; 1618 var userAgent = HttpContext.Current.Request.UserAgent.ToString(); 1619 1620 bool ie9String = userAgent.Contains("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"); 1621 bool ie10String = userAgent.Contains("Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)"); 1622 bool ie11String = userAgent.Contains("Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko"); 1623 Regex regex = new Regex(@".be\/(.[^?]*)"); 1624 Match match = regex.Match(videoCode); 1625 1626 string videoId = ""; 1627 if (match.Success) 1628 { 1629 videoId = match.Groups[1].Value; 1630 } 1631 else 1632 { 1633 regex = new Regex(@"v=([^&]+)"); 1634 match = regex.Match(videoCode); 1635 if (match.Success) 1636 { 1637 videoId = match.Groups[1].Value; 1638 } 1639 } 1640 1641 string heroHeight = string.IsNullOrEmpty(videoCode) ? "heroheight" : ""; 1642 1643 string placeHolderImage = "/Files/Images/placeholder.gif"; 1644 string backgroundImage = ""; 1645 string backgroundImageLarge = ""; 1646 string backgroundImageMedium = ""; 1647 string backgroundImageSmall = ""; 1648 int backgroundImageWidth = 2500; 1649 int backgroundImageLargeWidth = 1440; 1650 int backgroundImageMediumWidth = 1300; 1651 int backgroundImageSmallWidth = 1024; 1652 1653 if (settings.Image != null) 1654 { 1655 string focalPointParameters = settings.Image.Path != null ? "&" + settings.Image.Path.GetFocalPointParameters() : ""; 1656 backgroundImage = "/Admin/Public/GetImage.ashx?width=" + backgroundImageWidth + "&amp;height=1100&amp;crop=7" + "&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + settings.Image.Path + focalPointParameters; 1657 backgroundImageLarge = "/Admin/Public/GetImage.ashx?width=" + backgroundImageLargeWidth + "&amp;height=370&amp;crop=7" + "&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + settings.Image.Path + focalPointParameters; 1658 backgroundImageMedium = "/Admin/Public/GetImage.ashx?width=" + backgroundImageMediumWidth + "&amp;height=572&amp;crop=7" + "&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + settings.Image.Path + focalPointParameters; 1659 backgroundImageSmall = "/Admin/Public/GetImage.ashx?width=" + backgroundImageSmallWidth + "&amp;height=450&amp;crop=7" + "&amp;Compression=85&amp;DoNotUpscale=true&amp;image=" + settings.Image.Path + focalPointParameters; 1660 } 1661 1662 dynamic[] methodParameters = new dynamic[1]; 1663 methodParameters[0] = settings; 1664 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleBannerCustom"); 1665 1666 var ieClass = ie10String || ie9String || ie11String ? "ie-hero" : ""; 1667 1668 if (customMethod != null) 1669 { 1670 @customMethod.Invoke(this, methodParameters).ToString(); 1671 } 1672 else 1673 { 1674 settings.Layout = ArticleHeaderLayout.Banner; 1675 1676 if (settings.Image != null) 1677 { 1678 if (settings.Image.Path != null) 1679 { 1680 <div class="grid__col-md-12 grid__col--bleed u-padding-bottom--lg"> 1681 <section class="@ieClass hero multiple-paragraphs-container paragraph-container grid--justify-center"> 1682 <div class="background-image image-filter"> 1683 <div class="background-image__wrapper image-filter"> 1684 <img class="background-image__cover dw-mod b-lazy" src="@placeHolderImage" data-src="@backgroundImage" data-src-small="@backgroundImageSmall" data-src-medium="@backgroundImageMedium" data-src-large="@backgroundImageLarge" alt="@settings.Image.Path"> 1685 @if (!string.IsNullOrEmpty(videoCode)) 1686 { 1687 1688 <div class="video-background"> 1689 <div class="video-background__container"> 1690 <div class="js-youtube-video" data-video="@videoCode" id="ytPlayer"></div> 1691 </div> 1692 </div> 1693 } 1694 </div> 1695 </div> 1696 <div class="grid paragraph-container--height-xl @heroHeight grid--justify-center dw-mod"> 1697 <div class="grid__col-sm-12 grid__col-xs-12 paragraph-container dw-mod grid--justify-center "> 1698 </div> 1699 </div> 1700 1701 </section> 1702 </div> 1703 } 1704 else 1705 { 1706 settings.Layout = ArticleHeaderLayout.Clean; 1707 @RenderArticleCleanHeader(settings); 1708 } 1709 } 1710 else 1711 { 1712 settings.Layout = ArticleHeaderLayout.Clean; 1713 @RenderArticleCleanHeader(settings); 1714 } 1715 1716 if (!String.IsNullOrEmpty(headline)) 1717 { 1718 <h1 class="article__leadtext dw-mod grid-custom-layout-third">@headline</h1> 1719 1720 } 1721 } 1722 } 1723 @using System.Reflection 1724 @using Dynamicweb.Frontend 1725 @using Dynamicweb.Rapido.Blocks.Components 1726 @using Dynamicweb.Rapido.Blocks.Components.General 1727 @using Dynamicweb.Rapido.Blocks.Components.Articles 1728 @using Dynamicweb.Rapido.Blocks 1729 @using S_DW_HD2412.CustomCode 1730 1731 1732 1733 @* Component for the articles *@ 1734 1735 @helper RenderArticleHeaderExtended(ArticleHeaderExtended settings) 1736 { 1737 dynamic[] methodParameters = new dynamic[1]; 1738 methodParameters[0] = settings; 1739 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleHeaderCustom"); 1740 1741 if (customMethod != null) 1742 { 1743 @customMethod.Invoke(this, methodParameters).ToString(); 1744 } 1745 else 1746 { 1747 switch (settings.Layout) 1748 { 1749 case ArticleHeaderLayout.Clean: 1750 @RenderArticleCleanHeader(settings); 1751 break; 1752 case ArticleHeaderLayout.Split: 1753 @RenderArticleSplitHeader(settings); 1754 break; 1755 case ArticleHeaderLayout.Banner: 1756 @RenderArticleBannerHeader(settings); 1757 break; 1758 case ArticleHeaderLayout.Overlay: 1759 @RenderArticleOverlayHeader(settings); 1760 break; 1761 default: 1762 @RenderArticleCleanHeader(settings); 1763 break; 1764 } 1765 } 1766 } 1767 1768 @helper RenderArticleCleanHeader(ArticleHeaderExtended settings) 1769 { 1770 dynamic[] methodParameters = new dynamic[1]; 1771 methodParameters[0] = settings; 1772 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleCleanHeaderCustom"); 1773 1774 if (customMethod != null) 1775 { 1776 @customMethod.Invoke(this, methodParameters).ToString(); 1777 } 1778 else 1779 { 1780 string contentColumns = settings.TextLayout != ArticleHeaderTextLayout.Full ? "8" : "12"; 1781 1782 <div class="grid grid--align-content-start grid--justify-start"> 1783 <div class="grid__col-md-@contentColumns grid__col-sm-12 u-padding--lg dw-mod"> 1784 1785 1786 <div class="grid__cell"> 1787 @if (settings.Image != null) 1788 { 1789 if (settings.Image.Path != null) 1790 { 1791 <div class="u-padding-bottom--lg"> 1792 @RenderImage(settings.Image) 1793 </div> 1794 1795 } 1796 } 1797 1798 @if (!String.IsNullOrEmpty(settings.Heading)) 1799 { 1800 1801 //Check to hide heading if the item is not a Dynamic Article 1802 var ItemName = PageView.Current().Item.SystemName; 1803 1804 if (ItemName == "DynamicArticle") 1805 { 1806 <h1 class="article__header article__header--giant dw-mod">@settings.Heading</h1> 1807 } 1808 1809 else 1810 { 1811 } 1812 1813 } 1814 1815 @if (!String.IsNullOrEmpty(settings.Category) || !String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date) || settings.RatingOutOf != 0) 1816 { 1817 <div class="u-padding-bottom"> 1818 @*@if (!String.IsNullOrEmpty(settings.Category)) 1819 { 1820 <div class="u-pull--left"> 1821 <div class="article__category dw-mod" style="color: @settings.CategoryColor">@settings.Category</div> 1822 </div> 1823 }*@ 1824 <div class=""> 1825 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 1826 { 1827 <div class="d-flex justify-content-between align-items-center" style="margin-top: 10px;"> 1828 <small class="article__post-info dw-mod" style="margin-top: 0;">@Translate("Author"): @settings.Author, @settings.Date</small> 1829 @if (!String.IsNullOrEmpty(settings.Tag)) 1830 { 1831 <div> 1832 @foreach (string tag in settings.Tag.Split(',')) 1833 { 1834 <span class="tag-badge">@(Translate($"Tag Badge - {tag}", tag))</span> 1835 } 1836 </div> 1837 1838 } 1839 1840 </div> 1841 } 1842 @*@if (settings.RatingOutOf != 0) 1843 { 1844 @RenderRating(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 1845 }*@ 1846 </div> 1847 </div> 1848 1849 } 1850 1851 @if (!String.IsNullOrEmpty(settings.Subheading)) 1852 { 1853 <div class="article__leadtext news-article-leadtext dw-mod">@settings.Subheading</div> 1854 } 1855 @if (!String.IsNullOrEmpty(settings.Link)) 1856 { 1857 <div class="grid__cell"> 1858 @RenderButton(new Button { Link = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 1859 </div> 1860 } 1861 </div> 1862 </div> 1863 @if (settings.ExternalParagraphId != 0) 1864 { 1865 <div class="grid__col-md-4 grid__col-sm-12 u-padding--lg u-color-light-gray--bg dw-mod"> 1866 @RenderParagraphContent(settings.ExternalParagraphId) 1867 </div> 1868 } 1869 </div> 1870 } 1871 } 1872 1873 @helper RenderArticleSplitHeader(ArticleHeaderExtended settings) 1874 { 1875 dynamic[] methodParameters = new dynamic[1]; 1876 methodParameters[0] = settings; 1877 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleSplitHeaderCustom"); 1878 1879 if (customMethod != null) 1880 { 1881 @customMethod.Invoke(this, methodParameters).ToString(); 1882 } 1883 else 1884 { 1885 string headerColumnWidth = settings.ExternalParagraphId != 0 ? "4" : "6"; 1886 1887 if (settings.Image != null) 1888 { 1889 if (settings.Image.Path != null) 1890 { 1891 <section class="multiple-paragraphs-container paragraph-container--full-width"> 1892 <div class="grid"> 1893 <div class="grid__col-md-@headerColumnWidth grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-xl dw-mod"> 1894 <div class="u-left-middle u-padding--lg"> 1895 <div> 1896 @if (!String.IsNullOrEmpty(settings.Category)) 1897 { 1898 <div class="article__category dw-mod" style="color: @settings.CategoryColor">@settings.Category</div> 1899 } 1900 @if (!String.IsNullOrEmpty(settings.Heading)) 1901 { 1902 <h1 class="article__header article__header--giant dw-mod">@settings.Heading</h1> 1903 } 1904 @if (!String.IsNullOrEmpty(settings.Subheading)) 1905 { 1906 <div class="article__leadtext dw-mod">@settings.Subheading</div> 1907 } 1908 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 1909 { 1910 <small class="article__post-info u-pull--left dw-mod">@settings.Author @settings.Date</small> 1911 } 1912 @if (settings.RatingOutOf != 0) 1913 { 1914 <div class="u-pull--right"> 1915 @RenderRating(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 1916 </div> 1917 } 1918 @if (!String.IsNullOrEmpty(settings.Link)) 1919 { 1920 @RenderButton(new Button { Link = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 1921 } 1922 </div> 1923 </div> 1924 </div> 1925 <div class="grid__col-md-@headerColumnWidth grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-auto dw-mod" style="background-image:url(/Admin/Public/GetImage.ashx?width=1800&amp;height=1100&amp;crop=0&amp;Compression=85&amp;DoNotUpscale=true&amp;image=@settings.Image.Path); background-position: center center; background-size: cover;"></div> 1926 @if (settings.ExternalParagraphId != 0) 1927 { 1928 <div class="grid__col-md-4 grid__col-sm-12 grid__col-xs-12 paragraph-container paragraph-container--height-auto u-color-light-gray--bg dw-mod"> 1929 @RenderParagraphContent(settings.ExternalParagraphId) 1930 </div> 1931 } 1932 </div> 1933 </section> 1934 } 1935 } 1936 else 1937 { 1938 @RenderArticleCleanHeader(settings); 1939 } 1940 } 1941 } 1942 1943 @helper RenderArticleOverlayHeader(ArticleHeaderExtended settings) 1944 { 1945 dynamic[] methodParameters = new dynamic[1]; 1946 methodParameters[0] = settings; 1947 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleOverlayHeaderCustom"); 1948 1949 if (customMethod != null) 1950 { 1951 @customMethod.Invoke(this, methodParameters).ToString(); 1952 } 1953 else 1954 { 1955 string contentColumns = settings.TextLayout != ArticleHeaderTextLayout.Full ? "8" : "12"; 1956 string contentAlignment = settings.TextLayout == ArticleHeaderTextLayout.Center ? "grid--justify-center" : ""; 1957 1958 if (settings.Image != null) 1959 { 1960 if (settings.Image.Path != null) 1961 { 1962 if (settings.ExternalParagraphId == 0) 1963 { 1964 <section class="multiple-paragraphs-container u-color-light paragraph-container--full-width"> 1965 <div class="background-image image-filter image-filter--darken dw-mod"> 1966 <div class="background-image__wrapper image-filter image-filter--darken dw-mod"> 1967 @{ 1968 settings.Image.CssClass += "background-image__cover dw-mod"; 1969 } 1970 @RenderImage(settings.Image) 1971 </div> 1972 </div> 1973 <div class="center-container dw-mod"> 1974 <div class="grid @contentAlignment"> 1975 <div class="grid__col-md-@contentColumns grid__col-xs-12 paragraph-container paragraph-container--height-xl u-no-padding dw-mod"> 1976 @if (!String.IsNullOrEmpty(settings.Heading)) 1977 { 1978 <h1 class="article__header article__header--giant u-padding-top--lg dw-mod" style="color: @settings.TextColor">@settings.Heading</h1> 1979 } 1980 @if (!String.IsNullOrEmpty(settings.Subheading)) 1981 { 1982 <div class="article__leadtext dw-mod" style="color: @settings.TextColor">@settings.Subheading</div> 1983 } 1984 <div class="u-margin-top"> 1985 @if (!String.IsNullOrEmpty(settings.Author) || !String.IsNullOrEmpty(settings.Date)) 1986 { 1987 <small class="article__post-info u-pull--left dw-mod" style="color: @settings.TextColor">@settings.Author @settings.Date</small> 1988 } 1989 @if (settings.RatingOutOf != 0) 1990 { 1991 <div class="u-pull--right"> 1992 @RenderRating(new Rating { Score = settings.RatingScore, OutOf = settings.RatingOutOf }) 1993 </div> 1994 } 1995 </div> 1996 @if (!String.IsNullOrEmpty(settings.Link)) 1997 { 1998 <div class="grid__cell"> 1999 @RenderButtonExtended(new ButtonExtended { Link = settings.Link, Title = settings.LinkText, ButtonLayout = settings.ButtonLayout }) 2000 </div> 2001 } 2002 </div> 2003 </div> 2004 </div> 2005 </section> 2006 } 2007 else 2008 { 2009 @RenderArticleBanner(settings); 2010 } 2011 } 2012 } 2013 else 2014 { 2015 @RenderArticleCleanHeader(settings); 2016 } 2017 } 2018 } 2019 2020 @helper RenderArticleBannerHeader(dynamic settings) 2021 { 2022 dynamic[] methodParameters = new dynamic[1]; 2023 methodParameters[0] = settings; 2024 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleBannerHeaderCustom"); 2025 2026 if (customMethod != null) 2027 { 2028 @customMethod.Invoke(this, methodParameters).ToString(); 2029 } 2030 else 2031 { 2032 @RenderArticleBanner(settings); 2033 } 2034 } 2035 2036 2037 @using System.Reflection 2038 @using System.Text.RegularExpressions; 2039 @using Dynamicweb.Frontend 2040 @using Dynamicweb.Content.Items 2041 @using Dynamicweb.Rapido.Blocks.Components 2042 @using Dynamicweb.Rapido.Blocks.Components.Articles 2043 @using Dynamicweb.Rapido.Blocks 2044 2045 @* Component for the articles *@ 2046 2047 @helper RenderArticleBodyRow(ArticleBodyRow settings) 2048 { 2049 dynamic[] methodParameters = new dynamic[1]; 2050 methodParameters[0] = settings; 2051 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleBodyRowCustom"); 2052 2053 if (customMethod != null) 2054 { 2055 @customMethod.Invoke(this, methodParameters).ToString(); 2056 } else { 2057 string position = settings.TopLayout == "overlay" ? "article__overlay-offset" : ""; 2058 string contentAlignment = settings.TextLayout == "center" ? "grid--justify-center" : ""; 2059 2060 <div class="grid grid--align-content-start @contentAlignment @position dw-mod"> 2061 @RenderBlockList(settings.SubBlocks) 2062 </div> 2063 } 2064 } 2065 @using System.Reflection 2066 @using Dynamicweb.Rapido.Blocks.Components 2067 @using Dynamicweb.Rapido.Blocks.Components.General 2068 @using Dynamicweb.Rapido.Blocks.Components.Articles 2069 @using Dynamicweb.Rapido.Blocks 2070 2071 @* Component for the articles *@ 2072 2073 @helper RenderArticleImage(ArticleImage settings) 2074 { 2075 dynamic[] methodParameters = new dynamic[1]; 2076 methodParameters[0] = settings; 2077 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleImageCustom"); 2078 2079 if (customMethod != null) 2080 { 2081 @customMethod.Invoke(this, methodParameters).ToString(); 2082 } 2083 else 2084 { 2085 if (settings.Image != null) 2086 { 2087 if (settings.Image.Path != null) 2088 { 2089 <div class="u-margin-bottom--lg"> 2090 @RenderImage(settings.Image) 2091 </div> 2092 } 2093 } 2094 } 2095 } 2096 @using System.Reflection 2097 @using Dynamicweb.Rapido.Blocks.Components 2098 @using Dynamicweb.Rapido.Blocks.Components.Articles 2099 2100 2101 @* Component for the articles *@ 2102 2103 @helper RenderArticleSubHeader(ArticleSubHeader settings) 2104 { 2105 dynamic[] methodParameters = new dynamic[1]; 2106 methodParameters[0] = settings; 2107 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleSubHeaderCustom"); 2108 2109 if (customMethod != null) 2110 { 2111 @customMethod.Invoke(this, methodParameters).ToString(); 2112 } else { 2113 if (!String.IsNullOrEmpty(settings.Title)) 2114 { 2115 <h2 class="article__header">@settings.Title</h2> 2116 } 2117 } 2118 } 2119 @using System.Reflection 2120 @using Dynamicweb.Rapido.Blocks.Components 2121 @using Dynamicweb.Rapido.Blocks.Components.Articles 2122 @using Dynamicweb.Rapido.Blocks 2123 2124 2125 @* Component for the articles *@ 2126 2127 @helper RenderArticleText(ArticleText settings) 2128 { 2129 dynamic[] methodParameters = new dynamic[1]; 2130 methodParameters[0] = settings; 2131 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleTextCustom"); 2132 2133 if (customMethod != null) 2134 { 2135 @customMethod.Invoke(this, methodParameters).ToString(); 2136 } else { 2137 if (!String.IsNullOrEmpty(settings.Text)) 2138 { 2139 string greatTextClass = settings.EnableLargeText == true ? "article__paragraph--great-text" : ""; 2140 2141 <div class="article__paragraph @greatTextClass"> 2142 @settings.Text 2143 </div> 2144 } 2145 } 2146 } 2147 @using System.Reflection 2148 @using Dynamicweb.Rapido.Blocks.Components 2149 @using Dynamicweb.Rapido.Blocks.Components.Articles 2150 @using Dynamicweb.Rapido.Blocks 2151 2152 2153 @* Component for the articles - REMEMBER TO MAKE NZ COPY OF THIS AND REFERENCE IT IN DYNAMICLISTPAGE.CSHTML *@ 2154 2155 @helper RenderArticleQuote(ArticleQuote settings) 2156 { 2157 dynamic[] methodParameters = new dynamic[1]; 2158 methodParameters[0] = settings; 2159 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleQuoteCustom"); 2160 2161 if (customMethod != null) 2162 { 2163 @customMethod.Invoke(this, methodParameters).ToString(); 2164 } else { 2165 string text = Regex.Replace(settings.Text, "<.*?>", String.Empty); 2166 2167 <div class="grid u-padding-bottom--lg"> 2168 @if (settings.Image != null) 2169 { 2170 if (settings.Image.Path != null) { 2171 <div class="grid__col-md-3 grid__col-12"> 2172 <div class="grid__cell-img"> 2173 @{ 2174 settings.Image.Title = !String.IsNullOrEmpty(settings.Image.Title) ? settings.Image.Title : settings.Author; 2175 settings.Image.CssClass += " article__image article__image--square"; 2176 settings.Image.ImageDefault.Width = 200; 2177 settings.Image.ImageDefault.Height = 200; 2178 } 2179 @RenderImage(settings.Image) 2180 </div> 2181 </div> 2182 } 2183 } 2184 <div class="grid__col-auto"> 2185 <div class="custombackground"> 2186 @if (!String.IsNullOrEmpty(settings.Text)) 2187 { 2188 <div class="article__quote dw-mod"> 2189 @settings.Text 2190 </div> 2191 } 2192 @if (!String.IsNullOrEmpty(settings.Author)) 2193 { 2194 <div class="article__quote-author dw-mod"> 2195 - @settings.Author 2196 </div> 2197 } 2198 </div> 2199 </div> 2200 </div> 2201 } 2202 } 2203 @using System.Reflection 2204 @using Dynamicweb.Rapido.Blocks.Components 2205 @using Dynamicweb.Rapido.Blocks.Components.Articles 2206 @using Dynamicweb.Rapido.Blocks 2207 2208 @* Component for the articles *@ 2209 2210 @helper RenderArticleInfoTable(ArticleInfoTable settings) 2211 { 2212 dynamic[] methodParameters = new dynamic[1]; 2213 methodParameters[0] = settings; 2214 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleInfoTableCustom"); 2215 2216 if (customMethod != null) 2217 { 2218 @customMethod.Invoke(this, methodParameters).ToString(); 2219 } else { 2220 <h3>@Translate("Facts")</h3> 2221 <table class="table table--clean"> 2222 @foreach (var row in settings.Rows) 2223 { 2224 string iconColor = row.IconColor != null ? row.IconColor : "u-brand-color-two"; 2225 2226 <tr> 2227 @if (!String.IsNullOrEmpty(row.Icon)) 2228 { 2229 <td class="u-w32px"><i class="@row.Icon fa-2x @row.IconColor"></i></td> 2230 } 2231 <td class="u-no-margin-on-p-elements"> 2232 <div class="u-bold">@row.Title</div> 2233 @if (!String.IsNullOrEmpty(row.SubTitle)) 2234 { 2235 if (row.Link == null) 2236 { 2237 <div>@row.SubTitle</div> 2238 } 2239 else 2240 { 2241 <a href="@row.Link" class="u-color-inherit">@row.SubTitle</a> 2242 } 2243 } 2244 </td> 2245 </tr> 2246 } 2247 </table> 2248 } 2249 } 2250 @using System.Reflection 2251 @using Dynamicweb.Rapido.Blocks.Components 2252 @using Dynamicweb.Rapido.Blocks.Components.Articles 2253 @using Dynamicweb.Rapido.Blocks 2254 2255 @* Component for the articles *@ 2256 2257 @helper RenderArticleGalleryModal(ArticleGalleryModal settings) 2258 { 2259 dynamic[] methodParameters = new dynamic[1]; 2260 methodParameters[0] = settings; 2261 MethodInfo customMethod = this.GetType().GetMethod(settings.HelperName + "Custom"); 2262 2263 if (customMethod != null) 2264 { 2265 @customMethod.Invoke(this, methodParameters).ToString(); 2266 } 2267 else 2268 { 2269 <input type="checkbox" id="ParagraphGalleryTrigger" class="modal-trigger" /> 2270 <div class="modal-container"> 2271 <label for="ParagraphGalleryTrigger" id="ParagraphGalleryOverlay" class="modal-overlay"></label> 2272 <div class="modal modal--full" id="ParagraphGallery"> 2273 <div class="modal__body modal__body--full"> 2274 <img src="/Files/Images/placeholder.gif" alt="" id="ParagraphGalleryModalImage" style="margin: 0 auto;" /> 2275 <div class="u-padding u-ta-center" id="ParagraphGalleryModalCaption"></div> 2276 <label class="modal__close-btn dw-mod" for="ParagraphGalleryTrigger"></label> 2277 </div> 2278 </div> 2279 </div> 2280 <script> 2281 function showImageInModal(image) { 2282 let imageNode = document.getElementById('ParagraphGalleryModalImage'); 2283 let captionNode = document.getElementById('ParagraphGalleryModalCaption'); 2284 let trigger = document.getElementById('ParagraphGalleryTrigger'); 2285 imageNode.src = image.src; 2286 if (image.alt != "") { 2287 captionNode.innerText = image.alt; 2288 imageNode.alt = image.alt; 2289 captionNode.style.display = "block"; 2290 } else { 2291 captionNode.style.display = "none"; 2292 } 2293 trigger.checked = true; 2294 } 2295 </script> 2296 } 2297 } 2298 @using System.Reflection 2299 @using Dynamicweb.Rapido.Blocks.Components 2300 @using Dynamicweb.Rapido.Blocks.Components.Articles 2301 @using Dynamicweb.Rapido.Blocks 2302 2303 2304 @* Component for the articles *@ 2305 2306 @helper RenderArticleRelated(ArticleRelated settings) 2307 { 2308 string cardClass = Pageview.Device.ToString() != "Tablet" ? "card u-color-light--bg u-full-height" : ""; 2309 string cardFooterClass = Pageview.Device.ToString() != "Tablet" ? "card-footer u-color-light--bg" : ""; 2310 2311 <section class="multiple-paragraphs-container related-articles-container paragraph-container--full-width"> 2312 <div class="center-container dw-mod"> 2313 <div class="grid u-padding u-margin-bottom--lg"> 2314 <div class="grid__col-md-12 grid__col-xs-12 u-margin-bottom--lg"> 2315 <h2 class="article__header related-header u-no-margin u-margin-top dw-mod">@Translate("Andre relevante nyheder")</h2> 2316 </div> 2317 </div> 2318 2319 <div class="js-handlebars-root u-padding" id="@settings.Title.Replace(" ", String.Empty)" data-template="RelatedSimpleTemplate" data-json-feed="/Default.aspx?ID=@settings.FeedPageId&@settings.Query&ExcludeItemID=@settings.CurrentPageId&PageSize=@settings.PageSize"></div> 2320 2321 <script id="RelatedSimpleTemplate" type="text/x-template"> 2322 {{#.}} 2323 <div class="grid u-padding-bottom--lg"> 2324 {{#Cases}} 2325 <div class="grid__col-md-3 grid__col-12 image-hover--zoom dw-mod"> 2326 <a href="{{link}}" class="u-full-height related-articles-container"> 2327 {{#if image}} 2328 <div class="u-color-light--bg u-no-padding dw-mod"> 2329 <div class="flex-img image-hover__wrapper"> 2330 <img class="b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=680&height=314&amp;crop=1&amp;DoNotUpscale=True&amp;Compression=75&amp;image={{image}}" alt="{{title}}" /> 2331 </div> 2332 </div> 2333 {{/if}} 2334 2335 <div class="card related-articles-container article-content-container dw-mod"> 2336 <p class="article__post-info dw-mod">{{date}}</p> 2337 <h3 class="article-list__item-header u-color-dark dw-mod">{{title}}</h3> 2338 @*<p class="article__short-summary dw-mod">{{summary}}</p>*@ 2339 </div> 2340 </a> 2341 </div> 2342 {{/Cases}} 2343 </div> 2344 {{/.}} 2345 </script> 2346 </div> 2347 </section> 2348 } 2349 @using System.Reflection 2350 @using Dynamicweb.Rapido.Blocks.Components 2351 @using Dynamicweb.Rapido.Blocks.Components.Articles 2352 @using Dynamicweb.Rapido.Blocks 2353 2354 2355 @* Component for the articles *@ 2356 2357 @helper RenderArticleMenu(ArticleMenu settings) 2358 { 2359 dynamic[] methodParameters = new dynamic[1]; 2360 methodParameters[0] = settings; 2361 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleMenuCustom"); 2362 2363 if (customMethod != null) 2364 { 2365 @customMethod.Invoke(this, methodParameters).ToString(); 2366 } else { 2367 if (!String.IsNullOrEmpty(settings.Title)) { 2368 <div class="u-margin u-border-bottom"> 2369 <h3 class="u-no-margin">@settings.Title</h3> 2370 </div> 2371 } 2372 2373 <ul class="menu-left u-margin-bottom dw-mod"> 2374 @foreach (var item in settings.Items) 2375 { 2376 @RenderArticleMenuItem(item) 2377 } 2378 </ul> 2379 } 2380 } 2381 2382 @helper RenderArticleMenuItem(ArticleMenuItem settings) 2383 { 2384 dynamic[] methodParameters = new dynamic[1]; 2385 methodParameters[0] = settings; 2386 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleMenuItemCustom"); 2387 2388 if (customMethod != null) 2389 { 2390 @customMethod.Invoke(this, methodParameters).ToString(); 2391 } else { 2392 string link = !String.IsNullOrEmpty(settings.Link) ? settings.Link : "#"; 2393 2394 if (!String.IsNullOrEmpty(settings.Title)) { 2395 <li class="menu-left__item dw-mod"> 2396 <a href="@link" onclick="@settings.OnClick" class="menu-left__link dw-mod">@settings.Title</a> 2397 </li> 2398 } 2399 } 2400 } 2401 @using System.Reflection 2402 @using Dynamicweb.Rapido.Blocks.Components 2403 @using Dynamicweb.Rapido.Blocks.Components.Articles 2404 @using Dynamicweb.Rapido.Blocks 2405 2406 @* Component for the articles *@ 2407 2408 @helper RenderArticleList(ArticleList settings) 2409 { 2410 dynamic[] methodParameters = new dynamic[1]; 2411 methodParameters[0] = settings; 2412 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleListCustom"); 2413 2414 if (customMethod != null) 2415 { 2416 @customMethod.Invoke(this, methodParameters).ToString(); 2417 } else { 2418 if (Pageview != null) 2419 { 2420 bool isParagraph = Pageview.CurrentParagraph != null ? true : false; 2421 string[] sortArticlesListBy = new string[2]; 2422 2423 if (isParagraph) { 2424 sortArticlesListBy = Pageview.CurrentParagraph.Item["SortArticlesListBy"] != null && !string.IsNullOrEmpty(Pageview.CurrentParagraph.Item["SortArticlesListBy"].ToString()) ? Pageview.CurrentParagraph.Item["SortArticlesListBy"].ToString().Split('+') : new string[] { "Date", "ASC" }; 2425 } 2426 else { 2427 sortArticlesListBy = Pageview.Item["SortArticlesListBy"] != null && !string.IsNullOrEmpty(Pageview.Item["SortArticlesListBy"].ToString()) ? Pageview.Item["SortArticlesListBy"].ToString().Split('+') : new string[] { "Date", "ASC" }; 2428 } 2429 2430 string sourcePage = settings.SourcePage != null ? settings.SourcePage : Pageview.ID.ToString(); 2431 2432 @RenderItemList(new 2433 { 2434 ItemType = !String.IsNullOrEmpty(settings.ItemType) ? settings.ItemType : "DynamicArticle", 2435 ListSourceType = settings.SourceType, 2436 ListSourcePage = sourcePage, 2437 ItemFieldsList = "*", 2438 Filter = settings.Filter, 2439 ListOrderBy = sortArticlesListBy[0], 2440 ListOrderByDirection = sortArticlesListBy[1], 2441 ListSecondOrderBy = sortArticlesListBy[0] == "Date" ? "InFocusSortId" : "Date", 2442 ListSecondOrderByDirection = "ASC", 2443 IncludeAllChildItems = true, 2444 ListTemplate = settings.Template, 2445 ListPageSize = settings.PageSize.ToString() 2446 }); 2447 } 2448 } 2449 } 2450 @using System.Reflection 2451 @using Dynamicweb.Rapido.Blocks.Components.Articles 2452 2453 2454 @* Component for the articles *@ 2455 2456 @helper RenderArticleSummary(ArticleSummary settings) 2457 { 2458 dynamic[] methodParameters = new dynamic[1]; 2459 methodParameters[0] = settings; 2460 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleSummaryCustom"); 2461 2462 if (customMethod != null) 2463 { 2464 @customMethod.Invoke(this, methodParameters).ToString(); 2465 } else { 2466 if (!String.IsNullOrEmpty(settings.Text)) 2467 { 2468 <div class="article__summary dw-mod">@settings.Text</div> 2469 } 2470 } 2471 } 2472 @using System.Reflection 2473 @using Dynamicweb.Rapido.Blocks.Components 2474 @using Dynamicweb.Rapido.Blocks.Components.Articles 2475 @using Dynamicweb.Rapido.Blocks 2476 2477 @* Component for the articles *@ 2478 2479 @helper RenderArticleListCategoryFilter(ArticleListCategoryFilter settings) 2480 { 2481 dynamic[] methodParameters = new dynamic[1]; 2482 methodParameters[0] = settings; 2483 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleListCategoryFilterCustom"); 2484 2485 if (customMethod != null) 2486 { 2487 @customMethod.Invoke(this, methodParameters).ToString(); 2488 } else { 2489 string pageId = Pageview.ID.ToString(); 2490 string selectedFilter = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("sourcePage")) ? HttpContext.Current.Request.QueryString.Get("sourcePage") : Translate("All"); 2491 var query = HttpUtility.ParseQueryString(HttpContext.Current.Request.QueryString.ToString()); 2492 2493 foreach (var option in settings.Categories) 2494 { 2495 selectedFilter = selectedFilter == option.Value ? option.Key : selectedFilter; 2496 } 2497 2498 if (selectedFilter == pageId) 2499 { 2500 selectedFilter = Translate("All"); 2501 } 2502 2503 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 2504 { 2505 <div class="u-pull--right u-margin-left"> 2506 <div class="collection u-no-margin"> 2507 <h5>@Translate("Category")</h5> 2508 <input type="checkbox" id="CategorySelector" class="dropdown-trigger" /> 2509 <div class="dropdown u-w180px dw-mod"> 2510 <label class="dropdown__header dropdown__btn dw-mod" for="CategorySelector">@Translate(selectedFilter)</label> 2511 <div class="dropdown__content dw-mod"> 2512 @foreach (var option in settings.Categories) 2513 { 2514 <div class="dropdown__item" onclick="QueryArray.setParametersInCurrentURL({ sourceType: 'Page', sourcePage: '@(option.Key.ToLower() == "all" ? pageId : option.Value)' })">@Translate(option.Key)</div> 2515 } 2516 </div> 2517 <label class="dropdown-trigger-off" for="CategorySelector"></label> 2518 </div> 2519 </div> 2520 </div> 2521 } 2522 else 2523 { 2524 <div class="u-full-width u-margin-bottom"> 2525 <h5 class="u-no-margin">@Translate("Category")</h5> 2526 <input type="checkbox" id="CategorySelector" class="dropdown-trigger" /> 2527 <div class="dropdown u-full-width dw-mod"> 2528 <label class="dropdown__header dropdown__btn dw-mod" for="CategorySelector">@Translate(selectedFilter)</label> 2529 <div class="dropdown__content dw-mod"> 2530 @foreach (var option in settings.Categories) 2531 { 2532 <div class="dropdown__item" onclick="QueryArray.setParametersInCurrentURL({ sourceType: 'Page', sourcePage: '@(option.Key.ToLower() == "all" ? pageId : option.Value)' })">@Translate(option.Key)</div> 2533 } 2534 </div> 2535 <label class="dropdown-trigger-off" for="CategorySelector"></label> 2536 </div> 2537 </div> 2538 } 2539 } 2540 } 2541 @using System.Reflection 2542 @using System.Web.Mvc 2543 @using Dynamicweb.Environment 2544 @using Dynamicweb.Rapido.Blocks.Components 2545 @using Dynamicweb.Rapido.Blocks.Components.Articles 2546 @using Dynamicweb.Rapido.Blocks 2547 2548 @* Component for the articles *@ 2549 2550 @helper RenderArticleListFilter(ArticleListFilter settings) 2551 { 2552 string selectedFilter = !String.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get(settings.SystemName)) ? HttpContext.Current.Request.QueryString.Get(settings.SystemName) : Translate("All"); 2553 var query = HttpUtility.ParseQueryString(HttpContext.Current.Request.QueryString.ToString()); 2554 2555 if (settings.Options != null) 2556 { 2557 foreach (var option in settings.Options) 2558 { 2559 selectedFilter = selectedFilter == option.Value ? option.Name : selectedFilter; 2560 } 2561 2562 @*DESKTOP*@ 2563 2564 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 2565 { 2566 <div class="grid"> 2567 <div class="grid__col-12 paragraph-container customlist"> 2568 2569 <section class="grid__col-12" id="custom-facets-overall-container"> 2570 2571 <input type="checkbox" id="CheckFacetGroups" class="js-remember-state u-hidden" data-expand="CheckFacetGroups" /> 2572 <div class="grid grid--external-bleed-x facets-container facets-container--top expandable--collapsed grid--justify-center dw-mod" id="mobile-custom-facets-container" data-trigger="CheckFacetGroups"> 2573 <div class="grid__col-12"> 2574 2575 <input type="checkbox" id="OptionsGroup_{{name}}" class="expand-trigger js-remember-state mobile-facet-input" {{defaultState}} /> 2576 2577 <div class="grid__col-12 expand-container facets-container__box custom-expand-container dw-mod js-filter"> 2578 <label class="grid--justify-center expand-container__btn facets-container__header custom-btn-expand-container dw-mod" id="custom-btn-expand-container" for="OptionsGroup_{{name}}">@Translate("Filters")</label> 2579 <div class="expand-container__content custom-expand-content-container dw-mod"> 2580 <div class="facets-container__list dw-mod"> 2581 <div class="grid__col-12 grid--direction-row u-no-padding grid--wrap"> 2582 @foreach (var option in settings.Options) 2583 { 2584 2585 var currentUrl = HttpContext.Current.Request.QueryString.ToString(); 2586 2587 <div class="grid__col-lg-3 grid__col-sm-3 grid__col-xs-12 u-no-padding-y"> 2588 @if (currentUrl.Contains(settings.SystemName + "=" + option.Value)) 2589 { 2590 <input type="checkbox" class="checked checkbox-facet__checkbox form__control dw-mod" checked id="@(settings.SystemName + option.Value)" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '')" name="@(settings.SystemName + option.Value)"> 2591 2592 } 2593 2594 else 2595 { 2596 <input type="checkbox" class="checkbox-facet__checkbox form__control dw-mod" id="@(settings.SystemName + option.Value)" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '@option.Value')" name="@(settings.SystemName + option.Value)"> 2597 2598 } 2599 <label class="u-border-bottom u-padding u-no-padding-x checkbox-facet custom-checkbox-facet dw-mod" for="@(settings.SystemName + option.Value)"><span class="checkbox-facet__label custom-checkbox-facet-label dw-mod">@Translate(option.Name)</span></label> 2600 </div> 2601 2602 } 2603 </div> 2604 </div> 2605 </div> 2606 </div> 2607 </div> 2608 </div> 2609 <label for="@(settings.SystemName)Selector" class="btn btn--primary btn--full dw-mod js-expand-hide facets-container-trigger" data-trigger="CheckFacetGroups">@Translate("Select filters")</label> 2610 <label for="@(settings.SystemName)Selector" class="btn btn--primary btn--full dw-mod expandable--collapsed facets-container-trigger" data-trigger="CheckFacetGroups">@Translate("Close filters")</label> 2611 </section> 2612 </div> 2613 </div> 2614 2615 } 2616 2617 @*MOBILE*@ 2618 2619 else 2620 { 2621 <div class="grid"> 2622 <div class="grid__col-12 customlist u-no-padding"> 2623 2624 <section class="grid__col-12 u-no-padding" id="custom-facets-overall-container"> 2625 2626 @* REMEMBER TO MATCH HTML ATTRIBUTES DATA-EXPAND AND DATA-TRIGGER WITH THE GIVEN BUTTON (IN THIS SCENARIO CHECKFILTERS BUTTON FROM ARTICLECOMPONENTS.CSHTML) *@ 2627 <input type="checkbox" id="CheckFilters" class="js-remember-state u-hidden" data-expand="CheckFilters" /> 2628 <div class="grid grid--external-bleed-x facets-container facets-container--top expandable--collapsed grid--justify-center dw-mod" id="mobile-custom-facets-container" data-trigger="CheckFilters"> 2629 <div class="grid__col-12"> 2630 2631 <input type="checkbox" id="OptionsGroup_{{name}}" class="expand-trigger js-remember-state mobile-facet-input" /> 2632 2633 <div class="grid__col-12 expand-container facets-container__box custom-expand-container dw-mod js-filter"> 2634 <label class="grid--justify-center expand-container__btn facets-container__header custom-btn-expand-container dw-mod" id="custom-btn-expand-container" for="OptionsGroup_{{name}}">@Translate("Filters")</label> 2635 <div class="expand-container__content custom-expand-content-container dw-mod"> 2636 <div class="facets-container__list dw-mod"> 2637 <div class="grid__col-12 grid--direction-row u-no-padding grid--wrap"> 2638 @foreach (var option in settings.Options) 2639 { 2640 2641 var currentUrl = HttpContext.Current.Request.QueryString.ToString(); 2642 2643 <div class="grid__col-lg-3 grid__col-sm-4 grid__col-xs-12 u-no-padding-y"> 2644 @if (currentUrl.Contains(settings.SystemName + "=" + option.Value)) 2645 { 2646 <input type="checkbox" class="checked checkbox-facet__checkbox form__control dw-mod" checked id="@(settings.SystemName + option.Value)" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '')" name="@(settings.SystemName + option.Value)"> 2647 2648 } 2649 2650 else 2651 { 2652 <input type="checkbox" class="checkbox-facet__checkbox form__control dw-mod" id="@(settings.SystemName + option.Value)" onclick="QueryArray.setParameterInCurrentURL('@settings.SystemName', '@option.Value')" name="@(settings.SystemName + option.Value)"> 2653 2654 } 2655 <label class="u-border-bottom u-padding u-no-padding-x checkbox-facet custom-checkbox-facet dw-mod" for="@(settings.SystemName + option.Value)"><span class="checkbox-facet__label custom-checkbox-facet-label dw-mod">@Translate(option.Name)</span></label> 2656 </div> 2657 2658 } 2659 </div> 2660 </div> 2661 </div> 2662 </div> 2663 </div> 2664 </div> 2665 2666 </section> 2667 </div> 2668 </div> 2669 2670 } 2671 } 2672 } 2673 @using System.Reflection 2674 @using Dynamicweb.Rapido.Blocks.Components 2675 @using Dynamicweb.Rapido.Blocks.Components.Articles 2676 @using Dynamicweb.Rapido.Blocks 2677 2678 @* Component for the articles *@ 2679 2680 @helper RenderArticleListSearch(ArticleListSearch settings) 2681 { 2682 dynamic[] methodParameters = new dynamic[1]; 2683 methodParameters[0] = settings; 2684 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleListSearchCustom"); 2685 2686 if (customMethod != null) 2687 { 2688 @customMethod.Invoke(this, methodParameters).ToString(); 2689 } else { 2690 string searchString = !string.IsNullOrEmpty(HttpContext.Current.Request.QueryString.Get("Title")) ? HttpContext.Current.Request.QueryString.Get("Title").Trim('*') : ""; 2691 string className = "u-w340px u-pull--right u-margin-left"; 2692 2693 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 2694 { 2695 className = "u-full-width"; 2696 } 2697 2698 <div class="typeahead u-color-inherit u-margin-bottom dw-mod @className"> 2699 <input type="text" class="typeahead-search-field u-no-margin dw-mod" placeholder="@Translate("Search in list")" value="@searchString" id="ArticleListSearchInput" onchange="QueryArray.setParameterInCurrentURL('Title', '*' + document.getElementById('ArticleListSearchInput').value + '*')"> 2700 <button type="button" class="btn btn--condensed btn--primary u-no-margin dw-mod"><i class="fas fa-search"></i></button> 2701 </div> 2702 } 2703 } 2704 @using System.Reflection 2705 @using Dynamicweb.Rapido.Blocks.Components 2706 @using Dynamicweb.Rapido.Blocks.Components.Articles 2707 @using Dynamicweb.Rapido.Blocks 2708 2709 @* Component for the articles *@ 2710 2711 @helper RenderArticleListNoResultsInfo(ArticleListNoResultsInfo settings) 2712 { 2713 dynamic[] methodParameters = new dynamic[1]; 2714 methodParameters[0] = settings; 2715 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleListNoResultsInfoCustom"); 2716 2717 if (customMethod != null) 2718 { 2719 @customMethod.Invoke(this, methodParameters).ToString(); 2720 } else { 2721 <div class="u-margin-top--lg u-bold u-ta-center u-bold">@Translate(settings.Message)</div> 2722 } 2723 } 2724 2725 @using System.Reflection 2726 @using Dynamicweb.Rapido.Blocks.Components 2727 @using Dynamicweb.Rapido.Blocks.Components.General 2728 @using Dynamicweb.Rapido.Blocks.Components.Articles 2729 @using Dynamicweb.Rapido.Blocks 2730 @using System.Text.RegularExpressions 2731 @using S_DW_HD2412.CustomCode 2732 2733 @* Component for the articles *@ 2734 2735 @helper RenderArticleListItem(ArticleListItemExtended settings) 2736 { 2737 switch (settings.Type) { 2738 case ArticleListItemType.Card: 2739 @RenderArticleListItemCard(settings); 2740 break; 2741 case ArticleListItemType.List: 2742 @RenderArticleListItemList(settings); 2743 break; 2744 case ArticleListItemType.Simple: 2745 @RenderArticleListItemSimple(settings); 2746 break; 2747 default: 2748 @RenderArticleListItemCard(settings); 2749 break; 2750 } 2751 } 2752 2753 @helper RenderArticleListItemExtended(ArticleListItemExtended settings) 2754 { 2755 switch (settings.Type) { 2756 case ArticleListItemType.Card: 2757 @RenderArticleListItemCard(settings); 2758 break; 2759 case ArticleListItemType.List: 2760 @RenderArticleListItemList(settings); 2761 break; 2762 case ArticleListItemType.Simple: 2763 @RenderArticleListItemSimple(settings); 2764 break; 2765 default: 2766 @RenderArticleListItemCard(settings); 2767 break; 2768 } 2769 } 2770 2771 @helper RenderArticleListItemCard(ArticleListItemExtended settings) { 2772 string filters = HttpContext.Current.Request["filter"]; 2773 2774 if (!string.IsNullOrEmpty(filters)) 2775 { 2776 string[] filterEntries = filters.Split(','); 2777 2778 string itemTags = settings.Tag; 2779 if (string.IsNullOrEmpty(itemTags)) 2780 { 2781 return; 2782 } 2783 else 2784 { 2785 bool anyMatch = itemTags.Split(',').Any(tag => filterEntries.Contains(tag)); 2786 if (!anyMatch) 2787 { 2788 return; 2789 } 2790 } 2791 } 2792 <a href="@settings.Link" class="u-full-height u-color-light--bg"> 2793 <div class="u-color-light--bg u-no-padding dw-mod"> 2794 @if (settings.Logo != null) 2795 { 2796 string backgroundImage = settings.Image != null ? "background-image:url(/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=True&amp;image=" + settings.Image.Path + "); background-size: cover;" : ""; 2797 settings.Logo.ImageDefault.Crop = 5; 2798 settings.Logo.ImageDefault.Width = settings.Logo.ImageDefault.Width == 1920 ? 240 : settings.Logo.ImageDefault.Width; 2799 settings.Logo.ImageDefault.Height = settings.Logo.ImageDefault.Height == 1080 ? 200 : settings.Logo.ImageDefault.Height; 2800 <div class="image-hover__wrapper layered-image layered-image--tinted dw-mod" style="@backgroundImage"> 2801 @if (settings.Stickers != null) 2802 { 2803 if (settings.Stickers.Position != StickersListPosition.Custom) 2804 { 2805 @RenderStickersCollection(settings.Stickers); 2806 } 2807 } 2808 @RenderImage(settings.Logo) 2809 </div> 2810 } 2811 else if (settings.Image != null) 2812 { 2813 <div class="flex-img image-hover__wrapper u-position-relative dw-mod"> 2814 @if (settings.Stickers != null) 2815 { 2816 if (settings.Stickers.Position != StickersListPosition.Custom) 2817 { 2818 @RenderStickersCollection(settings.Stickers); 2819 } 2820 } 2821 @RenderImage(settings.Image) 2822 </div> 2823 } 2824 </div> 2825 2826 @if (!String.IsNullOrEmpty(settings.Title) || !String.IsNullOrEmpty(settings.Summary)) 2827 { 2828 2829 <div class="paragraph-card u-color-light--bg dw-mod"> 2830 2831 2832 @if (settings.Stickers != null) 2833 { 2834 if (settings.Stickers.Position == StickersListPosition.Custom) 2835 { 2836 @RenderStickersCollection(settings.Stickers) 2837 ; 2838 } 2839 } 2840 @if (!String.IsNullOrEmpty(settings.Title)) 2841 { 2842 <h3 class="article-list__item-header u-truncate-text dw-mod">@settings.Title</h3> 2843 2844 } 2845 @if (!String.IsNullOrEmpty(settings.Date)) 2846 { 2847 <div class="d-flex justify-content-between align-items-center" style="margin-top: 10px;"> 2848 <div class="article__post-info dw-mod" style="margin-top:0;">@DateTime.Parse(settings.Date).ToString("dd-MM-yyyy")</div> 2849 @if (!String.IsNullOrEmpty(settings.Tag)) 2850 { 2851 <div> 2852 @foreach (string tag in settings.Tag.Split(',')) 2853 { 2854 <span class="tag-badge">@(Translate($"Tag Badge - {tag}", tag))</span> 2855 } 2856 </div> 2857 2858 } 2859 2860 </div> 2861 2862 } 2863 @if (!String.IsNullOrEmpty(settings.SubTitle)) 2864 { 2865 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 2866 } 2867 @if (!String.IsNullOrEmpty(settings.Summary)) 2868 { 2869 <p class="article__short-summary dw-mod">@settings.Summary</p> 2870 } 2871 <a href="@settings.Link" class="search-result__name search"> 2872 @Translate("Read more") 2873 </a> 2874 </div> 2875 } 2876 </a> 2877 } 2878 2879 @helper RenderArticleListItemList(ArticleListItemExtended settings) { 2880 <a href="@settings.Link"> 2881 <div class="grid u-color-light--bg u-no-padding dw-mod"> 2882 <div class="grid__col-md-3"> 2883 <div class="u-color-light--bg u-no-padding dw-mod"> 2884 @if (settings.Logo != null) 2885 { 2886 string backgroundImage = settings.Image != null ? "background-image:url(/Admin/Public/GetImage.ashx?width=992&amp;height=760&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=True&amp;image=" + settings.Image.Path + "); background-size: cover;" : ""; 2887 settings.Logo.ImageDefault.Crop = 5; 2888 settings.Logo.ImageDefault.Width = settings.Logo.ImageDefault.Width == 1920 ? 240 : settings.Logo.ImageDefault.Width; 2889 settings.Logo.ImageDefault.Height = settings.Logo.ImageDefault.Height == 1080 ? 200 : settings.Logo.ImageDefault.Height; 2890 <div class="image-hover__wrapper layered-image layered-image--tinted dw-mod" style="@backgroundImage"> 2891 @if (settings.Stickers != null) 2892 { 2893 if (settings.Stickers.Position != StickersListPosition.Custom) 2894 { 2895 @RenderStickersCollection(settings.Stickers); 2896 } 2897 } 2898 @RenderImage(settings.Logo) 2899 </div> 2900 } else if (settings.Image != null) 2901 { 2902 <div class="flex-img image-hover__wrapper dw-mod"> 2903 @if (settings.Stickers != null) 2904 { 2905 if (settings.Stickers.Position != StickersListPosition.Custom) 2906 { 2907 @RenderStickersCollection(settings.Stickers); 2908 } 2909 } 2910 @RenderImage(settings.Image) 2911 </div> 2912 } 2913 </div> 2914 </div> 2915 2916 @if (!String.IsNullOrEmpty(settings.Title) || !String.IsNullOrEmpty(settings.Summary)) 2917 { 2918 <div class="grid__col-md-9"> 2919 @if (!String.IsNullOrEmpty(settings.Title)) 2920 { 2921 <h3 class="article-list__item-header u-truncate-text dw-mod">@settings.Title</h3> 2922 } 2923 @if (settings.Stickers != null) 2924 { 2925 if (settings.Stickers.Position == StickersListPosition.Custom) 2926 { 2927 @RenderStickersCollection(settings.Stickers); 2928 } 2929 } 2930 @if (!String.IsNullOrEmpty(settings.SubTitle)) 2931 { 2932 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 2933 } 2934 @if (!String.IsNullOrEmpty(settings.Summary)) 2935 { 2936 <p class="article__short-summary dw-mod">@settings.Summary</p> 2937 } 2938 </div> 2939 } 2940 </div> 2941 </a> 2942 } 2943 2944 @helper RenderArticleListItemSimple(ArticleListItemExtended settings) { 2945 <a href="@settings.Link" class="u-color-inherit"> 2946 <div class="grid u-color-light--bg u-no-padding dw-mod"> 2947 <div class="grid__col-md-12"> 2948 @if (!String.IsNullOrEmpty(settings.Title)) 2949 { 2950 <section class="grid__col-12 grid--justify-center"> 2951 @*<h2 class="search-headline-the-one"> 2952 @settings.Title 2953 </h2>*@ 2954 </section> 2955 2956 } 2957 @if (!String.IsNullOrEmpty(settings.SubTitle)) 2958 { 2959 <div class="article-list__item-micro-info u-truncate-text dw-mod">@settings.SubTitle</div> 2960 } 2961 </div> 2962 </div> 2963 </a> 2964 } 2965 @using System.Reflection 2966 @using Dynamicweb.Rapido.Blocks.Components.Articles 2967 2968 2969 @* Component for the articles *@ 2970 2971 @helper RenderArticleAuthorAndDate(ArticleAuthorAndDate settings) 2972 { 2973 dynamic[] methodParameters = new dynamic[1]; 2974 methodParameters[0] = settings; 2975 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleAuthorAndDateCustom"); 2976 if (customMethod != null) 2977 { 2978 @customMethod.Invoke(this, methodParameters).ToString(); 2979 } else { 2980 <small class="article__subscription"> 2981 @if (!(string.IsNullOrWhiteSpace(settings.Author) && string.IsNullOrWhiteSpace(settings.Date))) 2982 { 2983 <text>@Translate("Written")</text> 2984 } 2985 @if (!string.IsNullOrWhiteSpace(settings.Author)) 2986 { 2987 <text>@Translate("by") @settings.Author</text> 2988 } 2989 @if (!string.IsNullOrWhiteSpace(settings.Date)) 2990 { 2991 <text>@Translate("on") @settings.Date</text> 2992 } 2993 </small> 2994 } 2995 } 2996 @using System.Reflection 2997 @using Dynamicweb.Rapido.Blocks.Components.Articles 2998 2999 3000 @* Component for the articles *@ 3001 3002 @helper RenderArticleLink(ArticleLink settings) 3003 { 3004 dynamic[] methodParameters = new dynamic[1]; 3005 methodParameters[0] = settings; 3006 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleLinkCustom"); 3007 3008 if (customMethod != null) 3009 { 3010 @customMethod.Invoke(this, methodParameters).ToString(); 3011 } else { 3012 if (!String.IsNullOrEmpty(settings.Title)) 3013 { 3014 <div class="grid__cell"> 3015 @RenderButton(settings) 3016 </div> 3017 } 3018 } 3019 } 3020 @using System.Reflection 3021 @using Dynamicweb.Rapido.Blocks 3022 @using Dynamicweb.Rapido.Blocks.Components.Articles 3023 @using Dynamicweb.Rapido.Blocks.Components.General 3024 3025 3026 @* Component for the articles *@ 3027 3028 @helper RenderArticleCarousel(ArticleCarousel settings) 3029 { 3030 dynamic[] methodParameters = new dynamic[1]; 3031 methodParameters[0] = settings; 3032 MethodInfo customMethod = this.GetType().GetMethod(settings.HelperName + "Custom"); 3033 3034 if (customMethod != null) 3035 { 3036 @customMethod.Invoke(this, methodParameters).ToString(); 3037 } else { 3038 <div class="grid"> 3039 <div class="grid__col-12"> 3040 <div class="carousel" id="carousel_@settings.Id"> 3041 <div class="carousel__container js-carousel-slides dw-mod"> 3042 @RenderBlockList(settings.SubBlocks) 3043 </div> 3044 </div> 3045 </div> 3046 </div> 3047 3048 <script> 3049 document.addEventListener("DOMContentLoaded", function () { 3050 new CarouselModule("#carousel_@settings.Id", { 3051 slideTime: 0, 3052 dots: true 3053 }); 3054 }); 3055 </script> 3056 } 3057 } 3058 3059 @helper RenderArticleCarouselSlide(ArticleCarouselSlide settings) 3060 { 3061 dynamic[] methodParameters = new dynamic[1]; 3062 methodParameters[0] = settings; 3063 MethodInfo customMethod = this.GetType().GetMethod(settings.HelperName + "Custom"); 3064 3065 if (customMethod != null) 3066 { 3067 @customMethod.Invoke(this, methodParameters).ToString(); 3068 } 3069 else 3070 { 3071 string imageEngine = "/Admin/Public/GetImage.ashx?"; 3072 3073 string defaultImage = settings.ImageSettings != null ? imageEngine : settings.Image; 3074 if (settings.ImageSettings != null) 3075 { 3076 defaultImage += settings.ImageSettings.Width != 0 ? "Width=" + settings.ImageSettings.Width + "&" : ""; 3077 defaultImage += settings.ImageSettings.Height != 0 ? "Height=" + settings.ImageSettings.Height + "&" : ""; 3078 defaultImage += "Crop=" + settings.ImageSettings.Crop + "&"; 3079 defaultImage += "Compression=" + settings.ImageSettings.Compression + "&"; 3080 defaultImage += "DoNotUpscale=" + settings.ImageSettings.DoNotUpscale.ToString() + "&"; 3081 defaultImage += "FillCanvas=" + settings.ImageSettings.FillCanvas.ToString() + "&"; 3082 } 3083 defaultImage += "&Image=" + settings.Image; 3084 3085 <div class="carousel__slide u-min-h300px u-flex dw-mod" style="background-size:cover; background-image:url('@defaultImage')"> 3086 <a class="article-carousel-item__wrap" href="@settings.Link" title="@settings.Title"> 3087 <h2 class="article-list__item-header u-truncate-text u-color-light dw-mod">@settings.Title</h2> 3088 <div class="article-list__item-info"> 3089 @if (settings.Stickers != null) 3090 { 3091 settings.Stickers.Position = StickersListPosition.Custom; 3092 @RenderStickersCollection(settings.Stickers); 3093 } 3094 3095 <small class="u-margin-top--lg u-color-light"> 3096 @if (!(string.IsNullOrWhiteSpace(settings.Author) && string.IsNullOrWhiteSpace(settings.Date))) 3097 { 3098 <text>@Translate("Written")</text> 3099 } 3100 @if (!string.IsNullOrWhiteSpace(settings.Author)) 3101 { 3102 <text>@Translate("by") @settings.Author</text> 3103 } 3104 @if (!string.IsNullOrWhiteSpace(settings.Date)) 3105 { 3106 <text>@Translate("on") @settings.Date</text> 3107 } 3108 </small> 3109 </div> 3110 3111 <h3 class="article__short-summary u-color-light">@settings.Summary</h3> 3112 </a> 3113 @if (settings.UseFilters == true) 3114 { 3115 <div class="background-image image-filter image-filter--darken dw-mod"></div> 3116 } 3117 </div> 3118 } 3119 } 3120 @using System.Text.RegularExpressions 3121 @using Dynamicweb.Rapido.Blocks.Components 3122 @using Dynamicweb.Rapido.Blocks.Components.General 3123 @using Dynamicweb.Rapido.Blocks.Components.Articles 3124 @using Dynamicweb.Rapido.Blocks 3125 3126 @* Component for the articles *@ 3127 3128 @helper RenderArticleVideo(ArticleVideo settings) 3129 { 3130 dynamic[] methodParameters = new dynamic[1]; 3131 methodParameters[0] = settings; 3132 MethodInfo customMethod = this.GetType().GetMethod("RenderArticleTextCustom"); 3133 3134 if (customMethod != null) 3135 { 3136 @customMethod.Invoke(this, methodParameters).ToString(); 3137 } else { 3138 if (settings.Url != null) 3139 { 3140 //getting video ID from youtube URL 3141 string videoCode = settings.Url; 3142 Regex regex = new Regex(@".be\/(.[^?]*)"); 3143 Match match = regex.Match(videoCode); 3144 string videoId = ""; 3145 if (match.Success) 3146 { 3147 videoId = match.Groups[1].Value; 3148 } 3149 else 3150 { 3151 regex = new Regex(@"v=([^&]+)"); 3152 match = regex.Match(videoCode); 3153 if (match.Success) 3154 { 3155 videoId = match.Groups[1].Value; 3156 } 3157 } 3158 3159 int autoPlay = settings.AutoPlay == "true" ? 1 : 0; 3160 3161 <div class="video-wrapper"> 3162 <div class="js-youtube-video" data-video="@videoId" id="ytPlayer@(Guid.NewGuid().ToString("N"))" data-auto-play="@autoPlay" data-enable-controls="1"></div> 3163 </div> 3164 } 3165 } 3166 } 3167 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3168 @using System.Reflection 3169 @using Dynamicweb.Rapido.Blocks.Components 3170 @using Dynamicweb.Rapido.Blocks.Components.General 3171 @using Dynamicweb.Rapido.Blocks.Components.Articles 3172 @using Dynamicweb.Rapido.Blocks 3173 @using S_DW_HD2412.CustomCode 3174 3175 3176 3177 @helper RenderSocialShare() 3178 { 3179 string siteURL = Pageview.SearchFriendlyUrl.ToString(); 3180 3181 <section class="socialshare grid__col-md-12 grid__col--bleed grid-custom-layout grid--justify-center u-padding--lg dw-mod"> 3182 <div class="socialheader grid__col-md-12 u-no-padding u-border-bottom"> 3183 <h3>@Translate("ShareThis")</h3> 3184 </div> 3185 <div class="sociallinks grid__col-md-12 u-no-padding"> 3186 <div class="social-container"> 3187 <div class="links"> 3188 <div class="icon-nz-nz-facebook links-share" data-sharer="facebook" data-url="@siteURL"></div> 3189 <div class="linkedin icon-nz-nz-linkedin links-share" data-sharer="linkedin" data-url="@siteURL"></div> 3190 <div data-icon-nz="nz-link" class="js-geturl icon-nz-nz-link links-share" aria-label="Copy link"> 3191 <div class="links-input js-show-hide"> 3192 <input class="js-urlCopied"> 3193 </div> 3194 </div> 3195 </div> 3196 </div> 3197 </div> 3198 </section> 3199 } 3200 3201 3202 @* Simple helpers *@ 3203 3204 @*Requires the Gallery ItemType that comes with Rapido*@ 3205 @helper RenderArticleItemGallery(IList<ItemViewModel> gallery) 3206 { 3207 string placeHolderImage = "/Files/Images/placeholder.gif"; 3208 3209 <main class="wrapper grid grid--direction-row"> 3210 <section class="gallery grid__col-lg-9 grid__col-sm-12"> 3211 <div class="swiper-container gallery-top"> 3212 <div class="swiper-wrapper"> 3213 @if (gallery != null && gallery.Count > 0) 3214 { 3215 int count = 1; 3216 3217 foreach (var item in gallery) 3218 { 3219 if (item.GetFile("ImagePath") != null) 3220 { 3221 string focalPointParameters = item.GetFile("ImagePath") != null ? "&" + item.GetFile("ImagePath").GetFocalPointParameters() : ""; 3222 3223 string image = item.GetFile("ImagePath").PathUrlEncoded + focalPointParameters; 3224 int imagesCount = gallery.Count; 3225 string text = item.GetString("Text"); 3226 3227 <div class="swiper-slide b-lazy" src="@placeHolderImage" data-src="/Admin/Public/GetImage.ashx?width=1024&amp;height=583&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=1&amp;image=@image" alt="@text"> 3228 <div class="swiper-text">@text</div> 3229 </div> 3230 3231 count++; 3232 } 3233 } 3234 } 3235 </div> 3236 <div class="swiper-button-next swiper-button-white"></div> 3237 <div class="swiper-button-prev swiper-button-white"></div> 3238 </div> 3239 </section> 3240 @if (gallery != null && gallery.Count > 0) 3241 { 3242 <section class="thumbs grid__col-lg-3 grid__col-sm-12"> 3243 <div class="swiper-container gallery-thumbs"> 3244 <div class="swiper-wrapper"> 3245 @{ 3246 int count = 1; 3247 } 3248 3249 @foreach (var item in gallery) 3250 { 3251 if (item.GetFile("ImagePath") != null) 3252 { 3253 string focalPointParameters = item.GetFile("ImagePath") != null ? "&" + item.GetFile("ImagePath").GetFocalPointParameters() : ""; 3254 3255 string image = item.GetFile("ImagePath").PathUrlEncoded + focalPointParameters; 3256 int imagesCount = gallery.Count; 3257 string text = item.GetString("Text"); 3258 3259 <img class="swiper-slide" src="/Admin/Public/GetImage.ashx?width=450&amp;height=247&amp;crop=0&amp;Compression=75&amp;DoNotUpscale=1&amp;image=@image" alt="@text" /> 3260 3261 count++; 3262 } 3263 } 3264 </div> 3265 </div> 3266 </section> 3267 } 3268 </main> 3269 3270 } 3271 3272 @helper RenderArticleItemGalleryModal() 3273 { 3274 <!-- Trigger for the gallery modal --> 3275 <input type="checkbox" id="GalleryModalTrigger" class="modal-trigger" /> 3276 3277 <!-- Gallery modal --> 3278 <div class="modal-container"> 3279 <label for="GalleryModalTrigger" id="GalleryModalOverlay" class="modal-overlay"></label> 3280 <div class="modal modal--full" id="GalleryModal"> 3281 <div class="modal__body modal__body--full"> 3282 <div class="gallery-slider"> 3283 <div class="gallery-slider__image"> 3284 <img src="#" alt="" class="modal--full__img" id="FullImage" /> 3285 </div> 3286 <div class="gallery-slider__image-counter" id="FullImage_counter"></div> 3287 <label class="gallery-slider__close-btn" for="GalleryModalTrigger"></label> 3288 <button class="gallery-slider__previous-btn" id="FullImage_prev" onclick="Gallery.prevImage('FullImage')"></button> 3289 <button class="gallery-slider__next-btn" id="FullImage_next" onclick="Gallery.nextImage('FullImage')"></button> 3290 </div> 3291 </div> 3292 </div> 3293 </div> 3294 } 3295 3296 3297 @helper RenderMobileFilters(List<Block> settings) 3298 { 3299 if (settings.Count > 0) 3300 { 3301 <div class="grid__col-12"> 3302 <input type="checkbox" id="CheckFilters" class="js-remember-state u-hidden" data-expand="CheckFilters" /> 3303 <div class="grid u-margin-bottom dw-mod" data-trigger="CheckFilters"> 3304 @RenderBlockList(settings) 3305 </div> 3306 @*<label for="CheckFilters" class="btn btn--primary btn--full dw-mod js-expand-hide" data-trigger="CheckFilters">@Translate("Select filters")</label> 3307 <label for="CheckFilters" class="btn btn--primary btn--full dw-mod expandable--collapsed" data-trigger="CheckFilters">@Translate("Close filters")</label>*@ 3308 </div> 3309 } 3310 } 3311 3312 3313 3314 @if (File.Exists(HttpContext.Current.Server.MapPath("/Components/Custom/Custom__Components.cshtml"))) 3315 { 3316 <text>@using Dynamicweb.Rapido.Blocks.Components.General 3317 </text> 3318 } 3319 3320 @* Include the Blocks for the page *@ 3321 @*@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3322 3323 @using System 3324 @using System.Web 3325 @using System.Collections.Generic 3326 @using Dynamicweb.Rapido.Blocks.Extensibility 3327 @using Dynamicweb.Rapido.Blocks 3328 3329 @{ 3330 BlocksPage topSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 3331 3332 Block tagManager = new Block() 3333 { 3334 Id = "TagManager", 3335 SortId = 1, 3336 Template = RenderGoogleTagManager() 3337 }; 3338 3339 Block facebookPixel = new Block() 3340 { 3341 Id = "FacebookPixel", 3342 SortId = 2, 3343 Template = RenderFacebookPixel() 3344 }; 3345 3346 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, tagManager); 3347 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, facebookPixel); 3348 } 3349 3350 @helper RenderGoogleTagManager() { 3351 string GoogleTagManagerID = Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID"); 3352 3353 if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 3354 { 3355 <script> 3356 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 3357 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 3358 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 3359 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 3360 })(window,document,'script','dataLayer','@GoogleTagManagerID'); 3361 </script> 3362 <!-- Google Tag Manager (noscript) --> 3363 <noscript> 3364 <iframe src="https://www.googletagmanager.com/ns.html?id=@GoogleTagManagerID" 3365 height="0" width="0" style="display:none;visibility:hidden"></iframe> 3366 </noscript> 3367 <!-- End Google Tag Manager (noscript) --> 3368 } 3369 } 3370 3371 @helper RenderFacebookPixel() { 3372 string FacebookPixelID = Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID"); 3373 3374 if (!string.IsNullOrWhiteSpace(FacebookPixelID)) 3375 { 3376 <!-- Facebook Pixel Code --> 3377 <script> 3378 !function(f,b,e,v,n,t,s) 3379 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 3380 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 3381 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 3382 n.queue=[];t=b.createElement(e);t.async=!0; 3383 t.src=v;s=b.getElementsByTagName(e)[0]; 3384 s.parentNode.insertBefore(t,s)}(window, document,'script', 3385 'https://connect.facebook.net/en_US/fbevents.js'); 3386 fbq('init', '@FacebookPixelID'); 3387 fbq('track', 'PageView'); 3388 </script> 3389 <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=@FacebookPixelID&ev=PageView&noscript=1" alt="" /></noscript> 3390 } 3391 } *@ 3392 3393 @if (!Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn")) { 3394 <text> 3395 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3396 3397 @using System 3398 @using System.Web 3399 @using System.Collections.Generic 3400 @using Dynamicweb.Rapido.Blocks 3401 @using Dynamicweb.Rapido.Blocks.Extensibility 3402 @using Dynamicweb.Security.UserManagement 3403 @using Dynamicweb.Security.UserManagement.ExternalAuthentication 3404 @{ 3405 BlocksPage loginBlocksPage = BlocksPage.GetBlockPage("Master"); 3406 3407 Block loginModal = new Block() 3408 { 3409 Id = "LoginModal", 3410 SortId = 10, 3411 Template = LoginModal() 3412 }; 3413 3414 loginBlocksPage.Add(MasterBlockId.MasterTopSnippets, loginModal); 3415 } 3416 3417 @helper LoginModal() { 3418 int pageId = Model.TopPage.ID; 3419 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 3420 string userSignedInErrorText = ""; 3421 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 3422 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 3423 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 3424 3425 if (Model.LogOnFailed) { 3426 switch (Model.LogOnFailedReason) 3427 { 3428 case LogOnFailedReason.PasswordLengthInvalid: 3429 userSignedInErrorText = Translate("Password length is invalid"); 3430 break; 3431 case LogOnFailedReason.IncorrectLogin: 3432 userSignedInErrorText = Translate("Invalid email or password"); 3433 break; 3434 case LogOnFailedReason.ExceededFailedLogOnLimit: 3435 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 3436 break; 3437 case LogOnFailedReason.LoginLocked: 3438 userSignedInErrorText = Translate("The user account is temporarily locked"); 3439 break; 3440 case LogOnFailedReason.PasswordExpired: 3441 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 3442 break; 3443 default: 3444 userSignedInErrorText = Translate("An unknown error occured"); 3445 break; 3446 } 3447 } 3448 3449 <!-- Trigger for the login modal --> 3450 <input type="checkbox" id="SignInModalTrigger" class="modal-trigger" @userSignedInError /> 3451 3452 <!-- Login modal --> 3453 <div class="modal-container"> 3454 <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> 3455 <div class="modal modal--xs" id="SignInModal"> 3456 <div class="modal__header"> 3457 <div class="heading h2">@Translate("Sign in")</div> 3458 </div> 3459 <div class="modal__body"> 3460 <form method="post" id="LoginForm" class="u-no-margin"> 3461 <input type="hidden" name="ID" value="@pageId" /> 3462 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 3463 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 3464 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 3465 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 3466 <div class="field-error dw-mod">@userSignedInErrorText</div> 3467 3468 <div class="form__field-group dw-mod"> 3469 <input type="checkbox" id="LoginRememberMe" name="Autologin" checked="checked" value="True" class="form__control"> 3470 <label for="LoginRememberMe"> 3471 @Translate("Remember me", "Remember me") 3472 </label> 3473 </div> 3474 3475 <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> 3476 @{ 3477 ProviderCollection providers = Provider.GetActiveProviders(); 3478 } 3479 3480 @foreach(Provider LoginProvider in providers) 3481 { 3482 var ProviderName = LoginProvider.Name.ToLower(); 3483 <a href="/Admin/Public/Social/ExternalLogin.aspx?action=login&providerID=@LoginProvider.ID" title="@LoginProvider.Name" class="btn btn--clean btn--condensed u-color-@ProviderName dw-mod"><i class="fab fa-@ProviderName fa-1_5x"></i></a> 3484 } 3485 3486 <a class="btn btn--link-clean dw-mod" href="@forgotPasswordPageLink">@Translate("Forgot your password?", "Forgot your password?")</a> 3487 3488 <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> 3489 </form> 3490 </div> 3491 </div> 3492 </div> 3493 } 3494 </text> 3495 } 3496 3497 @{ 3498 string headerTemplate = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("HeaderTemplate"); 3499 } 3500 3501 @if ( headerTemplate != "no-header") 3502 { 3503 if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 3504 { 3505 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3506 3507 @using System 3508 @using System.Web 3509 @using System.Collections.Generic 3510 @using Dynamicweb.Rapido.Blocks.Extensibility 3511 @using Dynamicweb.Rapido.Blocks 3512 @using Dynamicweb.Frontend.Devices 3513 @using Dynamicweb.Extensibility 3514 @using Dynamicweb.Content 3515 @using Dynamicweb.Core 3516 @using System 3517 @using System.IO 3518 @using System.Web 3519 @using System.Collections.Generic; 3520 @using System.Linq 3521 @using System.Text.RegularExpressions 3522 @using Dynamicweb.Admin.dk.dynamicweb.templates 3523 @using Dynamicweb.Ecommerce.Frontend 3524 @using Dynamicweb.Rapido.Blocks 3525 @using Dynamicweb.Rendering 3526 3527 @functions { 3528 BlocksPage mobileHeaderBlocksPage = BlocksPage.GetBlockPage("Master"); 3529 3530 public class SearchConfiguration 3531 { 3532 public string searchFeedId { get; set; } 3533 public string searchSecondFeedId { get; set; } 3534 public int groupsFeedId { get; set; } 3535 public string resultPageLink { get; set; } 3536 public string searchPlaceholder { get; set; } 3537 public string searchType { get; set; } 3538 public string searchTemplate { get; set; } 3539 public string searchContentTemplate { get; set; } 3540 public string searchValue { get; set; } 3541 public bool showGroups { get; set; } 3542 3543 public SearchConfiguration() 3544 { 3545 searchFeedId = ""; 3546 searchSecondFeedId = ""; 3547 searchType = "product-search"; 3548 searchContentTemplate = ""; 3549 showGroups = true; 3550 } 3551 } 3552 } 3553 3554 @{ 3555 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"; 3556 bool hideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 3557 bool hideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 3558 bool hideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 3559 3560 3561 Block mobileHeader = new Block() 3562 { 3563 Id = "MobileTop", 3564 SortId = 10, 3565 Template = RenderMobileTop(), 3566 SkipRenderBlocksList = true 3567 }; 3568 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeader); 3569 3570 Block mobileHeaderNavigation = new Block() 3571 { 3572 Id = "MobileHeaderNavigation", 3573 SortId = 10, 3574 Template = RenderMobileHeaderNavigation(), 3575 SkipRenderBlocksList = true, 3576 BlocksList = new List<Block> { 3577 new Block { 3578 Id = "MobileHeaderNavigationTrigger", 3579 SortId = 10, 3580 Template = RenderMobileHeaderNavigationTrigger() 3581 } 3582 } 3583 }; 3584 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderNavigation); 3585 3586 3587 Block mobileHeaderLogo = new Block() 3588 { 3589 Id = "MobileHeaderLogo", 3590 SortId = 20, 3591 Template = RenderMobileHeaderLogo(), 3592 SkipRenderBlocksList = true 3593 }; 3594 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderLogo); 3595 3596 Block mobileHeaderActions = new Block() 3597 { 3598 Id = "MobileHeaderActions", 3599 SortId = 30, 3600 Template = RenderMobileTopActions(), 3601 SkipRenderBlocksList = true 3602 }; 3603 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderActions); 3604 3605 if (hideSearch == false) 3606 { 3607 Block mobileHeaderSearch = new Block 3608 { 3609 Id = "MobileHeaderSearch", 3610 SortId = 10, 3611 Template = RenderMobileTopSearch() 3612 }; 3613 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderSearch); 3614 } 3615 3616 Block mobileHeaderMiniCart; 3617 3618 if (!hideCart) 3619 { 3620 mobileHeaderMiniCart = new Block 3621 { 3622 Id = "MobileHeaderMiniCart", 3623 SortId = 20, 3624 Template = RenderMobileTopMiniCart() 3625 }; 3626 3627 Block miniCartCounterScriptTemplate = new Block 3628 { 3629 Id = "MiniCartCounterScriptTemplate", 3630 Template = RenderMobileMiniCartCounterContent() 3631 }; 3632 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", miniCartCounterScriptTemplate); 3633 } 3634 else 3635 { 3636 mobileHeaderMiniCart = new Block 3637 { 3638 Id = "MobileHeaderMiniCart", 3639 SortId = 20 3640 }; 3641 } 3642 3643 if (!hideSearch) 3644 { 3645 Block mobileHeaderSearchBar = new Block() 3646 { 3647 Id = "MobileHeaderSearchBar", 3648 SortId = 30, 3649 Template = RenderMobileTopSearchBar() 3650 }; 3651 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeaderSearchBar); 3652 } 3653 3654 switch (mobileTopLayout) 3655 { 3656 case "nav-left": 3657 mobileHeaderNavigation.SortId = 10; 3658 mobileHeaderLogo.SortId = 20; 3659 mobileHeaderActions.SortId = 30; 3660 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 3661 break; 3662 case "nav-right": 3663 mobileHeaderLogo.SortId = 10; 3664 mobileHeaderActions.SortId = 20; 3665 mobileHeaderNavigation.SortId = 30; 3666 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 3667 break; 3668 case "nav-search-left": 3669 mobileHeaderNavigation.SortId = 10; 3670 mobileHeaderLogo.SortId = 20; 3671 mobileHeaderActions.SortId = 30; 3672 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 3673 break; 3674 case "search-left": 3675 mobileHeaderActions.SortId = 10; 3676 mobileHeaderLogo.SortId = 20; 3677 mobileHeaderNavigation.SortId = 30; 3678 mobileHeaderMiniCart.SortId = 0; 3679 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 3680 break; 3681 } 3682 } 3683 3684 3685 @helper RenderMobileTop() 3686 { 3687 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileTop").OrderBy(item => item.SortId).ToList(); 3688 3689 <nav class="main-navigation-mobile dw-mod"> 3690 <div class="center-container top-container__center-container dw-mod"> 3691 <div class="grid grid--align-center"> 3692 @RenderBlockList(subBlocks) 3693 </div> 3694 </div> 3695 </nav> 3696 } 3697 3698 @helper RenderMobileHeaderNavigation() 3699 { 3700 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderNavigation").OrderBy(item => item.SortId).ToList(); 3701 3702 <div class="grid__col-auto-width no-padding-right"> 3703 <ul class="menu dw-mod"> 3704 @RenderBlockList(subBlocks) 3705 </ul> 3706 </div> 3707 } 3708 3709 @helper RenderMobileHeaderNavigationTrigger() 3710 { 3711 bool customCountrySelector = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetBoolean("CustomCountrySelector"); 3712 <li class="menu__item menu__item--horizontal menu__item--top-level menu__item--icon dw-mod"> 3713 <label for="MobileNavTrigger" class="mobile-nav-trigger-button menu__link menu__link--icon menu__link--mobile dw-mod js-toggle-class" data-target=".header__nav" data-target-class="is-open"></label> 3714 </li> 3715 3716 <script> 3717 const closeSearch = document.getElementById('closebtn'); 3718 3719 document.querySelector('.js-toggle-class').addEventListener('click', () =>{ 3720 const searchOverlay = document.getElementById('myOverlay'); 3721 if (document.body.classList.contains('no-scroll')) { 3722 document.body.classList.remove( 'no-scroll', 'show-search' ); 3723 searchOverlay.style.display = "none"; 3724 closeSearch.classList.remove( 'icon-nz-close' ); 3725 closeSearch.classList.add( 'icon-nz-search' ); 3726 } 3727 }); 3728 closeSearch.addEventListener('click', () =>{ 3729 const mobileToggleBtn = document.querySelector('.js-toggle-class'); 3730 if (mobileToggleBtn.classList.contains('is-active')) { 3731 mobileToggleBtn.classList.remove( 'is-active' ); 3732 document.getElementById('MobileNavTrigger').checked = false; 3733 } 3734 }); 3735 </script> 3736 3737 } 3738 3739 @helper RenderMobileHeaderLogo() 3740 { 3741 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderLogo").OrderBy(item => item.SortId).ToList(); 3742 3743 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"; 3744 string centeredLogo = mobileTopLayout != "nav-right" ? "u-ta-center" : ""; 3745 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 3746 string businessName = Model.Area.Item.GetItem("Settings").GetString("BusinessName"); 3747 3748 string mobileLogo = "/Files/Images/logo-dynamicweb.png"; 3749 if (Model.Area.Item.GetItem("Layout").GetItem("MobileTop") != null && Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo") != null) 3750 { 3751 mobileLogo = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo").PathUrlEncoded; 3752 } 3753 3754 if (Path.GetExtension(mobileLogo).ToLower() != ".svg") 3755 { 3756 mobileLogo = "/Admin/Public/GetImage.ashx?height=100&amp;crop=5&amp;Compression=75&amp;image=" + mobileLogo; 3757 } 3758 else 3759 { 3760 mobileLogo = HttpUtility.UrlDecode(mobileLogo); 3761 } 3762 3763 <div class="grid__col-auto grid__col--bleed"> 3764 <div class="grid__cell @centeredLogo"> 3765 <a href="/Default.aspx?ID=@firstPageId" class="logo logo--mobile u-inline-block dw-mod"> 3766 <img class="grid__cell-img logo__img logo__img--mobile dw-mod" src="@mobileLogo" alt="@businessName" /> 3767 </a> 3768 </div> 3769 3770 @RenderBlockList(subBlocks) 3771 </div> 3772 } 3773 3774 @RenderMiniCartPanelLayout() 3775 3776 @helper RenderMiniCartPanelLayout() 3777 { 3778 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 3779 3780 <div class="mini-cart grid__cell dw-mod mini-cart-mobile"> 3781 <input type="checkbox" id="miniCartTrigger" class="panel-trigger" /> 3782 <div class="panel panel--right panel--with-close-btn dw-mod js-mini-cart" id="miniCart" data-cart-id="@miniCartFeedPageId" data-show-type="block"> 3783 <label for="miniCartTrigger" class="panel__close-btn" title="@Translate("Close panel")"><i class="fas fa-times"></i></label> 3784 <div class="panel__content u-full-width dw-mod"> 3785 <div class="heading h4 panel__header dw-mod u-margin-bottom">@Translate("Shopping cart")</div> 3786 <div class="panel__content-body panel__content-body--cart dw-mod"> 3787 <div class="js-handlebars-root u-flex grid--direction-column u-full-height dw-mod" id="miniCartContent" data-template="MiniCartContent" data-json-feed="/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart" data-init-onload="false"></div> 3788 </div> 3789 </div> 3790 </div> 3791 </div> 3792 } 3793 3794 @helper RenderMobileTopActions() 3795 { 3796 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderActions").OrderBy(item => item.SortId).ToList(); 3797 bool customCountrySelector = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetBoolean("CustomCountrySelector"); 3798 3799 bool autoshowCountrySelector = false; 3800 bool isShippingCountryCookieSet = false; 3801 3802 var websiteShippingCountries = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItems("Countries"); 3803 3804 if (customCountrySelector) 3805 { 3806 List<string> validWebsiteShippingCountryCodes = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItems("Countries").Select(c => c.GetString("CountryCode")).ToList(); 3807 S_DW_HD2412.CustomCode.ShippingCountries shippingCountries = new S_DW_HD2412.CustomCode.ShippingCountries(validWebsiteShippingCountryCodes); 3808 3809 3810 isShippingCountryCookieSet = shippingCountries.Handling(); 3811 autoshowCountrySelector = !isShippingCountryCookieSet; 3812 } 3813 3814 var currentCountry = Dynamicweb.Ecommerce.Common.Context.Country; 3815 3816 <div class="grid__col-auto-width"> 3817 <ul class="menu dw-mod" style="display:flex;"> 3818 @RenderBlockList(subBlocks) 3819 3820 @if (customCountrySelector) 3821 { 3822 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod js-custom-country-selector-toggler" data-toggle-on-load="@autoshowCountrySelector"> 3823 <span class="flag-icon flag-icon-@Dynamicweb.Ecommerce.Common.Context.Country.Code2.ToLower() u-margin-right"></span> 3824 </li> 3825 } 3826 3827 </ul> 3828 3829 </div> 3830 3831 if (customCountrySelector) 3832 { 3833 string logo = Model.Area.Item.GetItem("Layout").GetFile("LogoImage") != null ? Model.Area.Item.GetItem("Layout").GetFile("LogoImage").PathUrlEncoded : "/Files/Images/logo-dynamicweb.png"; 3834 if (Path.GetExtension(logo).ToLower() != ".svg") 3835 { 3836 int logoHeight = Model.Area.Item.GetItem("Layout").GetInt32("LogoHeight"); 3837 logoHeight = logoHeight > 0 && Pageview.Device.ToString() != "Mobile" ? logoHeight : 40; 3838 logo = "/Admin/Public/GetImage.ashx?height=" + Converter.ToString(logoHeight) + "&amp;crop=5&amp;Compression=75&amp;image=" + logo; 3839 } 3840 else 3841 { 3842 logo = HttpUtility.UrlDecode(logo); 3843 } 3844 <div class="js-custom-country-selector-area custom-country-selector-area custom-country-selector-area--mobile"> 3845 <div class="country-container center-container dw-mod"> 3846 @{ 3847 string toggleShippingCountryForm = "u-hidden"; 3848 } 3849 @if (!isShippingCountryCookieSet) 3850 { 3851 toggleShippingCountryForm = ""; 3852 <img src="@logo" alt="Logo" class="mobile-img" /> 3853 <p class="header header--mobile">@Translate("CountrySelector.Welcome", "Velkommen til vores webshop!")</p> 3854 } 3855 <div class="selected-shipping-country selected-shipping-country--mobile"> 3856 <p> 3857 @Translate("CountrySelector.CurrentShippingCountry", "Forsendelsesland: ") 3858 <span> @currentCountry.Name | </span><span>@Dynamicweb.Ecommerce.Common.Context.Currency.Code</span> 3859 <span class="u-margin-left flag-icon flag-icon-@currentCountry.Code2.ToLower()"></span> 3860 </p> 3861 </div> 3862 3863 <form method="post" class="@toggleShippingCountryForm"> 3864 <input type="hidden" name="SetCountryCode" value="@currentCountry.Code2" /> 3865 <button class="btn btn--primary dw-mod js-custom-country-selector-confirm mobile-button"> 3866 @Translate("CountrySelector.ConfirmSelection", "Jeg er enig, og vil gerne forts&aelig;tte til webshoppen") 3867 </button> 3868 </form> 3869 3870 <div class="other-options other-options--mobile"> 3871 <div class="option"> 3872 <p>@Translate("CountrySelector.PickOtherShippingHeader", "V&aelig;lg et andet forsendelsesland")</p> 3873 @foreach (var country in websiteShippingCountries.Where(c => c.GetString("CountryCode") != currentCountry.Code2)) 3874 { 3875 string countryCode = country.GetString("CountryCode"); 3876 var countryDw = new Dynamicweb.Ecommerce.International.CountryService().GetCountry(countryCode); 3877 string countryName = countryDw != null ? countryDw.Name : countryCode; 3878 string countryFlagIconClass = "flag-icon-" + countryCode.ToLower(); 3879 3880 string currencyCode = country.GetString("CurrencyCode"); 3881 3882 <form action="/" method="post"> 3883 <input type="hidden" name="SetCountryCode" value="@countryCode" /> 3884 <button class="" type="submit">@countryName | @currencyCode <span class="u-margin-left flag-icon @countryFlagIconClass"></span></button> 3885 </form> 3886 } 3887 3888 </div> 3889 <div class="option"> 3890 <p>@Translate("CountrySelector.GoToOtherWebshopHeader", "G&aring; til en af vores andre webshops")</p> 3891 @foreach (var websiteLink in Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItems("WebsiteLinks")) 3892 { 3893 string countryCode = websiteLink.GetString("CountryCode"); 3894 string countryFlagIconClass = "flag-icon-" + countryCode.ToLower(); 3895 string linkUrl = websiteLink.GetString("Link"); 3896 string linkText = websiteLink.GetString("Text"); 3897 3898 <div> 3899 <a href="@linkUrl"> 3900 <span class="u-margin-right flag-icon @countryFlagIconClass"></span> 3901 <span>@linkText</span> 3902 </a> 3903 </div> 3904 3905 } 3906 </div> 3907 </div> 3908 </div> 3909 </div> 3910 } 3911 3912 } 3913 3914 @helper RenderMobileTopSearch() 3915 { 3916 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 3917 3918 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 3919 <div class="menu__link menu__link--icon dw-mod openBtn @(siteURL.Contains("hd2412") ? "hd2412-search-icon" : "hededanmark-search-icon")"> 3920 @* To switch from orange icon and search text - HD2412 *@ 3921 @if (siteURL.Contains("hd2412")) 3922 { 3923 <span class="closebtn icon-nz icon-nz-search orange-search-icon" id="closebtn" title="Close Overlay"><span class="u-margin-left mobile-search-text">@Translate("Search")</span></span> 3924 } 3925 3926 else 3927 { 3928 <span class="closebtn icon-nz icon-nz-search" id="closebtn" title="Close Overlay"></span> 3929 } 3930 </div> 3931 </li> 3932 3933 <script defer> 3934 var clickState = 0; 3935 var btn = document.querySelector('.openBtn'); 3936 3937 btn.addEventListener('click', function () { 3938 3939 if (clickState == 0) { 3940 // code snippet 1 3941 document.getElementById("searchOverlay").style.display = "block"; 3942 3943 document.getElementById("closebtn").classList.remove('icon-nz-search'); 3944 document.getElementById("closebtn").classList.add('icon-nz-close'); 3945 document.body.classList.add('no-scroll'); 3946 clickState = 1; 3947 } else { 3948 // code snippet 2 3949 document.getElementById("searchOverlay").style.display = "none"; 3950 document.getElementById("closebtn").classList.remove('icon-nz-close'); 3951 document.getElementById("closebtn").classList.add('icon-nz-search'); 3952 document.body.classList.remove('no-scroll'); 3953 3954 clickState = 0; 3955 } 3956 3957 }); 3958 3959 </script> 3960 } 3961 3962 @helper RenderMobileTopMiniCart() 3963 { 3964 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 3965 int cartPageId = GetPageIdByNavigationTag("CartPage"); 3966 double cartProductsCount = Model.Cart.TotalProductsCount; 3967 3968 <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')"> 3969 <div class="mini-cart dw-mod"> 3970 <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"> 3971 <div class="u-inline u-position-relative"> 3972 <span class="icon-nz icon-nz-cart dw-mod"></span> 3973 <div class="mini-cart__counter dw-mod"> 3974 <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"> 3975 <div class="js-mini-cart-counter-content"> 3976 @cartProductsCount 3977 </div> 3978 </div> 3979 </div> 3980 </div> 3981 </a> 3982 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 3983 { 3984 <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> 3985 } 3986 </div> 3987 </li> 3988 } 3989 3990 @helper RenderMobileTopSearchBar() 3991 { 3992 string searchFeedId = ""; 3993 string searchSecondFeedId = ""; 3994 int groupsFeedId; 3995 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 3996 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 3997 string resultPageLink; 3998 string searchPlaceholder; 3999 string searchType = "product-search"; 4000 string searchTemplate; 4001 string searchContentTemplate = ""; 4002 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 4003 bool showGroups = true; 4004 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 4005 4006 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 4007 { 4008 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 4009 resultPageLink = contentSearchPageLink; 4010 searchPlaceholder = Translate("FullscreenSearchText"); 4011 groupsFeedId = 0; 4012 searchType = "content-search"; 4013 searchTemplate = "SearchPagesTemplate"; 4014 showGroups = false; 4015 } 4016 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 4017 { 4018 searchFeedId = productsPageId + "&feed=true"; 4019 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 4020 resultPageLink = Converter.ToString(productsPageId); 4021 searchPlaceholder = Translate("Search products or pages"); 4022 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 4023 searchType = "combined-search"; 4024 searchTemplate = "SearchProductsTemplateWrap"; 4025 searchContentTemplate = "SearchPagesTemplateWrap"; 4026 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 4027 } 4028 else 4029 { 4030 resultPageLink = Converter.ToString(productsPageId); 4031 searchFeedId = productsPageId + "&feed=true"; 4032 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 4033 searchPlaceholder = Translate("Search products"); 4034 searchTemplate = "SearchProductsTemplate"; 4035 searchType = "product-search"; 4036 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 4037 } 4038 4039 bool isWebshop = false; 4040 4041 // Check if we're on a webshop 4042 IList<Area> areaIds = Dynamicweb.Services.Areas.GetAreas(); 4043 if (areaIds.Any(x => x.ID == 2 || x.ID == 3 || x.ID == 33)) 4044 { 4045 isWebshop = true; 4046 } 4047 4048 4049 SearchConfiguration searchConfiguration = null; 4050 4051 switch (searchType) 4052 { 4053 case "contentSearch": 4054 searchConfiguration = new SearchConfiguration() 4055 { 4056 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true", 4057 resultPageLink = contentSearchPageLink, 4058 searchPlaceholder = Translate("FullscreenSearchText"), 4059 groupsFeedId = 0, 4060 searchType = "content-search", 4061 searchTemplate = "SearchPagesTemplate", 4062 showGroups = false 4063 }; 4064 break; 4065 case "combinedSearch": 4066 searchConfiguration = new SearchConfiguration() 4067 { 4068 searchFeedId = productsPageId + "&feed=true", 4069 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true", 4070 resultPageLink = Converter.ToString(productsPageId), 4071 searchPlaceholder = Translate("Search products or pages"), 4072 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"), 4073 searchType = "combined-search", 4074 searchTemplate = "SearchProductsTemplateWrap", 4075 searchContentTemplate = "SearchPagesTemplateWrap", 4076 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector") 4077 }; 4078 break; 4079 default: //productSearch 4080 searchConfiguration = new SearchConfiguration() 4081 { 4082 resultPageLink = Converter.ToString(productsPageId), 4083 searchFeedId = productsPageId + "&feed=true", 4084 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"), 4085 searchPlaceholder = Translate("Search products"), 4086 searchTemplate = "SearchProductsTemplate", 4087 searchType = "product-search", 4088 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector") 4089 }; 4090 break; 4091 } 4092 searchConfiguration.searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 4093 4094 4095 4096 <div id="searchOverlay" class="overlay"> 4097 <div class="overlay-content"> 4098 @if (!isWebshop) 4099 { 4100 <div class="menu menu--dropdown menu--dropdown-right u-no-padding u-w380px grid__cell dw-mod"> 4101 <div class="typeahead js-typeahead search-field-fullscreen" id="ProductSearchBar" 4102 data-page-size="7" 4103 data-search-feed-id="@searchConfiguration.searchFeedId" 4104 data-search-second-feed-id="@searchConfiguration.searchSecondFeedId" 4105 data-result-page-id="@searchConfiguration.resultPageLink" 4106 data-search-type="@searchConfiguration.searchType"> 4107 <div class="typeahead-search-field dw-mod" id="typeahead-search-field"> 4108 4109 <input type="text" class="u-no-margin u-full-width js-search-input js-typeahead-search-field typeahead fullscreen-input-field @(siteURL.Contains("hd2412") ? "orange-text" : "") dw-mod" id="headerSearch" placeholder="@searchConfiguration.searchPlaceholder" value="@searchConfiguration.searchValue"> 4110 4111 <a id="btnSearch" onclick="window.location.href='/Default.aspx?ID=@searchConfiguration.resultPageLink&Search=' + $('input.typeahead.tt-input').val()" class="js-typeahead-link js-search-link u-color-dark"> 4112 <span class="icon-nz icon-nz-search input-search-icon @(siteURL.Contains("hd2412") ? "orange-text dw-mod" : "")"></span> 4113 </a> 4114 4115 <a id="btnSearch" onclick="window.location.href='/Default.aspx?ID=@searchConfiguration.resultPageLink&Search=' + $('input.typeahead.tt-input').val()" class="js-typeahead-link js-search-link"> 4116 <span class="icon-nz icon-nz-arrow-long-right input-arrow-icon"></span> 4117 </a> 4118 4119 4120 @if (string.IsNullOrEmpty(searchConfiguration.searchSecondFeedId)) 4121 { 4122 <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="@searchConfiguration.searchTemplate" data-json-feed="/Default.aspx?ID=@searchConfiguration.searchFeedId&feedType=productsOnly" data-init-onload="false"></ul> 4123 } 4124 else 4125 { 4126 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--right-aligned"> 4127 <div class="js-handlebars-root js-typeahead-search-content grid__col-sm-7 grid__col--bleed-y" id="ProductSearchBarContent" data-template="@searchConfiguration.searchTemplate" data-json-feed="/Default.aspx?ID=@searchConfiguration.searchFeedId&feedType=productsOnly" data-init-onload="false"></div> 4128 <div class="js-handlebars-root js-typeahead-additional-search-content grid__col-sm-5 grid__col--bleed-y" id="ContentSearchBarContent" data-template="@searchConfiguration.searchContentTemplate" data-json-feed="/Default.aspx?ID=@searchConfiguration.searchSecondFeedId" data-init-onload="false"></div> 4129 </div> 4130 } 4131 </div> 4132 </div> 4133 </div> 4134 } 4135 // HD2412 Instant Search 4136 else 4137 { 4138 <div class="menu menu--dropdown menu--dropdown-right u-no-padding u-w380px grid__cell dw-mod"> 4139 <div id="searchContainer"> 4140 @{ 4141 string noResultsText = Translate("InstantSearch.NoResults", "No results found"); 4142 string seachPlaceholderText = Translate("Search.Products.SearchPlaceholder", "Søg efter produkt, kategori eller varenummer"); 4143 } 4144 <Search 4145 no-search-result="@noResultsText" search-placeholder-text="@seachPlaceholderText"></Search> 4146 </div> 4147 </div> 4148 } 4149 </div> 4150 </div> 4151 4152 <script defer> 4153 document.addEventListener("DOMContentLoaded", function (event) { 4154 4155 4156 4157 var bestPictures = new Bloodhound({ 4158 datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), 4159 4160 queryTokenizer: Bloodhound.tokenizers.whitespace, 4161 4162 prefetch: { 4163 url:'/Default.aspx?ID=@searchFeedId', 4164 transform: function (data) { // we modify the prefetch response 4165 var newData = []; // here to match the response format 4166 data.forEach(function (item) { // of the remote endpoint 4167 newData.push({'name': item}); 4168 }); 4169 return newData; 4170 } 4171 }, 4172 4173 remote: { 4174 url: '/Default.aspx?ID=@searchFeedId&Search=%QUERY', 4175 wildcard: '%QUERY' 4176 } 4177 }); 4178 4179 4180 $('#typeahead-search-field .typeahead').typeahead({ 4181 minLength: 1, 4182 highlight: true 4183 }, 4184 { 4185 name: 'name', 4186 display: 'name', 4187 source: bestPictures, 4188 limit: 3, 4189 async: true, 4190 templates: { 4191 empty: [ 4192 '<div class="empty-message">', 4193 '@Translate("Your search gave 0 results")', 4194 '</div>' 4195 ].join('\n'), 4196 suggestion: Handlebars.compile('<div><span class="icon-nz icon-nz-arrow-long-right search-item-icon"></span><span class="js-typeahead-name search-result-name">{{name}}</span> <br> <span class="js-typeahead-link js-typeahead-name search-result-summary">{{testSummary}}</span></div>') 4197 } 4198 4199 }).on('keypress', function(e) { 4200 if (e.which == 13) { 4201 var q = $('input.typeahead.tt-input').val(); 4202 window.location.href = "/Default.aspx?ID=@resultPageLink&Search="+q; 4203 } 4204 }); 4205 }); 4206 4207 </script> 4208 } 4209 4210 @helper RenderMobileMiniCartCounterContent() 4211 { 4212 bool showPrice = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 4213 string counterPosition = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue : "right"; 4214 bool showPriceInMiniCartCounter = Pageview.Device.ToString() != "Mobile" && counterPosition == "right" && showPrice; 4215 4216 <script id="MiniCartCounterContent" type="text/x-template"> 4217 {{#.}} 4218 <div class="js-mini-cart-counter-content dw-mod"> 4219 @if (showPriceInMiniCartCounter) 4220 { 4221 @Translate("Cart")<text>({{numberofproducts}}) {{totalprice}}</text> 4222 } 4223 else 4224 { 4225 <text>{{numberofproducts}}</text> 4226 } 4227 </div> 4228 {{/.}} 4229 </script> 4230 }</text> 4231 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4232 4233 @using System 4234 @using System.Web 4235 @using System.Collections.Generic 4236 @using Dynamicweb.Frontend 4237 @using Dynamicweb.Rapido.Blocks.Extensibility 4238 @using Dynamicweb.Rapido.Blocks 4239 4240 @functions { 4241 BlocksPage mobileNavigationBlocksPage = BlocksPage.GetBlockPage("Master"); 4242 } 4243 4244 @{ 4245 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 4246 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 4247 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 4248 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 4249 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 4250 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 4251 4252 Block mobileNavigation = new Block() 4253 { 4254 Id = "MobileNavigation", 4255 SortId = 10, 4256 Template = MobileNavigation(), 4257 SkipRenderBlocksList = true 4258 }; 4259 mobileNavigationBlocksPage.Add(MasterBlockId.MasterTopSnippets, mobileNavigation); 4260 4261 if (Model.CurrentUser.ID > 0 && !hideMyProfileLink) 4262 { 4263 Block mobileNavigationSignIn = new Block 4264 { 4265 Id = "MobileNavigationSignIn", 4266 SortId = 10, 4267 Template = RenderMobileNavigationSignIn() 4268 }; 4269 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationSignIn); 4270 } 4271 4272 Block mobileNavigationMenu = new Block 4273 { 4274 Id = "MobileNavigationMenu", 4275 SortId = 20, 4276 Template = RenderMobileNavigationMenu() 4277 }; 4278 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationMenu); 4279 4280 Block mobileNavigationActions = new Block 4281 { 4282 Id = "MobileNavigationActions", 4283 SortId = 30, 4284 Template = RenderMobileNavigationActions(), 4285 SkipRenderBlocksList = true 4286 }; 4287 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationActions); 4288 4289 if (!navigationItemsHideSignIn) 4290 { 4291 if (Model.CurrentUser.ID <= 0) 4292 { 4293 Block mobileNavigationSignInAction = new Block 4294 { 4295 Id = "MobileNavigationSignInAction", 4296 SortId = 10, 4297 Template = RenderMobileNavigationSignInAction() 4298 }; 4299 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignInAction); 4300 4301 if (!hideCreateAccountLink) 4302 { 4303 Block mobileNavigationCreateAccountAction = new Block 4304 { 4305 Id = "MobileNavigationCreateAccountAction", 4306 SortId = 20, 4307 Template = RenderMobileNavigationCreateAccountAction() 4308 }; 4309 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationCreateAccountAction); 4310 } 4311 } 4312 else 4313 { 4314 if (!hideMyOrdersLink) 4315 { 4316 Block mobileNavigationOrdersAction = new Block 4317 { 4318 Id = "MobileNavigationOrdersAction", 4319 SortId = 20, 4320 Template = RenderMobileNavigationOrdersAction() 4321 }; 4322 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationOrdersAction); 4323 } 4324 if (!hideMyFavoritesLink) 4325 { 4326 Block mobileNavigationFavoritesAction = new Block 4327 { 4328 Id = "MobileNavigationFavoritesAction", 4329 SortId = 30, 4330 Template = RenderMobileNavigationFavoritesAction() 4331 }; 4332 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationFavoritesAction); 4333 } 4334 if (!hideMySavedCardsLink) 4335 { 4336 Block mobileNavigationSavedCardsAction = new Block 4337 { 4338 Id = "MobileNavigationFavoritesAction", 4339 SortId = 30, 4340 Template = RenderMobileNavigationSavedCardsAction() 4341 }; 4342 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSavedCardsAction); 4343 } 4344 4345 Block mobileNavigationSignOutAction = new Block 4346 { 4347 Id = "MobileNavigationSignOutAction", 4348 SortId = 40, 4349 Template = RenderMobileNavigationSignOutAction() 4350 }; 4351 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignOutAction); 4352 } 4353 } 4354 } 4355 4356 4357 @helper MobileNavigation() 4358 { 4359 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigation").OrderBy(item => item.SortId).ToList(); 4360 4361 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 4362 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 4363 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 4364 string mobileTopDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design") != null ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 4365 string position = mobileTopDesign == "nav-left" || mobileTopDesign == "nav-search-left" ? "left" : "right"; 4366 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 4367 string firstUSPLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FirstLink"); 4368 string secondUSPLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("SecondLink"); 4369 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4370 string liClasses = topLayout != "normal" ? "menu__item--top-level" : "menu--clean"; 4371 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4372 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() : ""; 4373 bool customCountrySelector = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetBoolean("CustomCountrySelector"); 4374 4375 4376 <!-- Trigger for mobile navigation --> 4377 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger mobile-nav-trigger--@position" autocomplete="off" /> 4378 4379 <!-- Mobile navigation --> 4380 <nav class="mobile-navigation mobile-navigation--@position dw-mod"> 4381 <div class="mobile-navigation__wrapper" id="mobileNavigationWrapper"> 4382 @RenderBlockList(subBlocks) 4383 <ul class="menu menu-mobile dwnavigation"> 4384 @{ 4385 IList<ItemViewModel> uspLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItems("UspLink"); 4386 } 4387 @if (uspLink != null && uspLink.Any()) 4388 { 4389 foreach (ItemViewModel link in uspLink) 4390 { 4391 string linkUrl = link.GetString("Link"); 4392 string linkText = link.GetString("LinkText"); 4393 4394 <li class="menu-mobile__item dw-mod"> 4395 <a class="menu-mobile__link dw-mod menu-mobile__link--level-0" href="@linkUrl">@linkText</a> 4396 </li> 4397 } 4398 } 4399 </ul> 4400 <div class="grid grid--justify-start u-margin-top mobile-usp-bar"> 4401 <div class="grid__col-12"> 4402 <div class="usp-first-link-container-mobile dw-mod"> 4403 4404 <span class="u-color-light">@firstUSPLink</span> 4405 </div> 4406 </div> 4407 <div class="grid__col-8"> 4408 4409 <div class="usp-second-link-container-mobile dw-mod"> 4410 4411 <span class="u-color-light">@secondUSPLink</span> 4412 </div> 4413 </div> 4414 4415 @{ 4416 4417 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 4418 4419 string selectedLanguage = ""; 4420 string langName = ""; 4421 foreach (var lang in Model.Languages) 4422 { 4423 if (lang.IsCurrent) 4424 { 4425 selectedLanguage = lang.Name; 4426 langName = Dynamicweb.Services.Areas.GetArea(lang.ID).DisplayName; 4427 } 4428 } 4429 } 4430 @if (!customCountrySelector) 4431 { 4432 <ul class="menu menu-mobile language-switcher-mobile"> 4433 <li class="menu-mobile__item dw-mod"> 4434 @if (isSlidesDesign) 4435 { 4436 <input id="MobileMenuCheck_Language" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(1);"> 4437 } 4438 else 4439 { 4440 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 4441 } 4442 @foreach (var langnav in Model.Languages) 4443 { 4444 4445 if (langnav.IsCurrent) 4446 { 4447 4448 4449 string langInfonav = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(langnav.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>"; 4450 4451 4452 <div class="menu-mobile__link__wrap"> 4453 <label for="MobileMenuCheck_Language" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"> @langInfonav @Translate("Language")</label> 4454 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger dw-mod"></label> 4455 </div> 4456 4457 } 4458 4459 } 4460 4461 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 4462 @if (isSlidesDesign) 4463 { 4464 <li class="menu-mobile__item dw-mod"> 4465 <div class="menu-mobile__link__wrap"> 4466 <input id="MobileMenuCheck_Language_back" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(0);" /> 4467 <label for="MobileMenuCheck_Language_back" class="menu-mobile__trigger menu-mobile__trigger--back"></label> 4468 <label for="MobileMenuCheck_Language_back" class="menu-mobile__link dw-mod ">@Translate("Back")</label> 4469 </div> 4470 </li> 4471 } 4472 @foreach (var lang in Model.Languages) 4473 { 4474 var langNameDropdown = Dynamicweb.Services.Areas.GetArea(lang.ID).DisplayName; 4475 4476 string langInfonav = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>"; 4477 4478 <li class="menu-mobile__item dw-mod"> 4479 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod menu-mobile__link--level-1" href="/Default.aspx?ID=@lang.Page.ID"> @langInfonav <span class="u-word-spacing">@langNameDropdown</span></a> 4480 </li> 4481 } 4482 </ul> 4483 </li> 4484 </ul> 4485 } 4486 </div> 4487 </div> 4488 </nav> 4489 4490 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 4491 4492 if (!onlyPreview) 4493 { 4494 <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> 4495 } 4496 } 4497 4498 @helper RenderMobileNavigationSignIn() 4499 { 4500 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4501 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4502 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4503 string myProfilePageLink = linkStart + myProfilePageId; 4504 string userName = Model.CurrentUser.FirstName ?? ""; 4505 userName += " " + (Model.CurrentUser.LastName ?? ""); 4506 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 4507 4508 <ul class="menu menu-mobile"> 4509 <li class="menu-mobile__item"> 4510 <a href="@myProfilePageLink" class="menu-mobile__link dw-mod"><span class="icon-nz icon-nz-user dw-mod"></span> @userName</a> 4511 </li> 4512 </ul> 4513 } 4514 4515 @helper RenderMobileNavigationMenu() 4516 { 4517 var isHD2412 = Dynamicweb.Context.Current.Request.QueryString; 4518 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 4519 string menuTemplate = isSlidesDesign ? "BaseMenuForMobileSlides.xslt" : "BaseMenuForMobileExpandable.xslt"; 4520 string levels = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels") : "3"; 4521 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 4522 int startLevel = renderPagesInToolBar ? 1 : 0; 4523 4524 if (isHD2412.Equals("hd2412")) 4525 { 4526 4527 @RenderNavigation(new 4528 { 4529 id = "mobilenavigation", 4530 cssclass = "menu menu-mobile dwnavigation ecom-mobile-menu", 4531 startLevel = @startLevel, 4532 ecomStartLevel = @startLevel + 1, 4533 endlevel = @levels, 4534 expandmode = "all", 4535 template = @menuTemplate 4536 }) 4537 } 4538 4539 else 4540 { 4541 @RenderNavigation(new 4542 { 4543 id = "mobilenavigation", 4544 cssclass = "menu menu-mobile dwnavigation", 4545 startLevel = @startLevel, 4546 ecomStartLevel = @startLevel + 1, 4547 endlevel = @levels, 4548 expandmode = "all", 4549 template = @menuTemplate 4550 }) 4551 } 4552 4553 if (isSlidesDesign) 4554 { 4555 <script> 4556 function goToLevel(level) { 4557 document.getElementById('mobileNavigationWrapper').style.left = -(level * 100) + "%"; 4558 } 4559 4560 document.addEventListener('DOMContentLoaded', function () { 4561 goToLevel(document.getElementById('mobileNavigationWrapper').querySelectorAll('input[type=radio]:checked').length); 4562 }); 4563 </script> 4564 } 4565 4566 if (renderPagesInToolBar) 4567 { 4568 @RenderNavigation(new 4569 { 4570 id = "topToolsMobileNavigation", 4571 cssclass = "menu menu-mobile dwnavigation", 4572 template = "ToolsMenuForMobile.xslt" 4573 }) 4574 } 4575 } 4576 4577 @helper RenderMobileNavigationActions() 4578 { 4579 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigationActions").OrderBy(item => item.SortId).ToList(); ; 4580 4581 <ul class="menu menu-mobile"> 4582 @RenderBlockList(subBlocks) 4583 </ul> 4584 } 4585 4586 @helper RenderMobileNavigationSignInAction() 4587 { 4588 <li class="menu-mobile__item"> 4589 <label for="SignInModalTrigger" onclick="document.getElementById('MobileNavTrigger').checked = false;" class="menu-mobile__link dw-mod menu-mobile__link--highlighted"><span class="icon-nz icon-nz-user dw-mod"></span> @Translate("Sign in")</label> 4590 </li> 4591 } 4592 4593 @helper RenderMobileNavigationCreateAccountAction() 4594 { 4595 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 4596 4597 <li class="menu-mobile__item"> 4598 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Default.aspx?ID=@createAccountPageId"><span class="icon-nz icon-nz-user dw-mod"></span> @Translate("Create account")</a> 4599 </li> 4600 } 4601 4602 @helper RenderMobileNavigationProfileAction() 4603 { 4604 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4605 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4606 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4607 string myProfilePageLink = linkStart + myProfilePageId; 4608 4609 <li class="menu-mobile__item"> 4610 <a href="@myProfilePageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><span class="icon-nz icon-nz-user dw-mod"></span>@Translate("My Profile")</a> 4611 </li> 4612 } 4613 4614 @helper RenderMobileNavigationOrdersAction() 4615 { 4616 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4617 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4618 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 4619 string myOrdersPageLink = linkStart + myOrdersPageId; 4620 string ordersIcon = "fas fa-list"; 4621 4622 <li class="menu-mobile__item"> 4623 <a href="@myOrdersPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><span class="icon-nz icon-nz-cart dw-mod menu-mobile__link-icon"></span> @Translate("My Orders")</a> 4624 </li> 4625 } 4626 4627 @helper RenderMobileNavigationFavoritesAction() 4628 { 4629 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4630 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4631 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 4632 string myFavoritesPageLink = linkStart + myFavoritesPageId; 4633 string favoritesIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue : "fa fa-star"; 4634 4635 4636 <li class="menu-mobile__item"> 4637 <a href="@myFavoritesPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><span class="icon-nz icon-nz-star dw-mod menu-mobile__link-icon"></span> @Translate("My Favorites")</a> 4638 </li> 4639 } 4640 4641 @helper RenderMobileNavigationSavedCardsAction() 4642 { 4643 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4644 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4645 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 4646 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 4647 string savedCardsIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SavedCards") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SavedCards").SelectedValue : "fas fa-credit-card"; 4648 4649 <li class="menu-mobile__item"> 4650 <a href="@mySavedCardsPageLink" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"><span class="icon-nz icon-nz-payment dw-mod menu-mobile__link-icon"></span> @Translate("My Saved Cards")</a> 4651 </li> 4652 } 4653 4654 @helper RenderMobileNavigationSignOutAction() 4655 { 4656 int pageId = Model.TopPage.ID; 4657 string signOutIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignOutIcon") != null ? "fas fa-" + Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("SignOutIcon").SelectedValue : "far fa-sign-out-alt"; 4658 4659 <li class="menu-mobile__item"> 4660 <a class="menu-mobile__link menu-mobile__link--highlighted dw-mod" href="/Admin/Public/ExtranetLogoff.aspx?ID=@pageId"><i class="@signOutIcon menu-mobile__link-icon"></i> @Translate("Sign out")</a> 4661 </li> 4662 } 4663 </text> 4664 } 4665 else 4666 { 4667 4668 if (string.IsNullOrEmpty(headerTemplate)) 4669 { 4670 headerTemplate = "MasterBlocks/Header.cshtml"; 4671 } 4672 @RenderingService.Instance.PartialView(headerTemplate, Model) 4673 4674 } 4675 } 4676 4677 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4678 4679 @using System 4680 @using System.Web 4681 @using Dynamicweb.Rapido.Blocks.Extensibility 4682 @using Dynamicweb.Rapido.Blocks 4683 4684 @{ 4685 Block impersonationBar = new Block 4686 { 4687 Id = "ImpersonationBar", 4688 SortId = 50, 4689 Template = RenderImpersonationBar(), 4690 Design = new Design 4691 { 4692 Size = "auto-width", 4693 HidePadding = true, 4694 RenderType = RenderType.Column 4695 } 4696 }; 4697 4698 if (Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) 4699 { 4700 BlocksPage.GetBlockPage("Master").Add("MasterHeader", impersonationBar); 4701 } 4702 } 4703 4704 @helper RenderImpersonationBar() 4705 { 4706 int impersonationPageId = GetPageIdByNavigationTag("Impersonation"); 4707 4708 <div class="u-color-warning--bg"> 4709 <div class="center-container top-container__center-container dw-mod"> 4710 @*Impersonation*@ 4711 <div class="grid"> 4712 <div class="grid--align-self-center grid__col-x"> 4713 @if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 4714 { 4715 string stopImpersonateTranslation = Translate("Stop impersonation"); 4716 string username = ""; 4717 if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) 4718 { 4719 username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; 4720 } 4721 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) 4722 { 4723 username = Model.CurrentSecondaryUser.Name; 4724 } 4725 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) 4726 { 4727 username = Model.CurrentSecondaryUser.Email; 4728 } 4729 else 4730 { 4731 username = Model.CurrentSecondaryUser.UserName; 4732 } 4733 <div class="grid-cell"> 4734 <div class="u-pull--left u-bold u-margin-top"> 4735 <i class="fas fa-user-secret"></i> 4736 @Pageview.User.UserName<text>&nbsp;</text>@Translate("is impersonating")<text>&nbsp;</text>@username 4737 </div> 4738 <form method="post" class="u-pull--right u-no-margin"> 4739 <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 4740 </form> 4741 </div> 4742 } 4743 else 4744 { 4745 string viewListTranslation = Translate("View the list of users you can impersonate"); 4746 <div class="grid-cell u-bold"> 4747 <i class="fas fa-user-secret"></i> 4748 <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> 4749 </div> 4750 } 4751 </div> 4752 </div> 4753 </div> 4754 </div> 4755 } 4756 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4757 4758 @using Dynamicweb.Rapido.Blocks 4759 4760 @{ 4761 BlocksPage miniCartBlocksPage = BlocksPage.GetBlockPage("Master"); 4762 string orderlinesView = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("OrderlinesView") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("OrderlinesView").SelectedValue : "table"; 4763 4764 Block orderLines = new Block 4765 { 4766 Id = "MiniCartOrderLines", 4767 SkipRenderBlocksList = true, 4768 BlocksList = new List<Block> 4769 { 4770 new Block { 4771 Id = "MiniCartOrderLinesList", 4772 SortId = 20, 4773 Template = RenderMiniCartOrderLinesList() 4774 } 4775 } 4776 }; 4777 4778 Block orderlinesScriptTemplates = new Block 4779 { 4780 Id = "OrderlinesScriptTemplates" 4781 }; 4782 4783 if (orderlinesView == "table") 4784 { 4785 orderLines.Template = RenderMiniCartOrderLinesTable(); 4786 orderLines.BlocksList.Add( 4787 new Block 4788 { 4789 Id = "MiniCartOrderlinesTableHeader", 4790 SortId = 10, 4791 Template = RenderMiniCartOrderLinesHeader() 4792 } 4793 ); 4794 4795 orderlinesScriptTemplates.Template = RenderMiniCartScriptsTableTemplates(); 4796 } 4797 else 4798 { 4799 orderLines.Template = RenderMiniCartOrderLinesBlocks(); 4800 orderlinesScriptTemplates.Template = RenderMiniCartScriptsListTemplates(); 4801 } 4802 4803 miniCartBlocksPage.Add("MasterBottomSnippets", orderlinesScriptTemplates); 4804 4805 Block miniCartScriptTemplates = new Block() 4806 { 4807 Id = "MasterMiniCartTemplates", 4808 SortId = 1, 4809 Template = RenderMiniCartScriptTemplates(), 4810 SkipRenderBlocksList = true, 4811 BlocksList = new List<Block> 4812 { 4813 orderLines, 4814 new Block { 4815 Id = "MiniCartFooter", 4816 Template = RenderMiniCartFooter(), 4817 SortId = 50, 4818 SkipRenderBlocksList = true, 4819 BlocksList = new List<Block> 4820 { 4821 new Block { 4822 Id = "MiniCartFees", 4823 Template = RenderMiniCartFees(), 4824 SortId = 30 4825 }, 4826 new Block { 4827 Id = "MiniCartPoints", 4828 Template = RenderMiniCartPoints(), 4829 SortId = 40 4830 }, 4831 new Block { 4832 Id = "MiniCartTotal", 4833 Template = RenderMiniCartTotal(), 4834 SortId = 50 4835 }, 4836 new Block { 4837 Id = "MiniCartActions", 4838 Template = RenderMiniCartActions(), 4839 SortId = 60 4840 } 4841 } 4842 } 4843 } 4844 }; 4845 4846 miniCartBlocksPage.Add("MasterBottomSnippets", miniCartScriptTemplates); 4847 } 4848 4849 @helper RenderMiniCartScriptsTableTemplates() 4850 { 4851 <script id="MiniCartOrderline" type="text/x-template"> 4852 {{#unless isEmpty}} 4853 <tr> 4854 <td class="u-w60px"><a href="{{link}}" class="{{hideimage}}"><img class="b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=50&height=50&crop=5&Compression=75&image={{image}}" alt="{{name}}"></a></td> 4855 <td class="u-va-middle"> 4856 <a href="{{link}}" class="mini-cart-orderline__name" title="{{name}}">{{name}}</a> 4857 {{#if variantname}} 4858 <a href="{{link}}" class="mini-cart-orderline__name mini-cart-orderline__name--sm">{{variantname}}</a> 4859 {{/if}} 4860 {{#if unitname}} 4861 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm">{{unitname}}</div> 4862 {{/if}} 4863 </td> 4864 <td class="u-ta-right u-va-middle">{{quantity}}</td> 4865 <td class="u-ta-right u-va-middle"> 4866 {{#if pointsTotal}} 4867 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 4868 {{else}} 4869 {{totalprice}} 4870 {{/if}} 4871 </td> 4872 </tr> 4873 {{/unless}} 4874 4875 </script> 4876 4877 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 4878 {{#unless isEmpty}} 4879 <tr class="table__row--no-border"> 4880 <td class="u-w60px">&nbsp;</td> 4881 <td><div class="mini-cart-orderline__name dw-mod"><strong>{{name}}</strong></div></td> 4882 <td class="u-ta-right">&nbsp;</td> 4883 <td class="u-ta-right">{{totalprice}}</td> 4884 </tr> 4885 {{/unless}} 4886 </script> 4887 } 4888 4889 @helper RenderMiniCartScriptsListTemplates() 4890 { 4891 int cartOrderlinesFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 4892 <script id="MiniCartOrderline" type="text/x-template"> 4893 {{#unless isEmpty}} 4894 <div class="js-mini-cart-orderline mini-cart-orderline grid dw-mod" data-name="{{googleImpression.name}}" data-id="{{googleImpression.id}}" data-unitprice="{{googleImpression.price}}" data-brand="{{googleImpression.brand}}" data-category="{{googleImpression.category}}" data-variant="{{googleImpression.variant}}" data-quantity="{{googleImpression.quantity}}"> 4895 <div class="grid__col-4"> 4896 <a href="{{link}}" class="{{hideimage}}"> 4897 <img class="b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=100&height=100&crop=5&Compression=75&image={{image}}" alt="{{name}}" title="{{name}}"> 4898 </a> 4899 </div> 4900 <div class="grid__col-8"> 4901 <a href="{{link}}" class="mini-cart-orderline__name mini-cart-orderline__name--truncate mini-cart-orderline__name--lg u-padding-right--lg" title="{{name}}">{{name}}</a> 4902 {{#if variantname}} 4903 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("Variant"): {{variantname}}</div> 4904 {{/if}} 4905 {{#if customFields.LogoSelector}} 4906 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("LogoSelectortitle", "Valgt firma"): {{customFields.LogoSelector}}</div> 4907 {{/if}} 4908 {{#if unitname}} 4909 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("Unit"): {{unitname}}</div> 4910 {{/if}} 4911 4912 <div class="d-flex justify-content-between mb-2"> 4913 {{#if HasUnitQuantityPriceDiscount }} 4914 <div class="u-bold"> 4915 {{UnitPrice}} 4916 </div> 4917 <div class="before-price">{{DiscountPrice}}</div> 4918 {{else if onSale }} 4919 <div class="small"> 4920 <div class="u-bold"> 4921 {{DiscountPrice}} 4922 </div> 4923 <div class="before-price">{{UnitPrice}}</div> 4924 </div> 4925 {{else}} 4926 <div>{{UnitPrice}}</div> 4927 {{/if}} 4928 4929 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod" style="width:auto;"> 4930 </div> 4931 4932 4933 @Translate("Qty"): 4934 <input class="u-w40px cart-input-quantity js-quantity-input dw-mod" id="Quantity_{{orderLineId}}" type="number" min="1" onchange="Cart.ChangeQuantity('@cartOrderlinesFeedPageId', '{{orderLineId}}', this.value)" name='QuantityOrderLine{{orderLineId}}' value="{{quantity}}" aria-label="@Translate("Quantity") {{quantity}}"> 4935 </div> 4936 4937 <div class="grid__cell-footer"> 4938 <div class="grid__cell"> 4939 <div class="u-pull--left mini-cart-orderline__price dw-mod"> 4940 {{#if pointsTotal}} 4941 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 4942 {{else}} 4943 {{TotalPrice}} 4944 {{/if}} 4945 </div> 4946 <button type="button" title="@Translate("Remove orderline")" class="btn btn--clean btn--condensed u-pull--right mini-cart-orderline__remove-btn dw-mod" onclick="{{removeFromCartGoogleImpression}}; Cart.UpdateCart('Cart', '/Default.aspx?ID=@cartOrderlinesFeedPageId', 'CartCmd=DelOrderLine&key={{orderLineId}}', true);">@Translate("Remove")</button> 4947 </div> 4948 </div> 4949 </div> 4950 </div> 4951 {{/unless}} 4952 </script> 4953 4954 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 4955 {{#unless isEmpty}} 4956 {{#ifCond OrderLineType "!==" "3"}} 4957 <div class="mini-cart-orderline mini-cart-orderline--discount grid dw-mod"> 4958 <div class="grid__col-4"> 4959 </div> 4960 <div class="grid__col-8"> 4961 <div class="mini-cart-orderline__name mini-cart-orderline__name--truncate mini-cart-orderline__name--lg u-padding-right--lg" title="{{name}}"><strong>{{name}}</strong></div> 4962 4963 <div class="grid__cell-footer"> 4964 <div class="grid__cell"> 4965 <div class="u-pull--left mini-cart-orderline__price dw-mod"> 4966 {{TotalPrice}} 4967 </div> 4968 </div> 4969 </div> 4970 4971 </div> 4972 {{/ifCond}} 4973 </div> 4974 {{/unless}} 4975 </script> 4976 } 4977 4978 @helper RenderMiniCartScriptTemplates() 4979 { 4980 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMiniCartTemplates").OrderBy(item => item.SortId).ToList(); 4981 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 4982 string cartPageLink = string.Concat("/Default.aspx?ID=", GetPageIdByNavigationTag("CartPage")); 4983 4984 <script id="MiniCartContent" type="text/x-template"> 4985 {{#.}} 4986 {{#unless isEmpty}} 4987 @if (useGoogleTagManager) 4988 { 4989 <text>{{{googleEnchantImpressionEmptyCart OrderLines}}}</text> 4990 } 4991 @RenderBlockList(subBlocks) 4992 {{/unless}} 4993 {{#if isEmpty}} 4994 {{{locationReload '@cartPageLink'}}} 4995 {{/if}} 4996 {{/.}} 4997 </script> 4998 } 4999 5000 @helper RenderMiniCartOrderLinesTable() 5001 { 5002 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 5003 5004 <div class="u-overflow-auto"> 5005 <table class="table mini-cart-table dw-mod"> 5006 @RenderBlockList(subBlocks) 5007 </table> 5008 </div> 5009 } 5010 5011 @helper RenderMiniCartOrderLinesBlocks() 5012 { 5013 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 5014 5015 <div class="u-overflow-auto"> 5016 @RenderBlockList(subBlocks) 5017 </div> 5018 } 5019 5020 @helper RenderMiniCartOrderLinesHeader() 5021 { 5022 <thead> 5023 <tr> 5024 <td>&nbsp;</td> 5025 <td>@Translate("Product")</td> 5026 <td class="u-ta-right">@Translate("Qty")</td> 5027 <td class="u-ta-right" width="120">@Translate("Price")</td> 5028 </tr> 5029 </thead> 5030 } 5031 5032 @helper RenderMiniCartOrderLinesList() 5033 { 5034 <text> 5035 {{#OrderLines}} 5036 {{#ifCond template "===" "CartOrderline"}} 5037 {{>MiniCartOrderline}} 5038 {{/ifCond}} 5039 {{#ifCond template "===" "CartOrderlineDiscount"}} 5040 {{>MiniCartOrderlineDiscount}} 5041 {{/ifCond}} 5042 {{#ifCond template "===" "CartOrderlineMobile"}} 5043 {{>MiniCartOrderline}} 5044 {{/ifCond}} 5045 {{/OrderLines}} 5046 </text> 5047 } 5048 5049 @helper RenderMiniCartFees() 5050 { 5051 <div class="grid u-border-top grid--external-bleed-bottom"> 5052 <div class="grid__col-6 u-bold u-no-padding-bottom no-padding-left no-padding-right"> 5053 @Translate("Subtotal") 5054 </div> 5055 <div class="grid__col-6 grid--align-end u-bold u-no-padding-bottom no-padding-left no-padding-right">{{subtotalprice}}</div> 5056 </div> 5057 5058 <div class="grid grid--external-bleed-bottom u-no-padding-bottom "> 5059 {{#ifCond shippingfeeDouble '>' 0}} 5060 <div class="grid__col-6 no-padding-left no-padding-right"> 5061 {{shippingmethod}} 5062 </div> 5063 <div class="grid__col-6 grid--align-end u-no-padding-bottom no-padding-left no-padding-right">{{shippingfee}}</div> 5064 {{/ifCond}} 5065 5066 <div class="grid__col-6 no-padding-left no-padding-right"> 5067 @Translate("VAT") 5068 </div> 5069 <div class="grid__col-6 grid--align-end u-no-padding-bottom no-padding-left no-padding-right">{{totalvat}}</div> 5070 5071 </div> 5072 5073 5074 5075 } 5076 5077 @helper RenderMiniCartFooter() 5078 { 5079 5080 bool showNumber = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowProductNumber"); 5081 bool showPrice = !Pageview.AreaSettings.GetItem("ProductList").GetBoolean("HidePrice"); 5082 bool onlyPreview = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Pageview.User == null; 5083 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 5084 bool showVATPrice = Pageview.AreaSettings.GetItem("ProductList").GetBoolean("ShowBothPricesWithWithoutVAT"); 5085 bool isPricesWithVATEnabled = true; 5086 bool showStaticVariants = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowStaticVariants"); 5087 string footerClasses = showStaticVariants ? "u-min-h120px" : ""; 5088 bool showCartButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowAddToCartButton"); 5089 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fas fa-shopping-cart"; 5090 string viewMoreText = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("ViewMoreText")) ? Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetString("ViewMoreText") : "View"; 5091 bool showViewButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowViewButton"); 5092 bool showStock = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowStockAndShipping"); 5093 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("ProductList").GetItem("GridView").GetBoolean("ShowAddToDownloadButton"); 5094 5095 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartFooter").OrderBy(item => item.SortId).ToList(); 5096 5097 <div class="mini-cart__footer dw-mod mb-3"> 5098 @RenderBlockList(subBlocks) 5099 </div> 5100 5101 <div class="hd2412-relewise border-top-container py-3 px-2" style="background: #f8f8f8;"> 5102 5103 <h5 class="px-3 mb-3">@Translate("Relewise - Purchased With", "Andre købte også")</h5> 5104 5105 <div class="hd2412-relewise-container"> 5106 {{#each Recommendations as | recommendation | }} 5107 5108 <li class="recommendation clerk-product row d-flex flex-column flex-lg-row px-4 border mb-3 " > 5109 <div class="grid__cell product-list__grid-item__image dw-mod col-12 col-lg-3"> 5110 <a href="{{recommendation.Url}}" class="u-block u-position-relative image-hover__wrapper dw-mod"> 5111 <img style="object-fit: contain; aspect-ratio: 4/3;" src="{{recommendation.Thumbnail}}" alt="{{recommendation.Name}}" class="grid__cell-img grid__cell-img--centered u-padding"/> 5112 </a> 5113 </div> 5114 <div class="grid__cell dw-mod col-12 col-lg-6"> 5115 <h6 class="clerk-product-name mb-0 u-margin-bottom--lg js-hd2412-product-name" data-product-name="{{ recommendation.Name }}" style="font-size: 14px; hyphens: auto;">{{ recommendation.Name }}</h6> 5116 <div style="font-size: 14px; hyphens: auto; font-family: 'KobenhavnBold',sans-serif;" class="clerk-product-price price dw-mod">{{ recommendation.PriceFormatted }} {{recommendation.CurrencyCode}}</div> 5117 @*<div style="font-size: 14px; hyphens: auto;" class="erp-unit-price">( {{ recommendation.ErpUnitPrice }} / {{ recommendation.DefaultUnitName }} )</div>*@ 5118 </div> 5119 <div class="related-product-footer dw-mod col"> 5120 <div class="u-ta-center u-flex u-full-width"> 5121 {{#if recommendation.Variants}} 5122 <div class="buttons-collection related-buttons-container u-full-width cartbutton-buy mt-0 " style=" justify-content: flex-end;"> 5123 <a href="{{recommendation.Url}}" 5124 class="m-0 u-margin-left js-cart-btn btn btn--condensed u-no-margin u-pull--right dw-mod" 5125 title="@Translate("View more", "View more")"> 5126 <span class="icon-nz icon-nz-arrow-long-right"></span> 5127 </a> 5128 </div> 5129 {{else}} 5130 <div class="buttons-collection related-buttons-container u-full-width cartbutton-buy mt-0 " style=" justify-content: flex-end;"> 5131 <input type="number" class="d-none u-w50px u-no-margin u-margin-right use-btn-primary-height u-ta-center js-quantity-input" id="{{quantityId}}" name="{{quantityName}}" data-id="{{recommendation.BuyProductId}}" value="1" min="1" max="{{recommendation.Stock}}"> 5132 5133 <button style="line-height: 20px; min-height: 20px !important; width: auto;" type="button" id="CartButton_{{recommendation.BuyProductId}}" class="m-0 u-margin-left js-cart-btn btn btn--primary btn--condensed u-no-margin u-pull--right dw-mod {{recommendation.disabledBuyButton}}" name="submit" 5134 onclick="Cart.AddToCart(event, { 5135 id: '{{recommendation.BuyProductId}}', 5136 variantId: '{{recommendation.Variantid}}', 5137 unitId: '{{recommendation.UnitId}}', 5138 quantity: 1, 5139 productInfo: '{{recommendation.ProductInfo}}' 5140 })" {{recommendation.disabledBuyButton}}> 5141 <span class="icon-nz icon-nz-cart dw-mod"></span> 5142 </button> 5143 </div> 5144 5145 <div class="buttons-collection related-buttons-container u-full-width cartbutton-viewmore mt-3"> 5146 <a href="{{recommendation.Url}}" 5147 class="btn btn--secondary use-btn-primary-height use-btn-primary-width btn--condensed text-uppercase u-no-margin dw-mod" title="{{recommendation.AddToCartText}}"><strong>{{ recommendation.AddToCartText }}</strong> 5148 </a> 5149 </div> 5150 {{/if}} 5151 </div> 5152 </div> 5153 </li> 5154 5155 {{/each}} 5156 </div> 5157 </div> 5158 5159 } 5160 5161 @helper RenderMiniCartActions() 5162 { 5163 int cartPageId = GetPageIdByNavigationTag("CartPage"); 5164 5165 <button type="button" title="@Translate("Empty cart")" class="d-none btn btn-clear-cart no-padding-left" onclick="googleEnchantImpressionEmptyCart(); Cart.EmptyCart(event);">@Translate("Empty cart")</button> 5166 <a href="/Default.aspx?ID=@cartPageId" title="@Translate("Proceed to checkout")" class="btn btn--primary u-no-margin dw-mod u-pull--right text-uppercase">@Translate("Proceed to checkout")</a> 5167 } 5168 5169 @helper RenderMiniCartPoints() 5170 { 5171 <text> 5172 {{#if earnings}} 5173 <div class="grid grid--external-bleed-bottom"> 5174 <div class="grid__col-6">@Translate("Earnings")</div> 5175 <div class="grid__col-6 grid--align-end"> 5176 <div> 5177 <span class="u-color--loyalty-points">{{earnings}}</span> @Translate("points") 5178 </div> 5179 </div> 5180 </div> 5181 {{/if}} 5182 </text> 5183 } 5184 5185 @helper RenderMiniCartTotal() 5186 { 5187 <div class="mini-cart-totals grid u-margin-bottom dw-mod "> 5188 <div class="grid__col-6 no-padding-left no-padding-right">@Translate("Total") (@Translate("VAT Inclusive", "Inkl. moms"))</div> 5189 <div class="grid__col-6 grid--align-end no-padding-left no-padding-right">{{totalprice}}</div> 5190 </div> 5191 } 5192 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5193 5194 @using Dynamicweb.Rapido.Blocks.Extensibility 5195 @using Dynamicweb.Rapido.Blocks 5196 5197 @{ 5198 bool addToCartNotificationOnlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 5199 string addToCartNotificationType = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType").SelectedValue : ""; 5200 5201 if (!addToCartNotificationOnlyPreview && !string.IsNullOrEmpty(addToCartNotificationType)) { 5202 if (addToCartNotificationType == "modal") 5203 { 5204 Block addToCartNotificationModal = new Block 5205 { 5206 Id = "AddToCartNotificationModal", 5207 Template = RenderAddToCartNotificationModal() 5208 }; 5209 5210 Block addToCartNotificationScript = new Block 5211 { 5212 Id = "AddToCartNotificationScript", 5213 Template = RenderAddToCartNotificationModalScript() 5214 }; 5215 BlocksPage.GetBlockPage("Master").Add("MasterTopSnippets", addToCartNotificationModal); 5216 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 5217 } 5218 else if (addToCartNotificationType == "toggle") 5219 { 5220 Block addToCartNotificationScript = new Block 5221 { 5222 Id = "AddToCartNotificationScript", 5223 Template = RenderAddToCartNotificationToggleScript() 5224 }; 5225 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 5226 } 5227 } 5228 } 5229 5230 @helper RenderAddToCartNotificationModal() 5231 { 5232 <div id="LastAddedProductModal" data-template="LastAddedProductTemplate"></div> 5233 } 5234 5235 @helper RenderAddToCartNotificationModalScript() 5236 { 5237 int cartPageId = GetPageIdByNavigationTag("CartPage"); 5238 5239 <script id="LastAddedProductTemplate" type="text/x-template"> 5240 <!-- Trigger for the login modal --> 5241 <input type="checkbox" id="LastAddedProductModalTrigger" class="modal-trigger" /> 5242 5243 <!-- Login modal --> 5244 <div class="modal-container"> 5245 <label for="LastAddedProductModalTrigger" class="modal-overlay"></label> 5246 <div class="modal modal--md"> 5247 <div class="modal__header"> 5248 <h2>@Translate("Product is added to the cart")</h2> 5249 </div> 5250 <div class="modal__body"> 5251 <div class="grid"> 5252 <div class="grid__col-2"> 5253 <a href="{{productInfo.link}}"> 5254 <img src="{{productInfo.image}}" alt="{{productInfo.name}}" class="dw-mod" /> 5255 </a> 5256 </div> 5257 <div class="u-padding grid--align-self-center"> 5258 <span>{{quantity}}</span> x 5259 </div> 5260 <div class="grid__col-auto grid--align-self-center"> 5261 <div>{{productInfo.name}}</div> 5262 {{#if productInfo.variantName}} 5263 <small class="u-margin-bottom-5px">{{productInfo.variantName}}</small> 5264 {{/if}} 5265 {{#if productInfo.unitName}} 5266 <small class="u-margin-bottom-5px">{{productInfo.unitName}}</small> 5267 {{/if}} 5268 </div> 5269 </div> 5270 <div class="modal__footer u-margin-top--lg"> 5271 <label class="btn btn--secondary u-pull--left u-no-margin dw-mod btn--sm" for="LastAddedProductModalTrigger">@Translate("Continue shopping")</label> 5272 <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> 5273 </div> 5274 </div> 5275 <label class="modal__close-btn" for="LastAddedProductModalTrigger"></label> 5276 </div> 5277 </div> 5278 </script> 5279 <script> 5280 document.addEventListener('addToCart', function (event) { 5281 Cart.ShowLastAddedProductModal(event.detail); 5282 }); 5283 </script> 5284 } 5285 5286 @helper RenderAddToCartNotificationToggleScript() 5287 { 5288 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 5289 5290 <script> 5291 document.addEventListener('addToCart', function () { 5292 Cart.ToggleMiniCart('miniCartTrigger', 'miniCart', 'cartCounter', '@miniCartFeedPageId'); 5293 }); 5294 </script> 5295 } 5296 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5297 5298 @using System 5299 @using System.Web 5300 @using System.Collections.Generic 5301 @using Dynamicweb.Rapido.Blocks.Extensibility 5302 @using Dynamicweb.Rapido.Blocks 5303 5304 @functions { 5305 BlocksPage footerBlocksPage = BlocksPage.GetBlockPage("Master"); 5306 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 5307 } 5308 5309 @{ 5310 string footerColumnOneContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne").GetString("Content"); 5311 string footerColumnTwoContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo").GetString("Content"); 5312 string footerColumnThreeContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree").GetString("Content"); 5313 string footerColumnOneHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne").GetString("Header"); 5314 string footerColumnTwoHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo").GetString("Header"); 5315 string footerColumnThreeHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree").GetString("Header"); 5316 5317 Block masterFooterContent = new Block() 5318 { 5319 Id = "MasterFooterContent", 5320 SortId = 10, 5321 Template = RenderFooter(), 5322 SkipRenderBlocksList = true 5323 }; 5324 footerBlocksPage.Add(MasterBlockId.MasterFooter, masterFooterContent); 5325 5326 if (!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) 5327 { 5328 Block masterFooterColumnOne = new Block 5329 { 5330 Id = "MasterFooterColumnOne", 5331 SortId = 20, 5332 Template = RenderFooterColumn(footerColumnOneHeader, footerColumnOneContent), 5333 Design = new Design 5334 { 5335 Size = "auto", 5336 RenderType = RenderType.Column 5337 } 5338 }; 5339 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnOne); 5340 } 5341 5342 if (!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) 5343 { 5344 Block masterFooterColumnTwo = new Block 5345 { 5346 Id = "MasterFooterColumnTwo", 5347 SortId = 30, 5348 Template = RenderFooterColumnTwo(footerColumnTwoHeader, footerColumnTwoContent), 5349 Design = new Design 5350 { 5351 Size = "auto", 5352 RenderType = RenderType.Column 5353 } 5354 }; 5355 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnTwo); 5356 } 5357 5358 if (!string.IsNullOrEmpty(footerColumnThreeContent) || !string.IsNullOrEmpty(footerColumnThreeHeader)) 5359 { 5360 Block masterFooterColumnThree = new Block 5361 { 5362 Id = "MasterFooterColumnThree", 5363 SortId = 40, 5364 Template = RenderFooterColumnThree(footerColumnThreeHeader, footerColumnThreeContent), 5365 Design = new Design 5366 { 5367 Size = "auto", 5368 RenderType = RenderType.Column 5369 } 5370 }; 5371 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnThree); 5372 } 5373 5374 if (Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks") != null && Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks").Count > 0 && siteURL.Contains("hededanmark")) 5375 { 5376 Block masterFooterSocialLinks = new Block 5377 { 5378 Id = "MasterFooterSocialLinks", 5379 SortId = 50, 5380 Template = RenderFooterSocialLinks(), 5381 Design = new Design 5382 { 5383 Size = "auto", 5384 RenderType = RenderType.Column 5385 } 5386 }; 5387 footerBlocksPage.Add("MasterFooterContent", masterFooterSocialLinks); 5388 } 5389 5390 if (Model.Area.Item.GetItem("Layout").GetItems("FooterPayments") != null && Model.Area.Item.GetItem("Layout").GetItems("FooterPayments").Count > 0) 5391 { 5392 Block masterFooterPayments = new Block 5393 { 5394 Id = "MasterFooterPayments", 5395 SortId = 60, 5396 Template = RenderFooterPayments(), 5397 Design = new Design 5398 { 5399 Size = "12", 5400 RenderType = RenderType.Column 5401 } 5402 }; 5403 footerBlocksPage.Add("MasterFooterContent", masterFooterPayments); 5404 } 5405 5406 if (Model.Area.Item.GetItem("Layout").GetString("FooterCopyrightText") != "") 5407 { 5408 Block masterFooterCopyright = new Block 5409 { 5410 Id = "MasterFooterCopyright", 5411 SortId = 70, 5412 Template = RenderFooterCopyright(), 5413 Design = new Design 5414 { 5415 Size = "12", 5416 RenderType = RenderType.Column 5417 } 5418 }; 5419 footerBlocksPage.Add("MasterFooterContent", masterFooterCopyright); 5420 5421 } 5422 5423 //If sentence to check if the FooterLogo has content or not 5424 5425 if (Model.Area.Item.GetItem("Layout").GetValue("FooterLogo") != null) 5426 { 5427 Block masterFooterLogo = new Block 5428 { 5429 Id = "MasterFooterLogo", 5430 SortId = 1, 5431 Template = RenderFooterLogo(), 5432 Design = new Design 5433 { 5434 Size = "auto", 5435 RenderType = RenderType.Column 5436 } 5437 }; 5438 footerBlocksPage.Add("MasterFooterContent", masterFooterLogo); 5439 } 5440 } 5441 5442 @helper RenderFooter() 5443 { 5444 List<Block> subBlocks = this.footerBlocksPage.GetBlockListById("MasterFooterContent").OrderBy(item => item.SortId).ToList(); 5445 5446 <footer class="footer dw-mod"> 5447 @RenderFooterLinks() 5448 @RenderFooterNewsletterSignUp() 5449 <div class="center-container top-container__center-container dw-mod"> 5450 <div class="grid grid--external-bleed-x u-padding-top--lg"> 5451 @RenderBlockList(subBlocks) 5452 </div> 5453 </div> 5454 </footer> 5455 } 5456 5457 @helper RenderFooterLinks() 5458 { 5459 <div class="footer__content u-padding u-brand-color-one--bg bottom-navigation-container dw-mod u-flex"> 5460 @{ 5461 string firstPageLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FirstPage"); 5462 string firstPageText = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FirstLinkText"); 5463 5464 string secondPageLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("SecondPage"); 5465 string secondPageText = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("SecondLinkText"); 5466 5467 string thirdPageLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("ThirdPage"); 5468 string thirdPageText = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("ThirdLinkText"); 5469 5470 string fourthPageLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FourthPage"); 5471 string fourthPageText = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FourthLinkText"); 5472 5473 } 5474 5475 @if (!string.IsNullOrEmpty(firstPageText)) 5476 { 5477 <div class="grid__col-lg-6 grid__col-sm-10 grid__col-md-10 grid__col-12 grid__col--bleed grid--direction-row grid--align-center footer-navigation-bar"> 5478 <div class="grid__col-md-2 grid__col-12 grid--align-center u-no-padding-bottom-xs"> 5479 @if (!string.IsNullOrEmpty(firstPageLink)) 5480 { 5481 <a href="@firstPageLink" class="u-color-light" target="_self" rel="nofollow"> 5482 @firstPageText 5483 </a> 5484 } 5485 5486 else 5487 { 5488 <span class="u-color-light"> 5489 @firstPageText 5490 </span> 5491 } 5492 5493 </div> 5494 <div class="grid__col-md-1 grid__col-12 grid--direction-row grid--align-center grid--justify-center u-no-padding-bottom-xs"> 5495 <span>-</span> 5496 5497 </div> 5498 <div class="grid__col-md-2 grid__col-12 grid--align-center u-no-padding-bottom-xs"> 5499 @if (!string.IsNullOrEmpty(secondPageLink)) 5500 { 5501 <a href="@secondPageLink" class="u-color-light" target="_self" rel="nofollow"> 5502 @secondPageText 5503 </a> 5504 } 5505 5506 else 5507 { 5508 <span class="u-color-light"> 5509 @secondPageText 5510 </span> 5511 } 5512 5513 </div> 5514 <div class="grid__col-md-1 grid__col-12 grid--direction-row grid--align-center grid--justify-center u-no-padding-bottom-xs"> 5515 <span>-</span> 5516 5517 </div> 5518 <div class="grid__col-md-2 grid__col-12 grid--align-center u-no-padding-bottom-xs"> 5519 @if (!string.IsNullOrEmpty(thirdPageLink)) 5520 { 5521 <a href="@thirdPageLink" class="u-color-light" target="_self" rel="nofollow"> 5522 @thirdPageText 5523 </a> 5524 } 5525 else 5526 { 5527 <span class="u-color-light"> 5528 @thirdPageText 5529 </span> 5530 } 5531 </div> 5532 5533 <div class="grid__col-md-1 grid__col-12 grid--direction-row grid--align-center grid--justify-center u-no-padding-bottom-xs"> 5534 <span>-</span> 5535 5536 </div> 5537 5538 5539 <div class="grid__col-md-2 grid__col-12 grid--align-center"> 5540 @if (!string.IsNullOrEmpty(fourthPageLink)) 5541 { 5542 <a href="@fourthPageLink" class="u-color-light" target="_self" rel="nofollow"> 5543 @fourthPageText 5544 </a> 5545 } 5546 else 5547 { 5548 <span class="u-color-light"> 5549 @fourthPageText 5550 </span> 5551 } 5552 </div> 5553 </div> 5554 } 5555 </div> 5556 } 5557 5558 5559 @helper RenderFooterColumn(string header, string content) 5560 { 5561 <div class="footer__content dw-mod u-flex grid--justify-start"> 5562 <div class="u-flex grid__col-12 grid--align-start"> 5563 <strong class="footer__heading dw-mod">@header</strong> 5564 <div class="footer-content-rte"> 5565 @content 5566 5567 </div> 5568 5569 </div> 5570 </div> 5571 } 5572 5573 @helper RenderFooterColumnTwo(string header, string content) 5574 { 5575 <div class="footer__content dw-mod u-flex grid--justify-start"> 5576 <div class="u-flex grid__col-12 grid--align-start"> 5577 <strong class="footer__heading dw-mod">@header</strong> 5578 <div class="footer-content-rte"> 5579 @content 5580 5581 </div> 5582 5583 </div> 5584 </div> 5585 } 5586 5587 @helper RenderFooterColumnThree(string header, string content) 5588 { 5589 <div class="footer__content dw-mod u-flex grid--justify-start"> 5590 <div class="u-flex grid__col-12 grid--align-start"> 5591 <strong class="footer__heading dw-mod">@header</strong> 5592 <div class="footer-content-rte"> 5593 5594 @content 5595 5596 </div> 5597 5598 </div> 5599 </div> 5600 } 5601 5602 @helper RenderFooterNewsletterSignUp() 5603 { 5604 bool newsletterCheckBox = Model.Area.Item.GetItem("Layout").GetBoolean("FooterNewsletterSignUp"); 5605 string formId = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FormId"); 5606 string formAction = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FormAction"); 5607 string newsletterId = $"_form_{formId}_"; 5608 string submitForm = $"_form_{formId}_submit"; 5609 string hiddenFields = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("HiddenFields"); 5610 string recaptchaId = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("RecaptchaId"); 5611 5612 if (newsletterCheckBox) 5613 { 5614 <div class="footer__content footer__content-newsletter dw-mod"> 5615 <form class="form center-container dw-mod" name="NewsletterRedirect" action="@formAction" id="@newsletterId" method="get" enctype="multipart/form-data"> 5616 @hiddenFields 5617 <div class="grid__col-12 grid__col--bleed newsletter-grid--direction-row"> 5618 <div class="grid__col-lg-3 grid__col-12 mailing-list-container"> 5619 <h3>@Translate("Mailing list")</h3> 5620 </div> 5621 <div class="grid__col-lg-3 grid__col-12 footer-newsletter-item"> 5622 <input name="fullname" id="NewsletterName" type="text" placeholder='@Translate("Your name", "Your name")' class="newsletter-input" aria-label="newsletter fullname" /> 5623 </div> 5624 <div class="grid__col-lg-3 grid__col-12 footer-newsletter-item"> 5625 <input name="email" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' class="newsletter-input" aria-label="newsletter email" /> 5626 </div> 5627 5628 @if (!string.IsNullOrEmpty(recaptchaId)) 5629 { 5630 <div class="grid__col-lg-4 grid__col-12"> 5631 <div class="g-recaptcha" data-callback="recaptchaCallback" data-sitekey="@recaptchaId"> 5632 </div> 5633 </div> 5634 <div class="grid__col-lg-3 grid__col-12 submit footer-newsletter-item"> 5635 <input class="btn btn--secondary btn--condensed newsletter-submit u-bold js-submit-form" type="submit" disabled id="@submitForm" value='@Translate("Go", "Go")' aria-label="submit newsletter form" /> 5636 </div> 5637 } 5638 else 5639 { 5640 <div class="grid__col-lg-3 grid__col-12 submit footer-newsletter-item"> 5641 <input class="btn btn--secondary btn--condensed newsletter-submit u-bold" type="submit" id="@submitForm" value='@Translate("Go", "Go")' aria-label="submit newsletter form" /> 5642 </div> 5643 } 5644 5645 </div> 5646 </form> 5647 </div> 5648 5649 <script defer type="text/javascript"> 5650 window.cfields = []; 5651 window._show_thank_you = function(id, message, trackcmp_url) { 5652 var form = document.getElementById('_form_' + id + '_'), thank_you = form.querySelector('._form-thank-you'); 5653 form.querySelector('._form-content').style.display = 'none'; 5654 thank_you.innerHTML = message; 5655 thank_you.style.display = 'block'; 5656 if (typeof(trackcmp_url) != 'undefined' && trackcmp_url) { 5657 // Site tracking URL to use after inline form submission. 5658 _load_script(trackcmp_url); 5659 } 5660 if (typeof window._form_callback !== 'undefined') window._form_callback(id); 5661 }; 5662 window._show_error = function(id, message, html) { 5663 var form = document.getElementById('_form_' + id + '_'), err = document.createElement('div'), button = form.querySelector('button'), old_error = form.querySelector('._form_error'); 5664 if (old_error) old_error.parentNode.removeChild(old_error); 5665 err.innerHTML = message; 5666 err.className = '_error-inner _form_error _no_arrow'; 5667 var wrapper = document.createElement('div'); 5668 wrapper.className = '_form-inner'; 5669 wrapper.appendChild(err); 5670 button.parentNode.insertBefore(wrapper, button); 5671 document.querySelector('[id^="_form"][id$="_submit"]').disabled = false; 5672 if (html) { 5673 var div = document.createElement('div'); 5674 div.className = '_error-html'; 5675 div.innerHTML = html; 5676 err.appendChild(div); 5677 } 5678 }; 5679 window._load_script = function(url, callback) { 5680 var head = document.querySelector('head'), script = document.createElement('script'), r = false; 5681 script.type = 'text/javascript'; 5682 script.charset = 'utf-8'; 5683 script.src = url; 5684 if (callback) { 5685 script.onload = script.onreadystatechange = function() { 5686 if (!r && (!this.readyState || this.readyState == 'complete')) { 5687 r = true; 5688 callback(); 5689 } 5690 }; 5691 } 5692 head.appendChild(script); 5693 }; 5694 (function() { 5695 if (window.location.search.search("excludeform") !== -1) return false; 5696 var getCookie = function(name) { 5697 var match = document.cookie.match(new RegExp('(^|; )' + name + '=([^;]+)')); 5698 return match ? match[2] : null; 5699 } 5700 var setCookie = function(name, value) { 5701 var now = new Date(); 5702 var time = now.getTime(); 5703 var expireTime = time + 1000 * 60 * 60 * 24 * 365; 5704 now.setTime(expireTime); 5705 document.cookie = name + '=' + value + '; expires=' + now + ';path=/'; 5706 } 5707 var addEvent = function(element, event, func) { 5708 if (element.addEventListener) { 5709 element.addEventListener(event, func); 5710 } else { 5711 var oldFunc = element['on' + event]; 5712 element['on' + event] = function() { 5713 oldFunc.apply(this, arguments); 5714 func.apply(this, arguments); 5715 }; 5716 } 5717 } 5718 var _removed = false; 5719 var form_to_submit = document.getElementById('@newsletterId'); 5720 var allInputs = form_to_submit.querySelectorAll('input, select, textarea'), tooltips = [], submitted = false; 5721 5722 var getUrlParam = function(name) { 5723 var regexStr = '[\?&]' + name + '=([^&#]*)'; 5724 var results = new RegExp(regexStr, 'i').exec(window.location.href); 5725 return results != undefined ? decodeURIComponent(results[1]) : false; 5726 }; 5727 5728 for (var i = 0; i < allInputs.length; i++) { 5729 var regexStr = "field\\[(\\d+)\\]"; 5730 var results = new RegExp(regexStr).exec(allInputs[i].name); 5731 if (results != undefined) { 5732 allInputs[i].dataset.name = window.cfields[results[1]]; 5733 } else { 5734 allInputs[i].dataset.name = allInputs[i].name; 5735 } 5736 var fieldVal = getUrlParam(allInputs[i].dataset.name); 5737 5738 if (fieldVal) { 5739 if (allInputs[i].type == "radio" || allInputs[i].type == "checkbox") { 5740 if (allInputs[i].value == fieldVal) { 5741 allInputs[i].checked = true; 5742 } 5743 } else { 5744 allInputs[i].value = fieldVal; 5745 } 5746 } 5747 } 5748 5749 var remove_tooltips = function() { 5750 for (var i = 0; i < tooltips.length; i++) { 5751 tooltips[i].tip.parentNode.removeChild(tooltips[i].tip); 5752 } 5753 tooltips = []; 5754 }; 5755 var remove_tooltip = function(elem) { 5756 for (var i = 0; i < tooltips.length; i++) { 5757 if (tooltips[i].elem === elem) { 5758 tooltips[i].tip.parentNode.removeChild(tooltips[i].tip); 5759 tooltips.splice(i, 1); 5760 return; 5761 } 5762 } 5763 }; 5764 var create_tooltip = function(elem, text) { 5765 var tooltip = document.createElement('div'), arrow = document.createElement('div'), inner = document.createElement('div'), new_tooltip = {}; 5766 if (elem.type != 'radio' && elem.type != 'checkbox') { 5767 tooltip.className = '_error'; 5768 arrow.className = '_error-arrow'; 5769 inner.className = '_error-inner'; 5770 inner.innerHTML = text; 5771 tooltip.appendChild(arrow); 5772 tooltip.appendChild(inner); 5773 elem.parentNode.appendChild(tooltip); 5774 } else { 5775 tooltip.className = '_error-inner _no_arrow'; 5776 tooltip.innerHTML = text; 5777 elem.parentNode.insertBefore(tooltip, elem); 5778 new_tooltip.no_arrow = true; 5779 } 5780 new_tooltip.tip = tooltip; 5781 new_tooltip.elem = elem; 5782 tooltips.push(new_tooltip); 5783 return new_tooltip; 5784 }; 5785 var resize_tooltip = function(tooltip) { 5786 var rect = tooltip.elem.getBoundingClientRect(); 5787 var doc = document.documentElement, scrollPosition = rect.top - ((window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0)); 5788 if (scrollPosition < 40) { 5789 tooltip.tip.className = tooltip.tip.className.replace(/ ?(_above|_below) ?/g, '') + ' _below'; 5790 } else { 5791 tooltip.tip.className = tooltip.tip.className.replace(/ ?(_above|_below) ?/g, '') + ' _above'; 5792 } 5793 }; 5794 var resize_tooltips = function() { 5795 if (_removed) return; 5796 for (var i = 0; i < tooltips.length; i++) { 5797 if (!tooltips[i].no_arrow) resize_tooltip(tooltips[i]); 5798 } 5799 }; 5800 var validate_field = function(elem, remove) { 5801 var tooltip = null, value = elem.value, no_error = true; 5802 remove ? remove_tooltip(elem) : false; 5803 if (elem.type != 'checkbox') elem.className = elem.className.replace(/ ?_has_error ?/g, ''); 5804 if (elem.getAttribute('required') !== null) { 5805 if (elem.type == 'radio' || (elem.type == 'checkbox' && /any/.test(elem.className))) { 5806 var elems = form_to_submit.elements[elem.name]; 5807 if (!(elems instanceof NodeList || elems instanceof HTMLCollection) || elems.length <= 1) { 5808 no_error = elem.checked; 5809 } 5810 else { 5811 no_error = false; 5812 for (var i = 0; i < elems.length; i++) { 5813 if (elems[i].checked) no_error = true; 5814 } 5815 } 5816 if (!no_error) { 5817 tooltip = create_tooltip(elem, "Please select an option."); 5818 } 5819 } else if (elem.type =='checkbox') { 5820 var elems = form_to_submit.elements[elem.name], found = false, err = []; 5821 no_error = true; 5822 for (var i = 0; i < elems.length; i++) { 5823 if (elems[i].getAttribute('required') === null) continue; 5824 if (!found && elems[i] !== elem) return true; 5825 found = true; 5826 elems[i].className = elems[i].className.replace(/ ?_has_error ?/g, ''); 5827 if (!elems[i].checked) { 5828 no_error = false; 5829 elems[i].className = elems[i].className + ' _has_error'; 5830 err.push("Checking %s is required".replace("%s", elems[i].value)); 5831 } 5832 } 5833 if (!no_error) { 5834 tooltip = create_tooltip(elem, err.join('<br/>')); 5835 } 5836 } else if (elem.tagName == 'SELECT') { 5837 var selected = true; 5838 if (elem.multiple) { 5839 selected = false; 5840 for (var i = 0; i < elem.options.length; i++) { 5841 if (elem.options[i].selected) { 5842 selected = true; 5843 break; 5844 } 5845 } 5846 } else { 5847 for (var i = 0; i < elem.options.length; i++) { 5848 if (elem.options[i].selected && !elem.options[i].value) { 5849 selected = false; 5850 } 5851 } 5852 } 5853 if (!selected) { 5854 elem.className = elem.className + ' _has_error'; 5855 no_error = false; 5856 tooltip = create_tooltip(elem, "Please select an option."); 5857 } 5858 } else if (value === undefined || value === null || value === '') { 5859 elem.className = elem.className + ' _has_error'; 5860 no_error = false; 5861 tooltip = create_tooltip(elem, "This field is required."); 5862 } 5863 } 5864 if (no_error && elem.name == 'email') { 5865 if (!value.match(/^[\+_a-z0-9-'&=]+(\.[\+_a-z0-9-']+)*@@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/i)) { 5866 elem.className = elem.className + ' _has_error'; 5867 no_error = false; 5868 tooltip = create_tooltip(elem, "Enter a valid email address."); 5869 } 5870 } 5871 if (no_error && /date_field/.test(elem.className)) { 5872 if (!value.match(/^\d\d\d\d-\d\d-\d\d$/)) { 5873 elem.className = elem.className + ' _has_error'; 5874 no_error = false; 5875 tooltip = create_tooltip(elem, "Enter a valid date."); 5876 } 5877 } 5878 tooltip ? resize_tooltip(tooltip) : false; 5879 return no_error; 5880 }; 5881 var needs_validate = function(el) { 5882 return el.name == 'email' || el.getAttribute('required') !== null; 5883 }; 5884 var validate_form = function(e) { 5885 var err = form_to_submit.querySelector('._form_error'), no_error = true; 5886 if (!submitted) { 5887 submitted = true; 5888 for (var i = 0, len = allInputs.length; i < len; i++) { 5889 var input = allInputs[i]; 5890 if (needs_validate(input)) { 5891 if (input.type == 'text') { 5892 addEvent(input, 'blur', function() { 5893 this.value = this.value.trim(); 5894 validate_field(this, true); 5895 }); 5896 addEvent(input, 'input', function() { 5897 validate_field(this, true); 5898 }); 5899 } else if (input.type == 'radio' || input.type == 'checkbox') { 5900 (function(el) { 5901 var radios = form_to_submit.elements[el.name]; 5902 for (var i = 0; i < radios.length; i++) { 5903 addEvent(radios[i], 'click', function() { 5904 validate_field(el, true); 5905 }); 5906 } 5907 })(input); 5908 } else if (input.tagName == 'SELECT') { 5909 addEvent(input, 'change', function() { 5910 validate_field(this, true); 5911 }); 5912 } else if (input.type == 'textarea'){ 5913 addEvent(input, 'input', function() { 5914 validate_field(this, true); 5915 }); 5916 } 5917 } 5918 } 5919 } 5920 remove_tooltips(); 5921 for (var i = 0, len = allInputs.length; i < len; i++) { 5922 var elem = allInputs[i]; 5923 if (needs_validate(elem)) { 5924 if (elem.tagName.toLowerCase() !== "select") { 5925 elem.value = elem.value.trim(); 5926 } 5927 validate_field(elem) ? true : no_error = false; 5928 } 5929 } 5930 if (!no_error && e) { 5931 e.preventDefault(); 5932 } 5933 resize_tooltips(); 5934 return no_error; 5935 }; 5936 addEvent(window, 'resize', resize_tooltips); 5937 addEvent(window, 'scroll', resize_tooltips); 5938 window['recaptcha_callback'] = function () { 5939 // Get all recaptchas in the DOM (there may be more than one form on the page). 5940 var recaptchas = document.getElementsByClassName("g-recaptcha"); 5941 for (var i in recaptchas) { 5942 // Set the recaptcha element ID, so the recaptcha can be applied to each element. 5943 var recaptcha_id = "recaptcha_" + i; 5944 recaptchas[i].id = recaptcha_id; 5945 var el = document.getElementById(recaptcha_id); 5946 if (el != null) { 5947 var sitekey = el.getAttribute("data-sitekey"); 5948 var stoken = el.getAttribute("data-stoken"); 5949 grecaptcha.render(recaptcha_id, { "sitekey": sitekey, "stoken": stoken }); 5950 } 5951 } 5952 }; _load_script("//www.google.com/recaptcha/api.js?onload=recaptcha_callback&render=explicit"); 5953 window._old_serialize = null; 5954 if (typeof serialize !== 'undefined') window._old_serialize = window.serialize; 5955 _load_script("//d3rxaij56vjege.cloudfront.net/form-serialize/0.3/serialize.min.js", function() { 5956 window._form_serialize = window.serialize; 5957 if (window._old_serialize) window.serialize = window._old_serialize; 5958 }); 5959 var form_submit = function(e) { 5960 e.preventDefault(); 5961 if (validate_form()) { 5962 // use this trick to get the submit button & disable it using plain javascript 5963 document.querySelector('#@submitForm').disabled = true; 5964 var serialized = _form_serialize(document.getElementById('@newsletterId')); 5965 var err = form_to_submit.querySelector('._form_error'); 5966 err ? err.parentNode.removeChild(err) : false; 5967 _load_script('@formAction' + '?' + serialized + '&jsonp=true'); 5968 } 5969 return false; 5970 }; 5971 addEvent(form_to_submit, 'submit', form_submit); 5972 })(); 5973 function recaptchaCallback() { 5974 $(".js-submit-form").removeAttr('disabled'); 5975 } 5976 5977 </script> 5978 } 5979 } 5980 5981 @helper RenderFooterSocialLinks() 5982 { 5983 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 5984 5985 if (Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks") != null) 5986 { 5987 if (siteURL.Contains("hededanmark")) 5988 { 5989 <div class="footer__content dw-mod"> 5990 <div class="collection dw-mod"> 5991 @foreach (var socialitem in Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks")) 5992 { 5993 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 5994 string socialIconClass = socialIcon.SelectedValue; 5995 string socialIconTitle = socialIcon.SelectedName; 5996 string socialLink = socialitem.GetString("Link"); 5997 5998 <a href="@socialLink" target="_blank" title="@socialIconTitle" class="u-margin-bottom-5px u-padding" rel="noopener"><i class="@socialIconClass fa-2x"></i></a> 5999 } 6000 </div> 6001 </div> 6002 } 6003 } 6004 } 6005 6006 @helper RenderFooterPayments() 6007 { 6008 6009 } 6010 6011 @helper RenderFooterCopyright() 6012 { 6013 6014 } 6015 6016 @* FOOTER LOGO HELPER *@ 6017 @helper RenderFooterLogo() 6018 { 6019 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 6020 6021 object footerLogo = Model.Area.Item.GetItem("Layout").GetFile("FooterLogo"); 6022 object businessName = Model.Area.Item.GetItem("Settings").GetValue("BusinessName"); 6023 string placeHolderImage = "/Files/Images/placeholder.gif"; 6024 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 6025 6026 if (siteURL.Contains("hededanmark")) 6027 { 6028 <div class="footer__content dw-mod"> 6029 <div class="grid footer-logo-container grid--justify-center dw-mod"> 6030 <div class="dw-mod"> 6031 <a href="/Default.aspx?ID=@firstPageId"> 6032 @* FOOTER LOGO *@ 6033 @if (footerLogo != null || businessName != null) 6034 { 6035 <img class="grid__cell-img logo__img footer-logo dw-mod b-lazy" src="@placeHolderImage" data-src="@footerLogo" alt="@businessName" /> 6036 } 6037 </a> 6038 </div> 6039 </div> 6040 </div> 6041 } 6042 6043 else 6044 { 6045 <div class="footer__content dw-mod"> 6046 <div class="grid footer-logo-container grid--justify-start dw-mod"> 6047 <div class="footer-logo-hd2412 dw-mod"> 6048 <a href="/Default.aspx?ID=@firstPageId"> 6049 @* FOOTER LOGO *@ 6050 @if (footerLogo != null || businessName != null) 6051 { 6052 <img class="grid__cell-img logo__img footer-logo dw-mod b-lazy" src="@placeHolderImage" data-src="@footerLogo" alt="@businessName" /> 6053 } 6054 </a> 6055 </div> 6056 </div> 6057 </div> 6058 } 6059 } 6060 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 6061 @using System 6062 @using System.Web 6063 @using System.Collections.Generic 6064 @using Dynamicweb.Rapido.Blocks.Extensibility 6065 @using Dynamicweb.Rapido.Blocks 6066 @using Dynamicweb.Ecommerce.Common 6067 6068 @{ 6069 BlocksPage referencesBlocksPage = BlocksPage.GetBlockPage("Master"); 6070 6071 Block masterScriptReferences = new Block() 6072 { 6073 Id = "MasterScriptReferences", 6074 SortId = 1, 6075 Template = RenderMasterScriptReferences() 6076 }; 6077 referencesBlocksPage.Add(MasterBlockId.MasterReferences, masterScriptReferences); 6078 } 6079 @helper RenderMasterScriptReferences() 6080 { 6081 6082 <script src="/Files/Templates/Designs/HD2412/js/jquery-3.5.1.min.js" defer></script> 6083 6084 <script src="/Files/Templates/Designs/HD2412/js/urlsearchparamspolyfill.js" defer></script> 6085 6086 <script src="/Files/Templates/Designs/HD2412/js/mark.min.js" defer></script> 6087 6088 <script src="/Files/Templates/Designs/HD2412/js/typeahead.js" defer></script> 6089 6090 <script src="/Files/Templates/Designs/HD2412/js/handlebars-v4.0.12.min.js" defer></script> 6091 <script src="/Files/Templates/Designs/HD2412/js/master.min.js" defer></script> 6092 <script src="/Files/Templates/Designs/HD2412/js/swiper.js" defer></script> 6093 <script src="/Files/Templates/Designs/HD2412/js/jquery.prettySocial.min.js" defer></script> 6094 <script src="/Files/Templates/Designs/HD2412/js/sharer.min.js"></script> 6095 <script src="/Files/Templates/Designs/HD2412/js/jquery.toc.js" defer></script> 6096 6097 <script src="/Files/Templates/Designs/HD2412/js/jquery.combostars.min.js" defer></script> 6098 <script> 6099 // Picture element HTML5 shiv 6100 document.createElement("picture"); 6101 </script> 6102 <script src="/Files/Templates/Designs/HD2412/js/picturefill.min.js" defer></script> 6103 6104 <script src="/Files/Templates/Designs/HD2412/js/nz/main.js" defer></script> 6105 6106 if (Model.Area.Item.GetItem("Custom").GetBoolean("UseCustomJavascript")) 6107 { 6108 <script src="/Files/Templates/Designs/HD2412/js/custom.min.js" defer></script> 6109 PushPromise("/Files/Templates/Designs/HD2412/js/custom.min.js"); 6110 } 6111 6112 PushPromise("/Files/Templates/Designs/HD2412/js/nz/jquery-3.5.1.min.js"); 6113 PushPromise("/Files/Templates/Designs/HD2412/js/typeahead.js"); 6114 PushPromise("/Files/Templates/Designs/HD2412/js/mark.min.js"); 6115 PushPromise("/Files/Templates/Designs/HD2412/js/urlsearchparamspolyfill.js"); 6116 PushPromise("/Files/Templates/Designs/HD2412/js/handlebars-v4.0.12.min.js"); 6117 PushPromise("/Files/Templates/Designs/HD2412/js/master.min.js"); 6118 PushPromise("/Files/Templates/Designs/HD2412/js/swiper.js"); 6119 PushPromise("/Files/Templates/Designs/HD2412/js/jquery.combostars.min.js"); 6120 PushPromise("/Files/Templates/Designs/HD2412/js/sharer.min.js"); 6121 PushPromise("/Files/Templates/Designs/HD2412/js/picturefill.min.js"); 6122 PushPromise("/Files/Templates/Designs/HD2412/js/nz/main.js"); 6123 PushPromise("/Files/Templates/Designs/HD2412/js/jquery.toc.js"); 6124 } 6125 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6126 6127 @using System 6128 @using System.Web 6129 @using System.Collections.Generic 6130 @using Dynamicweb.Rapido.Blocks.Extensibility 6131 @using Dynamicweb.Rapido.Blocks 6132 6133 @{ 6134 BlocksPage searchBlocksPage = BlocksPage.GetBlockPage("Master"); 6135 bool navigationItemsHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 6136 6137 if (!navigationItemsHideSearch) 6138 { 6139 Block masterSearchScriptTemplates = new Block() 6140 { 6141 Id = "MasterSearchScriptTemplates", 6142 SortId = 1, 6143 Template = RenderSearchScriptTemplates() 6144 }; 6145 6146 searchBlocksPage.Add(MasterBlockId.MasterBottomSnippets, masterSearchScriptTemplates); 6147 } 6148 } 6149 6150 @helper RenderSearchScriptTemplates() 6151 { 6152 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 6153 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 6154 bool useFacebookPixel = !string.IsNullOrWhiteSpace(Pageview.AreaSettings.GetItem("Settings").GetString("FacebookPixelID")); 6155 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 6156 bool useGoogleTagManager = !string.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID")); 6157 bool showPrice = !Pageview.AreaSettings.GetItem("Layout").GetBoolean("HidePriceInSearchResults"); 6158 bool showAddToCartButton = !Pageview.AreaSettings.GetItem("Layout").GetBoolean("HideAddToCartButton"); 6159 bool showViewButton = !Pageview.AreaSettings.GetItem("Layout").GetBoolean("HideViewButton"); 6160 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("Layout").GetBoolean("ShowAddToDownloadButton"); 6161 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 6162 6163 <script id="SearchGroupsTemplate" type="text/x-template"> 6164 {{#.}} 6165 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 6166 {{/.}} 6167 </script> 6168 6169 <script id="SearchProductsTemplate" type="text/x-template"> 6170 {{#each .}} 6171 {{#Product}} 6172 {{#ifCond template "!==" "SearchMore"}} 6173 <li class="dropdown__item dropdown__item--seperator dw-mod"> 6174 @if (useFacebookPixel) 6175 { 6176 <text>{{{facebookPixelSearch name number priceDouble currency searchParameter}}}</text> 6177 } 6178 @if (useGoogleTagManager) 6179 { 6180 <text>{{{googleEnchantImpression 'Search results' currency googleImpression}}}</text> 6181 } 6182 <div> 6183 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left" onclick="{{googleImpressionClick}}" title="{{name}}"> 6184 <div class="u-margin-right u-pull--left {{noimage}} u-hidden-xs u-hidden-xxs"><img class="b-lazy" src="/Files/Images/placeholder.gif" data-src="/Admin/Public/GetImage.ashx?width=45&height=36&crop=5&FillCanvas=True&Compression=75&image={{image}}" alt="{{name}}"></div> 6185 <div class="u-pull--left"> 6186 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 6187 @if (showPrice && !onlyPreview) 6188 { 6189 if (pointShopOnly) 6190 { 6191 <text> 6192 {{#if havePointPrice}} 6193 <div> 6194 <span class="u-color--loyalty-points">{{points}}</span> @Translate("points") 6195 </div> 6196 {{else}} 6197 <small class="help-text u-no-margin">@Translate("Not available")</small> 6198 {{/if}} 6199 {{#unless canBePurchasedWithPoints}} 6200 {{#if havePointPrice}} 6201 <small class="help-text u-no-margin">@Translate("Not enough points to buy this")</small> 6202 {{/if}} 6203 {{/unless}} 6204 </text> 6205 } 6206 else 6207 { 6208 <div>{{price}}</div> 6209 } 6210 } 6211 </div> 6212 </a> 6213 <div class="u-margin-left u-pull--right"> 6214 @if (showAddToCartButton && !onlyPreview) { 6215 if (pointShopOnly) 6216 { 6217 <button type="button" class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside {{#unless canBePurchasedWithPoints}}js-stay-disabled{{/unless}}" name="CartCmd" value="addWithPoints" 6218 onclick="Cart.AddToCart(event, { 6219 id: '{{productId}}', 6220 quantity: 1, 6221 buyForPoints: true, 6222 productInfo: {{productInfo}} 6223 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 6224 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue js-ignore-click-outside"></i> 6225 </button> 6226 } else { 6227 <button type="button" class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside" 6228 onclick="Cart.AddToCart(event, { 6229 id: '{{productId}}', 6230 quantity: 1, 6231 productInfo: {{productInfo}} 6232 }); {{facebookPixelAction}}"> 6233 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue js-ignore-click-outside"></i> 6234 </button> 6235 } 6236 <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> 6237 } 6238 else if (showViewButton) 6239 { 6240 <a href="{{link}}" onclick="{{googleImpressionClick}}" class="btn btn--secondary btn--condensed btn--full u-no-margin dw-mod js-ignore-click-outside" title="@Translate("View")">@Translate("View")</a> 6241 } 6242 @if (showAddToDownloadButton) 6243 { 6244 <button type="button" class="btn btn--primary u-no-margin btn--condensed dw-mod js-add-to-downloads" title="@Translate("Add")" data-product-id="{{productId}}"> 6245 <i class="fas fa-plus js-button-icon"></i> 6246 </button> 6247 } 6248 </div> 6249 </div> 6250 </li> 6251 {{/ifCond}} 6252 {{#ifCond template "===" "SearchMore"}} 6253 {{>SearchMoreProducts}} 6254 {{/ifCond}} 6255 {{/Product}} 6256 {{else}} 6257 <li class="dropdown__item dropdown__item--seperator dw-mod"> 6258 @Translate("Your search gave 0 results") 6259 </li> 6260 {{/each}} 6261 </script> 6262 6263 <script id="SearchMoreProducts" type="text/x-template"> 6264 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 6265 <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 6266 @Translate("View all") 6267 </a> 6268 </li> 6269 </script> 6270 6271 <script id="SearchMorePages" type="text/x-template"> 6272 {{#ifCond activeTo "<" currentTime}} 6273 6274 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 6275 <a href="/Default.aspx?ID=@contentSearchPageLink&Search={{searchParameter}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 6276 @Translate("View all") 6277 </a> 6278 </li> 6279 {{/ifCond}} 6280 6281 </script> 6282 6283 <script id="SearchPagesTemplate" type="text/x-template"> 6284 {{#each .}} 6285 {{#ifCond template "!==" "SearchMore"}} 6286 {{#ifCond activeTo ">=" currentTime}} 6287 6288 <li class="dropdown__item dropdown__item--seperator dw-mod"> 6289 <div> 6290 <a href="/Default.aspx?ID={{id}}" class="js-typeahead-link u-pull--left u-color-inherit"> 6291 <div class="u-margin-right u-pull--left"><i class="fa {{icon}} u-w20px u-ta-center"></i></div> 6292 <div class="u-pull--left"> 6293 <div class="u-bold u-truncate-text u-max-w220px js-typeahead-name">{{name}}</div> 6294 </div> 6295 </a> 6296 </div> 6297 </li> 6298 {{/ifCond}} 6299 6300 6301 {{/ifCond}} 6302 {{#ifCond totalPagesItem "<=" 1 }} 6303 6304 {{#ifCond activeTo "<" currentTime}} 6305 <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable dw-mod"> 6306 @Translate("Your search gave 0 results") 6307 </li> 6308 {{/ifCond}} 6309 {{/ifCond}} 6310 6311 {{#ifCond template "===" "SearchMore"}} 6312 {{#ifCond activeTo ">=" currentTime}} 6313 6314 {{>SearchMorePages}} 6315 {{/ifCond}} 6316 6317 {{/ifCond}} 6318 6319 {{else}} 6320 <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable dw-mod"> 6321 @Translate("Your search gave 0 results") 6322 </li> 6323 6324 6325 {{/each}} 6326 </script> 6327 6328 <script id="SearchPagesTemplateWrap" type="text/x-template"> 6329 <div class="dropdown__column-header">@Translate("Pages")</div> 6330 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 6331 6332 {{>SearchPagesTemplate}} 6333 </ul> 6334 </script> 6335 6336 <script id="SearchProductsTemplateWrap" type="text/x-template"> 6337 <div class="dropdown__column-header">@Translate("Products")</div> 6338 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 6339 {{>SearchProductsTemplate}} 6340 </ul> 6341 </script> 6342 } 6343 6344 6345 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 6346 6347 @using System 6348 @using System.Web 6349 @using System.Collections.Generic 6350 @using Dynamicweb.Rapido.Blocks.Extensibility 6351 @using Dynamicweb.Rapido.Blocks 6352 6353 @{ 6354 BlocksPage bottomSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 6355 6356 Block primaryBottomSnippets = new Block() 6357 { 6358 Id = "MasterJavascriptInitializers", 6359 SortId = 100, 6360 Template = RenderPrimaryBottomSnippets() 6361 }; 6362 bottomSnippetsBlocksPage.Add(MasterBlockId.MasterReferences, primaryBottomSnippets); 6363 } 6364 6365 @helper RenderPrimaryBottomSnippets() { 6366 bool isWireframeMode = Model.Area.Item.GetItem("Settings").GetBoolean("WireframeMode"); 6367 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 6368 6369 if (isWireframeMode) 6370 { 6371 <script> 6372 Wireframe.Init(true); 6373 </script> 6374 } 6375 6376 6377 if (useGoogleTagManager) 6378 { 6379 <script> 6380 document.addEventListener('addToCart', function(event) { 6381 var productInfo = event.detail.productInfo; 6382 6383 if ( typeof productInfo === 'string'){ 6384 productInfo = JSON.parse(productInfo); 6385 } 6386 var googleImpression = productInfo.googleImpression; 6387 6388 6389 if ( typeof googleImpression === 'string'){ 6390 googleImpression = JSON.parse(googleImpression); 6391 } 6392 6393 dataLayer.push({ 6394 'event': 'addToCart', 6395 'ecommerce': { 6396 'currencyCode': '@Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency().Code', 6397 'add': { 6398 'products': [{ 6399 'name': googleImpression.name, 6400 'id': googleImpression.id, 6401 'price': googleImpression.price, 6402 'brand': googleImpression.brand, 6403 'category': googleImpression.category, 6404 'variant': googleImpression.variant, 6405 'quantity': event.detail.quantity 6406 }] 6407 } 6408 } 6409 }); 6410 }); 6411 </script> 6412 } 6413 6414 //if digitalwarehouse 6415 if (Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowDownloadCart")) 6416 { 6417 string cartContextId = Converter.ToString(HttpContext.Current.Application["DownloadCartContext"]); 6418 6419 if (string.IsNullOrEmpty(cartContextId)) { 6420 var moduleProps = Dynamicweb.Modules.Properties.GetParagraphModuleSettings(GetPageIdByNavigationTag("DownloadCart"), "eCom_CartV2"); 6421 var cartSettings = new Dynamicweb.Ecommerce.Cart.ModuleSettings(moduleProps); 6422 cartContextId = cartSettings.OrderContextID; 6423 HttpContext.Current.Application["DownloadCartContext"] = cartContextId; 6424 } 6425 6426 <script> 6427 let downloadCart = new DownloadCart({ 6428 cartPageId: @GetPageIdByNavigationTag("MiniCartFeed"), 6429 contextId: "@cartContextId", 6430 addButtonText: "@Translate("Add")", 6431 removeButtonText: "@Translate("Remove")" 6432 }); 6433 </script> 6434 } 6435 6436 <!--$$Javascripts--> 6437 } 6438 @if (File.Exists(HttpContext.Current.Server.MapPath("/MasterBlocks/Custom__Blocks.cshtml"))) 6439 { 6440 <text>@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 6441 6442 @using System 6443 @using System.Web 6444 @using System.Collections.Generic 6445 @using Dynamicweb.Rapido.Blocks 6446 6447 @{ 6448 BlocksPage masterCustomBlocksPage = BlocksPage.GetBlockPage("Master"); 6449 6450 }</text> 6451 } 6452 6453 6454 @functions { 6455 public class ManifestIcon 6456 { 6457 public string src { get; set; } 6458 public string type { get; set; } 6459 public string sizes { get; set; } 6460 } 6461 6462 public class Manifest 6463 { 6464 public string name { get; set; } 6465 public string short_name { get; set; } 6466 public string start_url { get; set; } 6467 public string display { get; set; } 6468 public string background_color { get; set; } 6469 public string theme_color { get; set; } 6470 public List<ManifestIcon> icons { get; set; } 6471 } 6472 } 6473 @{ 6474 if (!String.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("AppName")) && Model.Area.Item.GetItem("Settings").GetFile("AppIcon") != null) 6475 { 6476 Manifest manifest = new Manifest 6477 { 6478 name = Model.Area.Item.GetItem("Settings").GetString("AppName"), 6479 short_name = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("AppShortName")) ? Model.Area.Item.GetItem("Settings").GetString("AppShortName") : Model.Area.Item.GetItem("Settings").GetString("AppName"), 6480 start_url = "/", 6481 display = "standalone", 6482 background_color = Model.Area.Item.GetItem("Settings").GetString("AppBackgroundColor"), 6483 theme_color = Model.Area.Item.GetItem("Settings").GetString("AppThemeColor") 6484 }; 6485 6486 manifest.icons = new List<ManifestIcon> { 6487 new ManifestIcon { 6488 src = "/Admin/Public/GetImage.ashx?width=192&height=192&crop=5&image=" + Model.Area.Item.GetItem("Settings").GetFile("AppIcon").PathUrlEncoded, 6489 sizes = "192x192", 6490 type = "image/png" 6491 }, 6492 new ManifestIcon { 6493 src = "/Admin/Public/GetImage.ashx?width=512&height=512&crop=5&image=" + Model.Area.Item.GetItem("Settings").GetFile("AppIcon").PathUrlEncoded, 6494 sizes = "512x512", 6495 type = "image/png" 6496 }, 6497 new ManifestIcon { 6498 src = "/Admin/Public/GetImage.ashx?width=1024&height=1024&crop=5&image=" + Model.Area.Item.GetItem("Settings").GetFile("AppIcon").PathUrlEncoded, 6499 sizes = "1024x1024", 6500 type = "image/png" 6501 } 6502 }; 6503 6504 string manifestFilePath = HttpContext.Current.Request.MapPath("/Files/Templates/Designs/HD2412/manifest.json"); 6505 string manifestJSON = Newtonsoft.Json.JsonConvert.SerializeObject(manifest); 6506 string currentManifest = File.ReadAllText(manifestFilePath); 6507 6508 if (manifestJSON != currentManifest) 6509 { 6510 File.WriteAllText(manifestFilePath, manifestJSON); 6511 } 6512 } 6513 } 6514 6515 @{ 6516 var swatches = new Dynamicweb.Content.Items.ColorSwatchService(); 6517 var brandColors = swatches.GetColorSwatch(1); 6518 string brandColorOne = brandColors.Palette["BrandColor1"]; 6519 Currency currentCurrency = Dynamicweb.Ecommerce.Common.Context.Currency; 6520 } 6521 6522 <!DOCTYPE html> 6523 6524 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName" data-currency="@currentCurrency.Code"> 6525 <head> 6526 @{ 6527 string GoogleTagManagerID = Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID"); 6528 string FacebookPixelID = Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID"); 6529 6530 if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 6531 { 6532 <script> 6533 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 6534 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 6535 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 6536 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 6537 })(window,document,'script','dataLayer','@GoogleTagManagerID'); 6538 </script> 6539 <!-- Google Tag Manager (noscript) --> 6540 } 6541 } 6542 <meta http-equiv="Accept-CH" content="DPR, Viewport-Width, Width"> 6543 6544 <!-- Rapido version 3.1 --> 6545 <meta charset="utf-8" /> 6546 <title>@Model.Title</title> 6547 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6548 6549 6550 @if (Dynamicweb.Context.Current.Request.Url.Host.EndsWith("nozebrahosting.dk") || Dynamicweb.Context.Current.Request.Url.Host.EndsWith("dynamicweb.dk")) 6551 { 6552 <meta name="robots" content="noindex, nofollow"> 6553 } 6554 6555 @{ 6556 var noFollowBool = Pageview.Page.Nofollow; 6557 var noIndexBool = Pageview.Page.Noindex; 6558 } 6559 6560 @if (noIndexBool && noFollowBool) 6561 { 6562 <meta name="robots" content="noindex, nofollow"> 6563 } 6564 else if (noFollowBool) 6565 { 6566 <meta name="robots" content="nofollow"> 6567 } 6568 else if (noIndexBool) 6569 { 6570 <meta name="robots" content="noindex"> 6571 } 6572 6573 6574 <meta name="theme-color" content="@brandColorOne" /> 6575 6576 <meta name="description" content="@metaDesc"> 6577 <meta name="keywords" content="@Pageview.Page.Keywords"> 6578 6579 <!-- Open Graph --> 6580 6581 <meta property="og:type" content="@ogType" /> 6582 <meta property="og:site_name" content="@businessName"> 6583 <meta property="og:title" content="@ogTitle" /> 6584 <meta property="og:description" content="@ogDesc" /> 6585 <meta property="og:url" content="@siteURL" /> 6586 <meta property="og:image" content="@domainUrl@ogImage" /> 6587 6588 <link rel="canonical" href="@canonical" /> 6589 6590 <style> 6591 html { 6592 font-family: sans-serif; 6593 line-height: 1.15 6594 } 6595 6596 body { 6597 margin: 0 6598 } 6599 6600 header, nav, section { 6601 display: block 6602 } 6603 6604 h1 { 6605 font-size: 2em; 6606 margin: .67em 0 6607 } 6608 6609 main { 6610 display: block 6611 } 6612 6613 a { 6614 background-color: transparent 6615 } 6616 6617 img { 6618 border-style: none 6619 } 6620 6621 svg:not(:root) { 6622 overflow: hidden 6623 } 6624 6625 button, input { 6626 font-family: inherit; 6627 font-size: inherit; 6628 font-style: inherit; 6629 font-variant: inherit; 6630 font-weight: inherit; 6631 line-height: inherit; 6632 margin: 0 6633 } 6634 6635 button, input { 6636 overflow: visible 6637 } 6638 6639 button { 6640 text-transform: none 6641 } 6642 6643 button, [type="submit"] { 6644 -webkit-appearance: button 6645 } 6646 6647 [type="checkbox"] { 6648 box-sizing: border-box; 6649 padding: 0 6650 } 6651 6652 *::-webkit-file-upload-button { 6653 -webkit-appearance: button; 6654 font-family: inherit; 6655 font-size: inherit; 6656 font-style: inherit; 6657 font-variant: inherit; 6658 font-weight: inherit; 6659 line-height: inherit 6660 } 6661 6662 html { 6663 box-sizing: border-box; 6664 font-size: 62.5%; 6665 height: 100%; 6666 overflow-y: scroll 6667 } 6668 6669 *, ::before, ::after { 6670 box-sizing: inherit 6671 } 6672 6673 body { 6674 font-size: 1.6rem; 6675 line-height: 2.4rem; 6676 font-weight: 400; 6677 font-family: Roboto,Helvetica,Arial,sans-serif; 6678 color: rgb(34,34,34) 6679 } 6680 6681 a { 6682 color: rgb(34,34,34); 6683 text-decoration: none; 6684 word-wrap: break-word 6685 } 6686 6687 ul { 6688 list-style: circle none 6689 } 6690 6691 ul { 6692 padding-left: 0; 6693 margin-top: 0 6694 } 6695 6696 ul ul { 6697 margin: 1.5rem 0 1.5rem 3rem 6698 } 6699 6700 li { 6701 margin-bottom: 1rem 6702 } 6703 6704 img { 6705 display: table; 6706 max-width: 100% 6707 } 6708 6709 input[type="text"], input[type="password"] { 6710 background-color: rgb(255,255,255); 6711 border: 1px solid rgb(209,209,209); 6712 box-shadow: none; 6713 box-sizing: border-box; 6714 height: 38px; 6715 padding: 6px 10px; 6716 -webkit-appearance: none 6717 } 6718 6719 label { 6720 display: block; 6721 margin-bottom: .5rem 6722 } 6723 6724 input[type="checkbox"] { 6725 display: inline 6726 } 6727 6728 h1, h2 { 6729 margin-top: 0; 6730 margin-bottom: 2rem; 6731 font-weight: 300; 6732 word-wrap: break-word; 6733 color: rgb(34,34,34) 6734 } 6735 6736 h1 { 6737 font-size: 4rem; 6738 line-height: 1.2 6739 } 6740 6741 h2 { 6742 font-size: 3.6rem; 6743 line-height: 1.25 6744 } 6745 6746 p { 6747 margin-top: 0 6748 } 6749 6750 div, p { 6751 letter-spacing: normal; 6752 word-spacing: normal; 6753 white-space: normal 6754 } 6755 6756 button, input { 6757 margin-bottom: 1.4rem 6758 } 6759 6760 form, p, ul { 6761 margin-bottom: 2.4rem 6762 } 6763 6764 li { 6765 margin-bottom: 1rem 6766 } 6767 6768 label { 6769 margin-bottom: .25rem 6770 } 6771 6772 .btn { 6773 background-color: transparent; 6774 border-top-left-radius: 0; 6775 border-top-right-radius: 0; 6776 border-bottom-right-radius: 0; 6777 border-bottom-left-radius: 0; 6778 border: 1px solid rgb(187,187,187); 6779 color: inherit; 6780 display: inline-block; 6781 font-size: inherit; 6782 font-weight: 500; 6783 letter-spacing: .1rem; 6784 line-height: 20px; 6785 min-height: 38px; 6786 margin-bottom: 1em; 6787 padding: 8px 30px; 6788 text-align: center; 6789 text-decoration: none; 6790 vertical-align: top; 6791 word-break: break-all 6792 } 6793 6794 .btn--primary { 6795 color: rgb(255,255,255); 6796 background-color: rgb(84,84,84); 6797 border-color: rgb(84,84,84) 6798 } 6799 6800 .btn--full { 6801 width: 100% 6802 } 6803 6804 .btn--link { 6805 border: none; 6806 background-color: transparent 6807 } 6808 6809 .btn--link-clean { 6810 border: none; 6811 background-color: transparent; 6812 padding: 0; 6813 margin: 0; 6814 height: auto; 6815 line-height: 1.4; 6816 min-height: 100% 6817 } 6818 6819 .dropdown { 6820 position: relative; 6821 display: inline-block; 6822 text-align: left 6823 } 6824 6825 .dropdown.dropdown--absolute-position { 6826 list-style: none; 6827 z-index: 70; 6828 background-color: rgb(255,255,255); 6829 position: absolute; 6830 top: 100%; 6831 left: 0; 6832 box-shadow: rgba(0,0,0,.239216) 0 6px 12px; 6833 margin: 0 6834 } 6835 6836 .modal-container { 6837 z-index: 10000; 6838 position: fixed; 6839 top: 0; 6840 right: 0; 6841 bottom: 0; 6842 left: 0; 6843 display: none 6844 } 6845 6846 .modal-overlay { 6847 background-color: rgba(0,0,0,.498039); 6848 width: 100%; 6849 height: 100%; 6850 position: fixed; 6851 z-index: 100; 6852 left: 0; 6853 top: 0 6854 } 6855 6856 .modal { 6857 background-color: rgb(255,255,255); 6858 z-index: 10000; 6859 max-width: calc(100% - 5em); 6860 max-height: calc(100% - 5em); 6861 overflow-y: auto; 6862 position: relative 6863 } 6864 6865 .modal h2 { 6866 margin: 0 6867 } 6868 6869 .modal--xs { 6870 width: 280px 6871 } 6872 6873 .modal__header { 6874 padding: .5em 1em; 6875 border-bottom-width: 1px; 6876 border-bottom-style: solid; 6877 border-bottom-color: rgb(211,211,211) 6878 } 6879 6880 .modal__body { 6881 padding: 1em; 6882 overflow-x: auto 6883 } 6884 6885 .modal-trigger { 6886 display: none !important 6887 } 6888 6889 .form__field-group { 6890 margin-bottom: 1em; 6891 position: relative 6892 } 6893 6894 .form__field-group input { 6895 margin-bottom: 0 6896 } 6897 6898 .form__field-group > * { 6899 width: 100% 6900 } 6901 6902 .form__field-group > [for], .form__field-group > [type="checkbox"] { 6903 display: inline; 6904 width: auto 6905 } 6906 6907 .field-error { 6908 color: rgb(195,66,63); 6909 font-size: 1.47rem; 6910 margin-top: 5px 6911 } 6912 6913 input[type="checkbox"].form__control { 6914 display: inline; 6915 position: absolute; 6916 opacity: 0; 6917 width: auto; 6918 height: 0; 6919 margin: 0 6920 } 6921 6922 input[type="checkbox"].form__control + label { 6923 position: relative; 6924 line-height: 17px; 6925 display: inline-block 6926 } 6927 6928 input[type="checkbox"].form__control + label::before { 6929 content: ''; 6930 width: 17px; 6931 height: 17px; 6932 border: 1px solid rgb(209,209,209); 6933 display: inline-block; 6934 margin-right: 5px; 6935 vertical-align: top 6936 } 6937 6938 input[type="checkbox"].form__control:checked + label::after { 6939 content: ''; 6940 height: 5px; 6941 width: 10px; 6942 border-left-width: 2px; 6943 border-left-color: rgb(84,84,84); 6944 border-left-style: solid; 6945 border-bottom-width: 2px; 6946 border-bottom-color: rgb(84,84,84); 6947 border-bottom-style: solid; 6948 left: 4px; 6949 top: 5px; 6950 display: inline-block; 6951 position: absolute 6952 } 6953 6954 .b-lazy { 6955 max-width: 100%; 6956 opacity: 0 6957 } 6958 6959 .background-image { 6960 position: absolute; 6961 top: 0; 6962 bottom: 0; 6963 left: 0; 6964 right: 0 6965 } 6966 6967 .background-image::after { 6968 content: ''; 6969 position: absolute; 6970 top: 0; 6971 bottom: 0; 6972 left: 0; 6973 right: 0; 6974 background-color: inherit 6975 } 6976 6977 .background-image__wrapper { 6978 position: absolute; 6979 width: 100%; 6980 height: 100%; 6981 top: 0; 6982 overflow: hidden 6983 } 6984 6985 .background-image__cover { 6986 height: 100%; 6987 display: block; 6988 max-width: 100%; 6989 width: 100% 6990 } 6991 6992 .image { 6993 position: relative; 6994 top: 0; 6995 bottom: 0; 6996 left: 0; 6997 right: 0 6998 } 6999 7000 .image::after { 7001 content: ''; 7002 position: absolute; 7003 top: 0; 7004 bottom: 0; 7005 left: 0; 7006 right: 0; 7007 background-color: inherit 7008 } 7009 7010 .image-filter { 7011 overflow: hidden 7012 } 7013 7014 .typeahead { 7015 position: relative; 7016 z-index: 70; 7017 color: rgb(34,34,34); 7018 max-width: 600px; 7019 width: 100% 7020 } 7021 7022 .typeahead-search-field { 7023 margin: 0; 7024 border-top-left-radius: 0; 7025 border-top-right-radius: 0; 7026 border-bottom-right-radius: 0; 7027 border-bottom-left-radius: 0; 7028 position: relative 7029 } 7030 7031 @@media (max-width:479px) { 7032 .u-hidden-xxs { 7033 display: none !important 7034 } 7035 } 7036 7037 .grid { 7038 display: -webkit-flex; 7039 zoom: 1; 7040 -webkit-flex-wrap: wrap; 7041 padding: 0; 7042 margin: 0; 7043 position: relative; 7044 width: 100%; 7045 max-width: 100%; 7046 list-style-type: none; 7047 word-spacing: -0.43em !important 7048 } 7049 7050 .grid::before, .grid::after { 7051 letter-spacing: normal; 7052 word-spacing: normal; 7053 white-space: normal; 7054 max-width: 100% 7055 } 7056 7057 .grid ::before, .grid ::after { 7058 letter-spacing: normal; 7059 word-spacing: normal; 7060 white-space: normal 7061 } 7062 7063 .grid .grid { 7064 -webkit-flex: 1 1 auto 7065 } 7066 7067 .grid * { 7068 box-sizing: border-box 7069 } 7070 7071 .grid ::before, .grid ::after { 7072 box-sizing: border-box 7073 } 7074 7075 [class*="grid__col-"] { 7076 display: -webkit-flex; 7077 zoom: 1; 7078 -webkit-flex-direction: column; 7079 letter-spacing: normal; 7080 word-spacing: normal; 7081 white-space: normal; 7082 position: relative; 7083 width: 100%; 7084 vertical-align: top; 7085 padding: .5em 7086 } 7087 7088 .grid__cell { 7089 position: relative; 7090 display: block; 7091 -webkit-flex: 1 1 auto 7092 } 7093 7094 .grid__col-1 { 7095 width: 8.33333333% 7096 } 7097 7098 @@media (min-width:480px) { 7099 .grid__col-xs-12 { 7100 width: 100% 7101 } 7102 } 7103 7104 @@media (min-width:768px) { 7105 .grid__col-sm-12 { 7106 width: 100% 7107 } 7108 7109 .grid__col-sm-4 { 7110 width: 33.33333333% 7111 } 7112 } 7113 7114 @@media (min-width:992px) { 7115 .grid__col-md-12 { 7116 width: 100% 7117 } 7118 7119 .grid__col-md-6 { 7120 width: 50% 7121 } 7122 7123 .grid__col-md-3 { 7124 width: 25% 7125 } 7126 } 7127 7128 @@media (min-width:1200px) { 7129 .grid__col-lg-6 { 7130 width: 50% 7131 } 7132 7133 .grid__col-lg-3 { 7134 width: 25% 7135 } 7136 } 7137 7138 @@media (min-width:992px) { 7139 .grid__col-md-auto { 7140 -webkit-flex: 1 0 0; 7141 width: 0 7142 } 7143 7144 .grid__col-md-auto-width { 7145 width: auto 7146 } 7147 } 7148 7149 @@media (min-width:1200px) { 7150 .grid__col-lg-auto { 7151 -webkit-flex: 1 0 0; 7152 width: 0 7153 } 7154 7155 .grid__col-lg-auto-width { 7156 width: auto 7157 } 7158 } 7159 7160 .grid--wrap { 7161 -webkit-flex-wrap: wrap 7162 } 7163 7164 .grid--align-content-start { 7165 -webkit-align-content: flex-start 7166 } 7167 7168 .grid--align-self-end { 7169 -webkit-align-self: flex-end; 7170 vertical-align: bottom 7171 } 7172 7173 .grid--align-self-center { 7174 -webkit-align-self: center; 7175 vertical-align: middle 7176 } 7177 7178 .grid--justify-end { 7179 text-align: right; 7180 -webkit-justify-content: flex-end 7181 } 7182 7183 .grid--justify-end .grid__cell, .grid--justify-end [class*="grid__col-"] { 7184 text-align: initial 7185 } 7186 7187 .grid--justify-center { 7188 text-align: center; 7189 -webkit-justify-content: center 7190 } 7191 7192 .grid--justify-center .grid__cell, .grid--justify-center [class*="grid__col-"] { 7193 text-align: initial 7194 } 7195 7196 .grid__col--bleed { 7197 padding: 0 7198 } 7199 7200 .grid__col--bleed-x { 7201 padding: .5em 0 7202 } 7203 7204 .grid__cell-img { 7205 display: -webkit-flex; 7206 -webkit-flex: 0 0 auto; 7207 margin-left: 0; 7208 margin-right: 0; 7209 max-width: 100%; 7210 height: auto 7211 } 7212 7213 .grid__cell-img--centered { 7214 width: auto; 7215 margin: 0 auto 7216 } 7217 7218 .grid__cell-footer { 7219 display: -webkit-flex; 7220 zoom: 1; 7221 width: 100%; 7222 margin-top: auto 7223 } 7224 7225 .site { 7226 left: 0; 7227 position: relative; 7228 width: 100vw; 7229 max-width: 100% 7230 } 7231 7232 .page { 7233 min-height: 500px 7234 } 7235 7236 .top-container__center-container { 7237 padding: 0 1em 7238 } 7239 7240 .top-container--sticky { 7241 width: 100%; 7242 position: fixed; 7243 top: 0; 7244 z-index: 90 7245 } 7246 7247 .center-container { 7248 margin: 0 auto; 7249 max-width: 1280px; 7250 position: relative; 7251 width: 100%; 7252 height: 100%; 7253 box-sizing: border-box 7254 } 7255 7256 .paragraph-container { 7257 padding: 1em 7258 } 7259 7260 .paragraph-container p:last-of-type { 7261 margin-bottom: .25em 7262 } 7263 7264 .paragraph-container--full-width { 7265 width: 100vw; 7266 position: relative; 7267 left: 50%; 7268 right: 50%; 7269 margin-left: -50vw 7270 } 7271 7272 .paragraph-container--height-xl { 7273 height: 550px 7274 } 7275 7276 .paragraph-container--height-xl > .paragraph-container { 7277 height: 550px 7278 } 7279 7280 .paragraph-container--height-auto { 7281 min-height: 60px 7282 } 7283 7284 .paragraph-container--height-auto > .paragraph-container { 7285 min-height: 60px 7286 } 7287 7288 .paragraph-container__button { 7289 margin-top: 1em 7290 } 7291 7292 .multiple-paragraphs-container { 7293 position: relative 7294 } 7295 7296 .multiple-paragraphs-container h2 { 7297 color: inherit 7298 } 7299 7300 .multiple-paragraphs-container p { 7301 color: inherit 7302 } 7303 7304 .multiple-paragraphs-container--spacing-none { 7305 padding-top: 0; 7306 padding-bottom: 0 7307 } 7308 7309 .multiple-paragraphs-container--spacing-lg { 7310 padding-top: 1em; 7311 padding-bottom: 1em 7312 } 7313 7314 @@media (max-width:768px) { 7315 .top-container__center-container { 7316 padding: 0 .5em 7317 } 7318 7319 .paragraph-container { 7320 padding: 1em .5em 7321 } 7322 } 7323 7324 .logo { 7325 margin: .5em .5em .5em 0 7326 } 7327 7328 .main-navigation { 7329 box-sizing: border-box; 7330 background-color: rgb(228,228,228); 7331 z-index: 10; 7332 position: relative 7333 } 7334 7335 .menu { 7336 list-style: none; 7337 margin: 0; 7338 padding: 0; 7339 white-space: nowrap 7340 } 7341 7342 .menu--dropdown { 7343 background-color: rgb(246,246,246); 7344 box-shadow: rgba(0,0,0,.172549) 0 3px 6px; 7345 z-index: 10000; 7346 position: absolute; 7347 top: 100%; 7348 left: 0; 7349 display: none; 7350 line-height: 1.4; 7351 min-width: 100%; 7352 padding: .5em 0; 7353 margin-top: 3px 7354 } 7355 7356 .menu--dropdown-right { 7357 background-color: rgb(246,246,246); 7358 box-shadow: rgba(0,0,0,.172549) 0 3px 6px; 7359 z-index: 10000; 7360 position: absolute; 7361 top: 100%; 7362 display: none; 7363 line-height: 1.4; 7364 min-width: 100%; 7365 padding: .5em 0; 7366 margin-top: 3px; 7367 left: auto; 7368 right: 0 7369 } 7370 7371 .menu__item { 7372 position: relative; 7373 padding: 0; 7374 margin: 0; 7375 color: rgb(34,34,34); 7376 text-align: left 7377 } 7378 7379 .menu__item--horizontal { 7380 float: left 7381 } 7382 7383 .menu__item--top-level { 7384 float: left; 7385 border-top-width: 3px; 7386 border-top-style: solid; 7387 border-top-color: rgb(228,228,228); 7388 border-bottom-width: 3px; 7389 border-bottom-style: solid; 7390 border-bottom-color: rgb(228,228,228); 7391 text-align: center 7392 } 7393 7394 .menu__link { 7395 display: block; 7396 text-decoration: none; 7397 white-space: nowrap; 7398 padding: 16px .5em; 7399 font-size: 1.6rem; 7400 color: rgb(34,34,34); 7401 float: left; 7402 line-height: 30px 7403 } 7404 7405 .menu__link.menu__link--icon { 7406 margin-bottom: 0; 7407 line-height: 33px; 7408 color: rgb(34,34,34); 7409 position: relative 7410 } 7411 7412 .is-dropdown::after { 7413 font-family: 'Font Awesome 5 Pro','Font Awesome 5 Free'; 7414 font-weight: 900; 7415 content: '\F107'; 7416 display: inline-block; 7417 line-height: 42px; 7418 padding-right: .5em 7419 } 7420 7421 .is-dropdown--no-icon::after { 7422 font-family: ''; 7423 content: ''; 7424 padding: 0 7425 } 7426 7427 .menu-dropdown__item { 7428 display: block; 7429 text-decoration: none; 7430 white-space: nowrap; 7431 color: rgb(34,34,34); 7432 padding: .5em; 7433 line-height: 1.4; 7434 text-align: left 7435 } 7436 7437 .menu__item--mega { 7438 position: static; 7439 text-align: left 7440 } 7441 7442 .mega-menu { 7443 background-color: rgb(246,246,246); 7444 z-index: 10000; 7445 position: absolute; 7446 top: 100%; 7447 left: 1em; 7448 display: none; 7449 box-shadow: rgba(0,0,0,.172549) 0 3px 6px; 7450 width: calc(100% - (2 * 1em)); 7451 max-width: 1280px 7452 } 7453 7454 .mega-menu__list-wrap { 7455 padding: 0 .5em; 7456 margin-bottom: 1em 7457 } 7458 7459 .mega-menu__grid .grid__col-md-3:nth-child(4n) .mega-menu__list-wrap { 7460 border-right-width: 0 7461 } 7462 7463 .mega-menu__header-container { 7464 margin: 0 .5em 7465 } 7466 7467 .mega-menu__header-container__text { 7468 display: block; 7469 text-decoration: none; 7470 font-size: 1.6rem; 7471 color: rgb(34,34,34); 7472 margin-top: 0; 7473 padding: .5em; 7474 line-height: 1.2 7475 } 7476 7477 .is-mega::after { 7478 font-family: 'Font Awesome 5 Pro','Font Awesome 5 Free'; 7479 font-weight: 900; 7480 content: '\F107'; 7481 display: inline-block; 7482 line-height: 42px; 7483 padding-right: .5em; 7484 float: right 7485 } 7486 7487 html, body { 7488 overflow-x: hidden 7489 } 7490 7491 .tools-navigation { 7492 background-color: rgb(255,255,255) 7493 } 7494 7495 .u-full-width { 7496 width: 100%; 7497 max-width: 100% 7498 } 7499 7500 .u-full-max-width { 7501 max-width: 100% 7502 } 7503 7504 .u-flex { 7505 display: -webkit-flex 7506 } 7507 7508 .u-block { 7509 display: block 7510 } 7511 7512 .u-ta-center { 7513 text-align: center 7514 } 7515 7516 .u-color-light { 7517 color: rgb(255,255,255) 7518 } 7519 7520 .u-color-dark { 7521 color: rgb(42,42,42) 7522 } 7523 7524 .u-w380px { 7525 width: 380px 7526 } 7527 7528 .u-min-w220px { 7529 min-width: 220px 7530 } 7531 7532 .u-no-padding { 7533 padding: 0 7534 } 7535 7536 .u-no-margin { 7537 margin: 0 7538 } 7539 7540 .u-margin-top { 7541 margin-top: .5em 7542 } 7543 7544 .u-margin-right { 7545 margin-right: .5em 7546 } 7547 7548 .u-margin-bottom { 7549 margin-bottom: .5em 7550 } 7551 7552 .u-margin-bottom--lg { 7553 margin-bottom: 1em 7554 } 7555 7556 .u-padding { 7557 padding: .5em 7558 } 7559 7560 .u-padding-bottom--lg { 7561 padding-bottom: 1em 7562 } 7563 7564 a { 7565 color: rgb(0,133,202); 7566 text-decoration: none; 7567 word-wrap: break-word 7568 } 7569 7570 h1 { 7571 font-family: Lato,sans-serif; 7572 font-size: 35px; 7573 font-weight: 900; 7574 line-height: 1.2; 7575 color: rgb(0,0,0) 7576 } 7577 7578 h2 { 7579 font-family: Lato,sans-serif; 7580 font-size: 26px; 7581 font-weight: 900; 7582 line-height: 1.2; 7583 color: rgb(51,51,51) 7584 } 7585 7586 body { 7587 font-family: Lato,sans-serif; 7588 font-size: 18px; 7589 line-height: 1.4; 7590 color: rgb(51,51,51) 7591 } 7592 7593 a { 7594 color: rgb(0,168,74) 7595 } 7596 7597 .btn--primary.dw-mod { 7598 color: rgb(255,255,255); 7599 font-size: 15px; 7600 font-weight: 700; 7601 line-height: 36px; 7602 border-width: 1px; 7603 border-color: rgb(0,168,74); 7604 border-top-left-radius: .2rem; 7605 border-top-right-radius: .2rem; 7606 border-bottom-right-radius: .2rem; 7607 border-bottom-left-radius: .2rem; 7608 background-color: rgb(0,168,74) 7609 } 7610 7611 .btn--link.dw-mod { 7612 color: rgb(0,168,74) 7613 } 7614 7615 .center-container.dw-mod { 7616 max-width: 1280px 7617 } 7618 7619 .site.dw-mod { 7620 background-color: rgb(255,255,255) 7621 } 7622 7623 .logo.dw-mod:not(.logo--mobile) { 7624 background-color: transparent 7625 } 7626 7627 .logo__img.dw-mod:not(.logo__img--mobile) { 7628 height: 75px 7629 } 7630 7631 .main-navigation.dw-mod { 7632 background-color: rgb(255,255,255) 7633 } 7634 7635 .menu--dropdown.dw-mod { 7636 background-color: rgb(243,249,245) 7637 } 7638 7639 .is-dropdown.dw-mod::after { 7640 color: rgb(0,0,0); 7641 font-size: 16px; 7642 line-height: 2.4em 7643 } 7644 7645 .menu-dropdown__item.dw-mod { 7646 color: rgb(0,0,0); 7647 font-size: 16px 7648 } 7649 7650 .mega-menu.dw-mod { 7651 background-color: rgb(243,249,245); 7652 max-width: 1280px 7653 } 7654 7655 .mega-menu__header-container__text.dw-mod { 7656 color: rgb(0,166,75); 7657 font-size: 1.6rem; 7658 font-family: Lato,sans-serif; 7659 text-transform: uppercase 7660 } 7661 7662 .is-mega.dw-mod::after { 7663 line-height: 16px; 7664 color: rgb(0,0,0) 7665 } 7666 7667 .menu__link.dw-mod:not(.menu__link--icon) { 7668 font-family: Lato,sans-serif; 7669 font-size: 16px; 7670 font-weight: 700; 7671 line-height: 1.4; 7672 color: rgb(0,0,0); 7673 text-transform: uppercase 7674 } 7675 7676 .menu__link.dw-mod:not(.menu__link--mobile) { 7677 line-height: 75px 7678 } 7679 7680 .menu__link--icon.dw-mod { 7681 color: rgb(0,0,0) 7682 } 7683 7684 .menu__item--top-level { 7685 border-top-width: 3px; 7686 border-top-style: solid; 7687 border-top-color: transparent; 7688 border-bottom-width: 3px; 7689 border-bottom-style: solid; 7690 border-bottom-color: transparent 7691 } 7692 7693 .menu__item--top-level.dw-mod:not(.menu__item--icon) { 7694 padding: 0 7695 } 7696 7697 .menu__item--top-level.dw-mod:first-of-type { 7698 padding-left: 0 7699 } 7700 7701 .tools-navigation.dw-mod { 7702 background-color: rgb(77,96,116); 7703 font-family: Lato,sans-serif; 7704 font-size: 16px; 7705 line-height: 1.4; 7706 color: rgb(255,255,255); 7707 height: 42px; 7708 } 7709 7710 .flag-icon { 7711 background-size: contain; 7712 position: relative; 7713 display: inline-block; 7714 width: 1.33333333em; 7715 line-height: 1.5em; 7716 background-position: 50% 50%; 7717 background-repeat: no-repeat no-repeat 7718 } 7719 7720 .flag-icon::before { 7721 content: '\00a0' 7722 } 7723 7724 /*.flag-icon-de { 7725 background-image: url(../flags/4x3/de.svg) 7726 } 7727 7728 .flag-icon-dk { 7729 background-image: url(../flags/4x3/dk.svg) 7730 }*/ 7731 7732 h1, h2 { 7733 margin-bottom: 12px 7734 } 7735 7736 7737 /*h1, h2 { 7738 font-family: KobenhavnBold,sans-serif 7739 } 7740 7741 body { 7742 font-family: Kobenhavn-Regular,sans-serif 7743 } 7744 7745 a, p, span, input, li, label { 7746 font-family: Kobenhavn-Regular,sans-serif 7747 }*/ 7748 7749 @@font-face { 7750 font-family: font-icons; 7751 font-display: swap; 7752 src: url(/Files/Templates/Designs/HD2412/css/nz/icon-font/font-icons-31072019.eot?#iefix) format('embedded-opentype'),url(/Files/Templates/Designs/HD2412/css/nz/icon-font/font-icons-31072019.woff) format('woff'),url(/Files/Templates/Designs/HD2412/css/nz/icon-font/font-icons-31072019.ttf) format('truetype'),url(/Files/Templates/Designs/HD2412/css/nz/icon-font/font-icons-31072019.svg#font-icons) format('svg') 7753 } 7754 7755 .icon-nz { 7756 position: relative; 7757 top: 1px; 7758 display: inline-block 7759 } 7760 7761 .icon-nz-arrow-long-right, .icon-nz-search { 7762 position: relative; 7763 top: .1em; 7764 display: inline-block 7765 } 7766 7767 .icon-nz-arrow-long-right::before, .icon-nz-search::before { 7768 font-family: font-icons; 7769 font-style: normal; 7770 font-variant: normal; 7771 font-weight: 400; 7772 height: 1em; 7773 line-height: 1em; 7774 speak: none; 7775 text-indent: 0; 7776 text-transform: none; 7777 -webkit-font-smoothing: antialiased 7778 } 7779 7780 .icon-nz-arrow-long-right::before { 7781 content: '\EA06' 7782 } 7783 7784 .icon-nz-search::before { 7785 content: '\EA35' 7786 } 7787 7788 .btn--link.dw-mod { 7789 font-weight: 700; 7790 text-decoration: underline 7791 } 7792 7793 .hero .grid__cell h1 { 7794 font-size: 35px; 7795 color: rgb(255,255,255); 7796 text-transform: uppercase; 7797 font-weight: 700 7798 } 7799 7800 .hero.paragraph-container { 7801 padding: 0; 7802 margin-top: 8rem 7803 } 7804 7805 @@media (min-width:768px) { 7806 .hero.paragraph-container { 7807 margin-top: 10rem 7808 } 7809 } 7810 7811 @@media (min-width:992px) { 7812 .hero.paragraph-container { 7813 margin-top: 12rem 7814 } 7815 } 7816 7817 .hero .paragraph-container--height-xl { 7818 height: 300px 7819 } 7820 7821 @@media (min-width:768px) { 7822 .hero .paragraph-container--height-xl { 7823 height: 470px 7824 } 7825 } 7826 7827 .hero .paragraph-container--height-xl > .paragraph-container { 7828 height: 300px 7829 } 7830 7831 @@media (min-width:768px) { 7832 .hero .paragraph-container--height-xl > .paragraph-container { 7833 height: 470px 7834 } 7835 } 7836 7837 .hero svg { 7838 position: absolute; 7839 left: 0; 7840 bottom: -1px; 7841 width: 100%; 7842 height: auto 7843 } 7844 7845 .footer__content-newsletter input { 7846 border-top-left-radius: 5px; 7847 border-top-right-radius: 5px; 7848 border-bottom-right-radius: 5px; 7849 border-bottom-left-radius: 5px; 7850 border: none; 7851 padding: 7px; 7852 margin-bottom: 0; 7853 line-height: 20px; 7854 background-color: rgb(77,96,116); 7855 color: rgb(255,255,255); 7856 background-position: initial initial; 7857 background-repeat: initial initial 7858 } 7859 7860 .contactform input { 7861 border: none; 7862 border-top-left-radius: 5px; 7863 border-top-right-radius: 5px; 7864 border-bottom-right-radius: 5px; 7865 border-bottom-left-radius: 5px; 7866 resize: none; 7867 padding: 5px 7868 } 7869 7870 .center-container.dw-mod { 7871 max-width: 1440px 7872 } 7873 7874 .multiple-paragraphs-container h1, .multiple-paragraphs-container h2 { 7875 color: inherit 7876 } 7877 7878 @@media (max-width:480px) { 7879 .grid-custom-layout-second { 7880 padding-left: 1rem; 7881 padding-right: 1rem 7882 } 7883 } 7884 7885 @@media (min-width:992px) { 7886 .grid-custom-layout-second { 7887 width: 100%; 7888 margin: 0 auto; 7889 padding-left: 0; 7890 max-width: 1440px 7891 } 7892 } 7893 7894 .grid-custom-layout-second .paragraph-container--full-width.dw-mod { 7895 max-width: 1440px; 7896 width: 100% 7897 } 7898 7899 .menu__link.dw-mod:not(.menu__link--mobile) { 7900 line-height: 0 7901 } 7902 7903 .page { 7904 margin-top: 100px 7905 } 7906 7907 .dropdown { 7908 position: relative; 7909 display: inline-block; 7910 text-align: left 7911 } 7912 7913 .dropdown.dropdown--absolute-position { 7914 list-style: none; 7915 z-index: 70; 7916 background-color: rgb(255,255,255); 7917 position: absolute; 7918 top: 100%; 7919 left: 0; 7920 box-shadow: rgba(0,0,0,.239216) 0 6px 12px; 7921 margin: 0 7922 } 7923 7924 .menu__item--top-level.dw-mod:not(.menu__item--icon) { 7925 margin-right: .8rem 7926 } 7927 7928 .menu__link.dw-mod:not(.menu__link--icon) { 7929 /*font-family: Kobenhavn-Regular,sans-serif;*/ 7930 font-weight: 400 7931 } 7932 7933 .mega-menu.dw-mod { 7934 border-top-width: 1px; 7935 border-top-style: solid; 7936 border-top-color: rgb(191,233,210); 7937 border-bottom-width: 1px; 7938 border-bottom-style: solid; 7939 border-bottom-color: rgb(191,233,210) 7940 } 7941 7942 .mega-menu__header-container.dw-mod { 7943 margin-bottom: 1rem 7944 } 7945 7946 .mega-menu__header-container.dw-mod .mega-menu__header-container__text.dw-mod { 7947 /*font-family: KobenhavnBold,sans-serif;*/ 7948 font-weight: 400; 7949 text-transform: capitalize; 7950 line-height: 30px; 7951 font-size: 22px; 7952 border-bottom-width: 2px; 7953 border-bottom-style: solid; 7954 border-bottom-color: rgb(0,168,74); 7955 padding-left: 0 7956 } 7957 7958 .top-container--sticky.dw-mod { 7959 z-index: 10001 7960 } 7961 7962 @@media (min-width:1200px) { 7963 .top-container--sticky.dw-mod { 7964 z-index: 90 7965 } 7966 } 7967 7968 @@media (min-width:1200px) { 7969 .language-selector-container { 7970 padding-left: 1rem 7971 } 7972 } 7973 7974 .is-mega.dw-mod::after { 7975 content: '' 7976 } 7977 7978 .overlay { 7979 height: 100%; 7980 width: 100%; 7981 display: none; 7982 position: fixed; 7983 z-index: 1; 7984 top: 0; 7985 left: 0; 7986 background-color: rgb(243,249,245); 7987 margin-top: 90px 7988 } 7989 7990 7991 .overlay .menu--dropdown-right { 7992 display: block; 7993 box-shadow: none 7994 } 7995 7996 .overlay .typeahead-search-field.dw-mod { 7997 border: 1px solid rgb(243,249,245) 7998 } 7999 8000 .overlay-content { 8001 position: relative; 8002 top: 5%; 8003 width: 95%; 8004 margin: auto; 8005 text-align: left 8006 } 8007 8008 @@media (min-width:1200px) { 8009 .overlay-content { 8010 width: 70%; 8011 top: 10%; 8012 text-align: center 8013 } 8014 } 8015 8016 .search-field-fullscreen { 8017 max-width: 100% 8018 } 8019 8020 @@media (min-width:1200px) { 8021 .search-field-fullscreen { 8022 padding-right: 20px; 8023 padding-left: 30px 8024 } 8025 } 8026 8027 .fullscreen-input-field.dw-mod { 8028 background-color: rgb(243,249,245); 8029 height: 100px; 8030 color: rgb(0,168,74); 8031 /*font-family: KobenhavnBold,sans-serif;*/ 8032 border: 1px solid rgb(243,249,245); 8033 outline: rgb(0,0,0); 8034 font-size: 2rem; 8035 padding-left: 3rem 8036 } 8037 8038 .fullscreen-input-field.dw-mod::-webkit-input-placeholder { 8039 /*font-family: Kobenhavn-Regular,sans-serif;*/ 8040 color: rgb(163,176,181) 8041 } 8042 8043 @@media (min-width:1200px) { 8044 .fullscreen-input-field.dw-mod { 8045 border-bottom-width: 2px; 8046 border-bottom-style: solid; 8047 border-bottom-color: rgb(116,126,146); 8048 font-size: 3rem; 8049 padding-left: 6rem 8050 } 8051 } 8052 8053 .input-search-icon { 8054 position: absolute; 8055 z-index: 90; 8056 left: -5px; 8057 top: 40% 8058 } 8059 8060 .input-search-icon::before { 8061 font-weight: 700; 8062 font-size: 30px 8063 } 8064 8065 @@media (min-width:1200px) { 8066 .input-search-icon { 8067 left: 10px 8068 } 8069 } 8070 8071 .input-arrow-icon { 8072 position: absolute; 8073 right: 0; 8074 top: 40%; 8075 z-index: 90 8076 } 8077 8078 .input-arrow-icon::before { 8079 font-weight: 700; 8080 font-size: 30px; 8081 color: rgb(0,168,74) 8082 } 8083 8084 .menu__item--icon::before { 8085 content: ''; 8086 height: 100%; 8087 width: 1px; 8088 background-color: rgb(115,125,145); 8089 opacity: .3; 8090 background-position: initial initial; 8091 background-repeat: initial initial 8092 } 8093 8094 .menu__item--icon:last-of-type::after { 8095 content: ''; 8096 height: 100%; 8097 width: 1px; 8098 background-color: rgb(115,125,145); 8099 opacity: .3; 8100 background-position: initial initial; 8101 background-repeat: initial initial 8102 } 8103 8104 .custom-header-menu { 8105 padding-right: 1rem 8106 } 8107 8108 .custom-header-menu .menu__link.menu__link--icon.dw-mod { 8109 padding-top: 1rem 8110 } 8111 8112 .custom-header-menu .menu__link.menu__link--icon.dw-mod .icon-nz { 8113 font-size: 20px 8114 } 8115 8116 @@media (min-width:1200px) { 8117 .custom-header-menu .menu__link.menu__link--icon.dw-mod { 8118 margin-left: 2rem; 8119 margin-right: 2rem 8120 } 8121 } 8122 8123 .u-no-border { 8124 border: none 8125 } 8126 </style> 8127 8128 <!-- Favicon --> 8129 <link href="@favicon" rel="icon" type="image/png"> 8130 8131 <!-- Base (Default, wireframe) styles --> 8132 <link rel="stylesheet" href="/Files/Templates/Designs/HD2412/css/base/base.min.css" as="style" media="screen"> 8133 <noscript><link rel="stylesheet" href="/Files/Templates/Designs/HD2412/css/base/base.min.css"></noscript> 8134 8135 @*<link rel="stylesheet" href="/Files/Templates/Designs/HD2412/css/base/base.min.css" type="text/css" media="screen">*@ 8136 8137 <!-- Rapido Css from Website Settings --> 8138 <link rel="stylesheet" href="@autoCssLink" as="style" media="screen"> 8139 <noscript><link rel="stylesheet" href="@autoCssLink"></noscript> 8140 8141 @*<link rel="stylesheet" id="rapidoCss" href="@autoCssLink" type="text/css" media="screen">*@ 8142 <link href="~/Files/Templates/Designs/HD2412/css/co3/co3.main.css?v=0.8" rel="stylesheet" /> 8143 <link rel="stylesheet" href="/Files/Templates/Designs/HD2412/css/nz/main.css" as="style" media="screen"> 8144 <noscript><link rel="stylesheet" href="/Files/Templates/Designs/HD2412/css/nz/main.css"></noscript> 8145 8146 <!-- Ignite Css (Custom site specific styles) --> 8147 @*<link rel="stylesheet" id="igniteCss" type="text/css" href="/Files/Templates/Designs/HD2412/css/nz/main.css" media="screen">*@ 8148 8149 <!-- Font awesome --> 8150 <link rel="preload" href="@fontAwesomeCssLink" as="style" onload="this.onload=null;this.rel='stylesheet'" media="screen"> 8151 <noscript><link rel="stylesheet" href="@fontAwesomeCssLink"></noscript> 8152 8153 @*<link rel="stylesheet" href="@fontAwesomeCssLink" type="text/css" media="screen">*@ 8154 8155 <!-- Flag icon --> 8156 @*<link rel="stylesheet" href="/Files/Templates/Designs/HD2412/css/fonts/flag-icon.min.css" type="text/css" media="screen">*@ 8157 8158 <!-- Google fonts --> 8159 @*@{ 8160 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))); 8161 } 8162 <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet">*@ 8163 @{ 8164 PushPromise(favicon); 8165 PushPromise(fontAwesomeCssLink); 8166 PushPromise("/Files/Templates/Designs/HD2412/css/base/base.min.css"); 8167 PushPromise(autoCssLink); 8168 PushPromise("/Files/Templates/Designs/HD2412/css/ignite/ignite.min.css"); 8169 PushPromise("/Files/Templates/Designs/HD2412/css/nz/main.css"); 8170 PushPromise("/Files/Images/placeholder.gif"); 8171 } 8172 8173 @if (!String.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("AppName"))) 8174 { 8175 <link rel="manifest" href="/Files/Templates/Designs/HD2412/manifest.json"> 8176 PushPromise("/Files/Templates/Designs/HD2412/manifest.json"); 8177 } 8178 @if (!String.IsNullOrEmpty(headerScripts)) 8179 { 8180 @headerScripts 8181 } 8182 @if (!String.IsNullOrEmpty(pageHeaderScripts)) 8183 { 8184 @pageHeaderScripts 8185 } 8186 8187 8188 @*HREF LANG*@ 8189 @{ 8190 List<HypertextReference> References = HypertextReference.GetReferences(Model.Languages, Dynamicweb.Context.Current.Request.Url.ToString()); 8191 } 8192 8193 @if (References.Any()) 8194 { 8195 foreach (HypertextReference reference in References) 8196 { 8197 <link rel="alternate" href='@reference.Url' hreflang='@reference.Culture' /> 8198 } 8199 } 8200 8201 @{ 8202 string businessPhotoPath = Model.Area.Item.GetItem("Settings").GetFile("BusinessPhoto") != null ? Model.Area.Item.GetItem("Settings").GetFile("BusinessPhoto").Path : ""; 8203 var address = Model.Area.Item.GetItem("Settings").GetItem("Address"); 8204 string streetAddress = ""; 8205 string addressLocality = ""; 8206 string addressRegion = ""; 8207 string postalCode = ""; 8208 string addressCountry = ""; 8209 List<string> strings = new List<string>(); 8210 if (address != null) 8211 { 8212 streetAddress = address.GetString("StreetAddress"); 8213 addressLocality = address.GetString("City"); 8214 addressRegion = address.GetString("Region"); 8215 postalCode = address.GetString("PostalCode"); 8216 addressCountry = address.GetString("Country"); 8217 } 8218 string contactEmail = Model.Area.Item.GetItem("Settings").GetString("ContactEmail"); 8219 string contactNumber = Model.Area.Item.GetItem("Settings").GetString("ContactNumber"); 8220 string businessFax = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("BusinessFax"); 8221 string latitude = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("Latitude"); 8222 string longitude = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("Longitude"); 8223 string[] openingHours = Model.Area.Item.GetItem("Settings").GetString("OpeningHours").Split( 8224 new[] { Environment.NewLine }, 8225 StringSplitOptions.None 8226 ); 8227 8228 var currency = Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency(); 8229 string searchParameter = !String.IsNullOrEmpty(HttpContext.Current.Request["Search"]) ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 8230 string areaId = !String.IsNullOrEmpty(HttpContext.Current.Request["Areaid"]) ? HttpContext.Current.Request.QueryString.Get("Areaid") : ""; 8231 int area_id = Model.Area.ID; 8232 string pageType = !String.IsNullOrEmpty(HttpContext.Current.Request["Pagetype"]) ? HttpContext.Current.Request.QueryString.Get("Pagetype") : ""; 8233 string searchFeedId = Converter.ToString(GetPageIdByNavigationTag("ContentSearchFeed")); 8234 string siteUrlWithoutQuery = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 8235 var searchQuery = HttpContext.Current.Request.QueryString.Get("Search"); 8236 } 8237 8238 @if (!string.IsNullOrEmpty(businessName)) 8239 { 8240 <script type="application/ld+json"> 8241 { 8242 "@@context": "http://schema.org", 8243 "@@type": "Store", 8244 "image": [ 8245 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 8246 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 8247 "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath" 8248 ], 8249 "@@id": "@siteURL", 8250 "name": "@businessName", 8251 "address": { 8252 "@@type": "PostalAddress", 8253 "streetAddress": "@streetAddress", 8254 "addressLocality": "@addressLocality", 8255 "addressRegion": "@addressRegion", 8256 "postalCode": "@postalCode", 8257 "addressCountry": "@addressCountry" 8258 } 8259 @if (!string.IsNullOrEmpty(contactEmail)) 8260 { 8261 <text>,"email": "@contactEmail"</text> 8262 } 8263 @if (!string.IsNullOrEmpty(contactNumber)) 8264 { 8265 <text>,"telephone": "@contactNumber"</text> 8266 } 8267 } 8268 </script> 8269 } 8270 8271 @if (siteURL.Contains("hededanmark")) 8272 { 8273 <script type="application/ld+json"> 8274 { 8275 "@@context": "https://schema.org", 8276 "@@type": "Organization", 8277 "name": "@businessName", 8278 "url": "@siteURL", 8279 "aggregateRating": { 8280 "@@type": "AggregateRating", 8281 "ratingValue": "5", 8282 "reviewCount": "2" 8283 }, 8284 8285 @*Social URL link hack from JAA*@ 8286 "sameAs": 8287 [ 8288 @foreach (var socialitem in Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks")) 8289 { 8290 string socialLink = '"' + socialitem.GetString("Link") + '"'; 8291 strings.Add(socialLink); 8292 } 8293 8294 @{ 8295 string joined = string.Join(",", strings); 8296 } 8297 8298 @joined 8299 ] 8300 } 8301 </script> 8302 } 8303 8304 @if (siteURL.Contains("2412")) 8305 { 8306 <script type="application/ld+json"> 8307 { 8308 "@@context": "http://schema.org", 8309 "@@type": "LocalBusiness", 8310 "address": { 8311 "@@type": "PostalAddress", 8312 "streetAddress": "@streetAddress", 8313 "addressLocality": "@addressLocality", 8314 "addressRegion": "@addressRegion", 8315 "postalCode": "@postalCode", 8316 "addressCountry": "@addressCountry" 8317 }, 8318 8319 @if (!string.IsNullOrEmpty(latitude) && !string.IsNullOrEmpty(longitude)) 8320 { 8321 @:"geo": { 8322 @:"@@type": "GeoCoordinates", 8323 @:"latitude": "@latitude", 8324 @:"longitude": "@longitude" 8325 @:}, 8326 } 8327 8328 "sameAs": [ 8329 @{ 8330 IList<ItemViewModel> sameAsUrlsList = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItems("SameAsUrls"); 8331 } 8332 @if (sameAsUrlsList != null && sameAsUrlsList.Any()) 8333 { 8334 foreach (ItemViewModel sameAsUrlListItem in sameAsUrlsList) 8335 { 8336 string sameAsUrl = '"' + sameAsUrlListItem.GetString("Link") + '"'; 8337 strings.Add(sameAsUrl); 8338 } 8339 8340 var joined = string.Join(",", strings); 8341 @joined 8342 } 8343 ], 8344 "description": "@groupMetaDescription", 8345 "name": "@businessName", 8346 "openingHours": [ 8347 @for (int i = 0; i < openingHours.Length; i++) 8348 { 8349 if (i > 0) 8350 {<text> ,</text>} 8351 <text>"@openingHours[i]"</text> 8352 } 8353 ], 8354 @if (!string.IsNullOrEmpty(contactNumber)) 8355 { 8356 <text>"telephone": "@contactNumber",</text> 8357 } 8358 @if (!string.IsNullOrEmpty(businessFax)) 8359 { 8360 <text>"faxNumber": "@businessFax",</text> 8361 } 8362 "image": [ 8363 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 8364 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 8365 "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath" 8366 ], 8367 "priceRange": "$" 8368 } 8369 </script> 8370 } 8371 8372 8373 <script type="application/ld+json"> 8374 @if (String.IsNullOrEmpty(searchParameter)) 8375 { 8376 <text> 8377 { 8378 "@@context": "https://schema.org", 8379 "@@type": "WebSite", 8380 "name": "@businessName", 8381 "url": "@siteUrlWithoutQuery" 8382 } 8383 </text> 8384 } 8385 8386 @if (!String.IsNullOrEmpty(searchParameter)) 8387 { 8388 <text> 8389 { 8390 "@@context": "https://schema.org", 8391 "@@type": "WebSite", 8392 "name": "@businessName", 8393 "url": "@siteUrlWithoutQuery", 8394 "potentialAction": 8395 { 8396 @*Ikke sikker på target valuen er korrekt*@ 8397 "@@type": "SearchAction", 8398 "target": "@siteUrlWithoutQuery/search?search={@searchQuery}", 8399 "query-input": "required name=@searchParameter" 8400 } 8401 } 8402 </text> 8403 } 8404 </script> 8405 8406 <script> 8407 !function (n) { "use strict"; n.loadCSS || (n.loadCSS = function () { }); var o = loadCSS.relpreload = {}; if (o.support = function () { var e; try { e = n.document.createElement("link").relList.supports("preload") } catch (t) { e = !1 } return function () { return e } }(), o.bindMediaToggle = function (t) { var e = t.media || "all"; function a() { t.addEventListener ? t.removeEventListener("load", a) : t.attachEvent && t.detachEvent("onload", a), t.setAttribute("onload", null), t.media = e } t.addEventListener ? t.addEventListener("load", a) : t.attachEvent && t.attachEvent("onload", a), setTimeout(function () { t.rel = "stylesheet", t.media = "only x" }), setTimeout(a, 3e3) }, o.poly = function () { if (!o.support()) for (var t = n.document.getElementsByTagName("link"), e = 0; e < t.length; e++) { var a = t[e]; "preload" !== a.rel || "style" !== a.getAttribute("as") || a.getAttribute("data-loadcss") || (a.setAttribute("data-loadcss", !0), o.bindMediaToggle(a)) } }, !o.support()) { o.poly(); var t = n.setInterval(o.poly, 500); n.addEventListener ? n.addEventListener("load", function () { o.poly(), n.clearInterval(t) }) : n.attachEvent && n.attachEvent("onload", function () { o.poly(), n.clearInterval(t) }) } "undefined" != typeof exports ? exports.loadCSS = loadCSS : n.loadCSS = loadCSS }("undefined" != typeof global ? global : this); 8408 </script> 8409 8410 @{ 8411 string userAgent = HttpContext.Current.Request.UserAgent; 8412 bool isIe11 = userAgent.Contains("Trident") || HttpContext.Current.Request.QueryString["ie11"] == "true"; 8413 } 8414 8415 @if (isIe11) 8416 { 8417 <div id="ie11-popup"> 8418 <input type="checkbox" id="overlay_8669" class="modal-trigger normal"> 8419 <div class="modal-container animation--fadeIn" id="overlayModalContainer_8669"> 8420 <label for="overlay_8669" class="modal-overlay"></label> 8421 <div class="modal u-brand-color-one--bg u-color-light modal--lg modal-height-full dw-mod fade" id="overlayModal_8669"> 8422 <div class="modal__body modal__body--full u-full-height dw-mod"> 8423 <div class="grid u-full-height"> 8424 <div class="grid__col-12 u-full-height background-image dw-mod" style="background-position: center center; background-size: cover;"> 8425 <div class="u-middle u-padding--lg"> 8426 <h2 class="u-ta-left">@Translate("IE-modal-headline-overlay", "This is Internet Explorer")</h2> 8427 <div class="u-ta-left"> 8428 <p>@Translate("IE-modal-text-content", "Du anvender en forældet browser, som ikke understøttes af vores hjemmeside. For at få en bedre brugeroplevelse, anbefaler vi at du downloader en nyere browser til din enhed.")</p> 8429 </div> 8430 <div class="u-margin-top grid--justify-center u-zindex-1 u-position-relative"></div> 8431 </div> 8432 </div> 8433 </div> 8434 </div> 8435 <label class="modal__close-btn dw-mod" for="overlay_8669"></label> 8436 </div> 8437 </div> 8438 </div> 8439 8440 <div id="ie11-buy-popup"> 8441 <input type="checkbox" id="overlay_ie11_buy" class="modal-trigger normal"> 8442 <div class="modal-container animation--fadeIn" id="overlayModalContainer_ie11-buy"> 8443 <label for="overlay_ie11_buy" class="modal-overlay"></label> 8444 <div class="modal u-brand-color-one--bg u-color-light modal--lg modal-height-full dw-mod fade" id="overlayModal_ie11-buy"> 8445 <div class="modal__body modal__body--full u-full-height dw-mod"> 8446 <div class="grid u-full-height"> 8447 <div class="grid__col-12 u-full-height background-image dw-mod" style="background-position: center center; background-size: cover;"> 8448 <div class="u-middle u-padding--lg"> 8449 <h2 class="u-ta-left">@Translate("IE:Buy.Modal.Title", "This is Internet Explorer")</h2> 8450 <div class="u-ta-left"> 8451 <p>@Translate("IE:Buy.Modal.Content", "Du anvender en forældet browser, som ikke understøttes af vores hjemmeside. For at få en bedre brugeroplevelse, anbefaler vi at du downloader en nyere browser til din enhed.")</p> 8452 </div> 8453 <div class="u-margin-top grid--justify-center u-zindex-1 u-position-relative"></div> 8454 </div> 8455 </div> 8456 </div> 8457 </div> 8458 <label class="modal__close-btn dw-mod" for="overlay_ie11_buy"></label> 8459 </div> 8460 </div> 8461 </div> 8462 } 8463 8464 @if (!string.IsNullOrWhiteSpace(FacebookPixelID)) 8465 { 8466 <!-- Facebook Pixel Code --> 8467 <script> 8468 !function(f,b,e,v,n,t,s) 8469 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 8470 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 8471 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 8472 n.queue=[];t=b.createElement(e);t.async=!0; 8473 t.src=v;s=b.getElementsByTagName(e)[0]; 8474 s.parentNode.insertBefore(t,s)}(window, document,'script', 8475 'https://connect.facebook.net/en_US/fbevents.js'); 8476 fbq('init', '@FacebookPixelID'); 8477 fbq('track', 'PageView'); 8478 </script> 8479 <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=@FacebookPixelID&ev=PageView&noscript=1" alt="" /></noscript> 8480 } 8481 @if (area_id == 16) { 8482 <script type="text/javascript"> 8483 _linkedin_partner_id = "602188"; 8484 window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || []; 8485 window._linkedin_data_partner_ids.push(_linkedin_partner_id); 8486 </script> 8487 8488 <script type="text/javascript"> 8489 (function(){var s = document.getElementsByTagName("script")[0]; 8490 var b = document.createElement("script"); 8491 b.type = "text/javascript";b.async = true; 8492 b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js"; 8493 s.parentNode.insertBefore(b, s);})(); 8494 </script> 8495 } 8496 </head> 8497 8498 <body id="area@(area_id)"> 8499 @if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 8500 { 8501 <!-- Google Tag Manager (noscript) --> 8502 <noscript> 8503 <iframe src="https://www.googletagmanager.com/ns.html?id=@GoogleTagManagerID" 8504 height="0" width="0" style="display:none;visibility:hidden"></iframe> 8505 </noscript> 8506 <!-- End Google Tag Manager (noscript) --> 8507 } 8508 @if ( area_id == 16 ) { 8509 <noscript> 8510 <img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=602188&fmt=gif" /> 8511 </noscript> 8512 } 8513 @if (!String.IsNullOrEmpty(bodyScripts)) 8514 { 8515 @bodyScripts 8516 } 8517 @if (!String.IsNullOrEmpty(pageBodyScripts)) 8518 { 8519 @pageBodyScripts 8520 } 8521 8522 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 8523 @RenderBlockList(masterPage.BlocksRoot.BlocksList) 8524 8525 8526 @RenderSnippet("JavaScript") 8527 8528 @helper RenderMasterHeader() 8529 { 8530 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterHeader").OrderBy(item => item.SortId).ToList(); 8531 bool isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 8532 string stickyTop = "top-container--sticky"; 8533 8534 <header class="header top-container @stickyTop js-header dw-mod" id="Top"> 8535 @RenderBlockList(subBlocks) 8536 </header> 8537 } 8538 8539 @helper RenderMain() 8540 { 8541 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMain").OrderBy(item => item.SortId).ToList(); 8542 8543 <main class="site dw-mod js-content"> 8544 @RenderBlockList(subBlocks) 8545 </main> 8546 } 8547 8548 @helper RenderPageContent() 8549 { 8550 bool isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 8551 string pagePos = isNavigationStickyMenu ? "js-page-pos" : ""; 8552 8553 <div id="Page" class="page @pagePos"> 8554 <section class="center-container content-container dw-mod" id="content"> 8555 @using Co3.Espresso.Utilities.Extensions 8556 @using Dynamicweb.Frontend 8557 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 8558 8559 8560 @{ 8561 string columnClass = "12"; 8562 bool isProductPage = HttpContext.Current.Request.QueryString.Get("ProductID") != null; 8563 string backgroundColorClass = Model.PropertyItem != null && Model.PropertyItem.GetList("BackgroundColor") != null && !isProductPage ? "u-" + Model.PropertyItem.GetList("BackgroundColor").SelectedValue + "--bg" : ""; 8564 } 8565 8566 @if (Model.PropertyItem.GetList("ShowBreadcrumb").SelectedValue == "True") 8567 { 8568 <div class="grid__col-12 grid__col--bleed-y py-5 px-0 px-lg-4" style="font-size: 0.85em; opacity: 0.5;"> 8569 @if (!string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["productid"])) 8570 { 8571 var product = new Dynamicweb.Ecommerce.Products.ProductService().GetProductById(Dynamicweb.Context.Current.Request["productid"], (Dynamicweb.Context.Current.Request["variantid"] ?? string.Empty), Dynamicweb.Ecommerce.Common.Context.LanguageID); 8572 var groupsForProduct = product.Groups; 8573 var defaultGroup = groupsForProduct.FirstOrDefault(g => g.Id == product.DefaultGroup.Id); 8574 var shop = Dynamicweb.Ecommerce.Services.Shops.GetShop(PageView.Current().Area.EcomShopId); 8575 var groupPath = defaultGroup != null ? Dynamicweb.Ecommerce.Services.ProductGroups.FindPath(shop, defaultGroup) : null; 8576 int? productPageId = Dynamicweb.Services.Pages?.GetPagesByAreaID(PageView.Current().Area.ID).FirstOrDefault(x => x.NavigationTag.Equals("ProductsPage"))?.ID; 8577 8578 var productName = (product.GetProductFieldValue<string>("DisplayName" ) ?? product.Name); 8579 <ul class="breadcrumb dw-mod"> 8580 <li class="breadcrumb__item dw-mod"> 8581 <a href="Default.aspx?ID=@PageView.Current().Page.ID"> 8582 @PageView.Current().Page.GetDisplayName() 8583 </a> 8584 </li> 8585 @if (groupPath != null) 8586 { 8587 foreach (var group in groupPath) 8588 { 8589 string url = $"{Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl($"Default.aspx?ID={productPageId}&GroupId={group.Id}", Dynamicweb.Ecommerce.Common.Context.LanguageID)}"; 8590 <li class="breadcrumb__item dw-mod"> 8591 <a href="@url">@group.Name</a> 8592 </li> 8593 } 8594 } 8595 8596 <li class="breadcrumb__item dw-mod"> 8597 @productName 8598 </li> 8599 </ul> 8600 } 8601 else 8602 { 8603 @RenderNavigation(new 8604 { 8605 id = "breadcrumb", 8606 template = "Breadcrumb.xslt" 8607 }) 8608 } 8609 </div> 8610 } 8611 8612 <div class="grid"> 8613 @if (Model.PropertyItem != null && Model.PropertyItem.GetList("LeftMenu") != null && Model.PropertyItem.GetList("LeftMenu").SelectedValue == "True" && (Pageview.Page.NavigationSettings == null || !Pageview.Page.NavigationSettings.UseEcomGroups)) 8614 { 8615 var navigationMarkup = RenderNavigation(new 8616 { 8617 id = "leftnav", 8618 cssclass = "dwnavigation customer-center-nav", 8619 startLevel = 2, 8620 expandmode = "all", 8621 endlevel = 5, 8622 template = "LeftNavigation.xslt" 8623 }); 8624 8625 if (!string.IsNullOrEmpty(navigationMarkup)) 8626 { 8627 <nav class="grid__col-md-3 customer-center-grid-container"> 8628 <div class="grid__cell"> 8629 @navigationMarkup 8630 </div> 8631 </nav> 8632 columnClass = "9"; 8633 } 8634 } 8635 <div class="grid__col-md-@columnClass grid__col--bleed"> 8636 <div class="grid"> 8637 @Model.Placeholder("dwcontent", "content", "default:true;sort:1") 8638 </div> 8639 </div> 8640 </div> 8641 8642 8643 @* Very small hack to make it cleanly, and easily possible to change the background color on a single page *@ 8644 @if (backgroundColorClass != "") 8645 { 8646 <script> 8647 document.getElementById("Page").classList.add("@backgroundColorClass"); 8648 </script> 8649 } 8650 </section> 8651 </div> 8652 } 8653 <script type="module" src="~/Files/Templates/Designs/HD2412/js/co3/co3.main.js?v=0.2"></script> 8654 @if (isIe11) 8655 { 8656 <script type="text/javascript" src="~/Files/Templates/Designs/HD2412/js/co3/ie11.js"></script> 8657 } 8658 8659 </body> 8660 </html>