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