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_3e56955349b94ab6899b1c80cf2942d2.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 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") 3450 { 3451 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3452 3453 @using System 3454 @using System.Web 3455 @using System.Collections.Generic 3456 @using Dynamicweb.Rapido.Blocks.Extensibility 3457 @using Dynamicweb.Rapido.Blocks 3458 @using Dynamicweb.Frontend.Devices 3459 @using Dynamicweb.Extensibility 3460 @using Dynamicweb.Content 3461 @using Dynamicweb.Core 3462 @using System 3463 @using System.IO 3464 @using System.Web 3465 @using System.Collections.Generic; 3466 @using System.Linq 3467 @using System.Text.RegularExpressions 3468 @using Dynamicweb.Admin.dk.dynamicweb.templates 3469 @using Dynamicweb.Ecommerce.Frontend 3470 @using Dynamicweb.Rapido.Blocks 3471 @using Dynamicweb.Rendering 3472 3473 @functions { 3474 BlocksPage mobileHeaderBlocksPage = BlocksPage.GetBlockPage("Master"); 3475 3476 public class SearchConfiguration 3477 { 3478 public string searchFeedId { get; set; } 3479 public string searchSecondFeedId { get; set; } 3480 public int groupsFeedId { get; set; } 3481 public string resultPageLink { get; set; } 3482 public string searchPlaceholder { get; set; } 3483 public string searchType { get; set; } 3484 public string searchTemplate { get; set; } 3485 public string searchContentTemplate { get; set; } 3486 public string searchValue { get; set; } 3487 public bool showGroups { get; set; } 3488 3489 public SearchConfiguration() 3490 { 3491 searchFeedId = ""; 3492 searchSecondFeedId = ""; 3493 searchType = "product-search"; 3494 searchContentTemplate = ""; 3495 showGroups = true; 3496 } 3497 } 3498 } 3499 3500 @{ 3501 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"; 3502 bool hideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 3503 bool hideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 3504 bool hideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 3505 3506 3507 Block mobileHeader = new Block() 3508 { 3509 Id = "MobileTop", 3510 SortId = 10, 3511 Template = RenderMobileTop(), 3512 SkipRenderBlocksList = true 3513 }; 3514 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeader); 3515 3516 Block mobileHeaderNavigation = new Block() 3517 { 3518 Id = "MobileHeaderNavigation", 3519 SortId = 10, 3520 Template = RenderMobileHeaderNavigation(), 3521 SkipRenderBlocksList = true, 3522 BlocksList = new List<Block> { 3523 new Block { 3524 Id = "MobileHeaderNavigationTrigger", 3525 SortId = 10, 3526 Template = RenderMobileHeaderNavigationTrigger() 3527 } 3528 } 3529 }; 3530 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderNavigation); 3531 3532 3533 Block mobileHeaderLogo = new Block() 3534 { 3535 Id = "MobileHeaderLogo", 3536 SortId = 20, 3537 Template = RenderMobileHeaderLogo(), 3538 SkipRenderBlocksList = true 3539 }; 3540 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderLogo); 3541 3542 Block mobileHeaderActions = new Block() 3543 { 3544 Id = "MobileHeaderActions", 3545 SortId = 30, 3546 Template = RenderMobileTopActions(), 3547 SkipRenderBlocksList = true 3548 }; 3549 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderActions); 3550 3551 if (hideSearch == false) 3552 { 3553 Block mobileHeaderSearch = new Block 3554 { 3555 Id = "MobileHeaderSearch", 3556 SortId = 10, 3557 Template = RenderMobileTopSearch() 3558 }; 3559 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderSearch); 3560 } 3561 3562 Block mobileHeaderMiniCart; 3563 3564 if (!hideCart) 3565 { 3566 mobileHeaderMiniCart = new Block 3567 { 3568 Id = "MobileHeaderMiniCart", 3569 SortId = 20, 3570 Template = RenderMobileTopMiniCart() 3571 }; 3572 3573 Block miniCartCounterScriptTemplate = new Block 3574 { 3575 Id = "MiniCartCounterScriptTemplate", 3576 Template = RenderMobileMiniCartCounterContent() 3577 }; 3578 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", miniCartCounterScriptTemplate); 3579 } 3580 else 3581 { 3582 mobileHeaderMiniCart = new Block 3583 { 3584 Id = "MobileHeaderMiniCart", 3585 SortId = 20 3586 }; 3587 } 3588 3589 if (!hideSearch) 3590 { 3591 Block mobileHeaderSearchBar = new Block() 3592 { 3593 Id = "MobileHeaderSearchBar", 3594 SortId = 30, 3595 Template = RenderMobileTopSearchBar() 3596 }; 3597 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeaderSearchBar); 3598 } 3599 3600 switch (mobileTopLayout) 3601 { 3602 case "nav-left": 3603 mobileHeaderNavigation.SortId = 10; 3604 mobileHeaderLogo.SortId = 20; 3605 mobileHeaderActions.SortId = 30; 3606 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 3607 break; 3608 case "nav-right": 3609 mobileHeaderLogo.SortId = 10; 3610 mobileHeaderActions.SortId = 20; 3611 mobileHeaderNavigation.SortId = 30; 3612 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 3613 break; 3614 case "nav-search-left": 3615 mobileHeaderNavigation.SortId = 10; 3616 mobileHeaderLogo.SortId = 20; 3617 mobileHeaderActions.SortId = 30; 3618 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 3619 break; 3620 case "search-left": 3621 mobileHeaderActions.SortId = 10; 3622 mobileHeaderLogo.SortId = 20; 3623 mobileHeaderNavigation.SortId = 30; 3624 mobileHeaderMiniCart.SortId = 0; 3625 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 3626 break; 3627 } 3628 } 3629 3630 3631 @helper RenderMobileTop() 3632 { 3633 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileTop").OrderBy(item => item.SortId).ToList(); 3634 3635 <nav class="main-navigation-mobile dw-mod"> 3636 <div class="center-container top-container__center-container dw-mod"> 3637 <div class="grid grid--align-center"> 3638 @RenderBlockList(subBlocks) 3639 </div> 3640 </div> 3641 </nav> 3642 } 3643 3644 @helper RenderMobileHeaderNavigation() 3645 { 3646 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderNavigation").OrderBy(item => item.SortId).ToList(); 3647 3648 <div class="grid__col-auto-width no-padding-right"> 3649 <ul class="menu dw-mod"> 3650 @RenderBlockList(subBlocks) 3651 </ul> 3652 </div> 3653 } 3654 3655 @helper RenderMobileHeaderNavigationTrigger() 3656 { 3657 bool customCountrySelector = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetBoolean("CustomCountrySelector"); 3658 <li class="menu__item menu__item--horizontal menu__item--top-level menu__item--icon dw-mod"> 3659 <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> 3660 </li> 3661 3662 <script> 3663 const closeSearch = document.getElementById('closebtn'); 3664 3665 document.querySelector('.js-toggle-class').addEventListener('click', () =>{ 3666 const searchOverlay = document.getElementById('searchOverlay'); 3667 if (document.body.classList.contains('no-scroll')) { 3668 document.body.classList.remove( 'no-scroll', 'show-search' ); 3669 searchOverlay.style.display = "none"; 3670 closeSearch.classList.remove( 'icon-nz-close' ); 3671 closeSearch.classList.add( 'icon-nz-search' ); 3672 } 3673 }); 3674 closeSearch.addEventListener('click', () =>{ 3675 const mobileToggleBtn = document.querySelector('.js-toggle-class'); 3676 if (mobileToggleBtn.classList.contains('is-active')) { 3677 mobileToggleBtn.classList.remove( 'is-active' ); 3678 document.getElementById('MobileNavTrigger').checked = false; 3679 } 3680 }); 3681 </script> 3682 3683 } 3684 3685 @helper RenderMobileHeaderLogo() 3686 { 3687 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderLogo").OrderBy(item => item.SortId).ToList(); 3688 3689 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"; 3690 string centeredLogo = mobileTopLayout != "nav-right" ? "u-ta-center" : ""; 3691 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 3692 string businessName = Model.Area.Item.GetItem("Settings").GetString("BusinessName"); 3693 3694 string mobileLogo = "/Files/Images/logo-dynamicweb.png"; 3695 if (Model.Area.Item.GetItem("Layout").GetItem("MobileTop") != null && Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo") != null) 3696 { 3697 mobileLogo = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo").PathUrlEncoded; 3698 } 3699 3700 if (Path.GetExtension(mobileLogo).ToLower() != ".svg") 3701 { 3702 mobileLogo = "/Admin/Public/GetImage.ashx?height=100&amp;crop=5&amp;Compression=75&amp;image=" + mobileLogo; 3703 } 3704 else 3705 { 3706 mobileLogo = HttpUtility.UrlDecode(mobileLogo); 3707 } 3708 3709 <div class="grid__col-auto grid__col--bleed"> 3710 <div class="grid__cell @centeredLogo"> 3711 <a href="/Default.aspx?ID=@firstPageId" class="logo logo--mobile u-inline-block dw-mod"> 3712 <img class="grid__cell-img logo__img logo__img--mobile dw-mod" src="@mobileLogo" alt="@businessName" /> 3713 </a> 3714 </div> 3715 3716 @RenderBlockList(subBlocks) 3717 </div> 3718 } 3719 3720 @helper RenderMobileTopActions() 3721 { 3722 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderActions").OrderBy(item => item.SortId).ToList(); 3723 bool customCountrySelector = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetBoolean("CustomCountrySelector"); 3724 3725 bool autoshowCountrySelector = false; 3726 bool isShippingCountryCookieSet = false; 3727 3728 var websiteShippingCountries = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItems("Countries"); 3729 3730 if (customCountrySelector) 3731 { 3732 List<string> validWebsiteShippingCountryCodes = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItems("Countries").Select(c => c.GetString("CountryCode")).ToList(); 3733 S_DW_HD2412.CustomCode.ShippingCountries shippingCountries = new S_DW_HD2412.CustomCode.ShippingCountries(validWebsiteShippingCountryCodes); 3734 3735 3736 isShippingCountryCookieSet = shippingCountries.Handling(); 3737 autoshowCountrySelector = !isShippingCountryCookieSet; 3738 } 3739 3740 var currentCountry = Dynamicweb.Ecommerce.Common.Context.Country; 3741 3742 <div class="grid__col-auto-width"> 3743 <ul class="menu dw-mod" style="display:flex;"> 3744 @RenderBlockList(subBlocks) 3745 3746 @if (customCountrySelector) 3747 { 3748 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod js-custom-country-selector-toggler" data-toggle-on-load="@autoshowCountrySelector"> 3749 <span class="flag-icon flag-icon-@Dynamicweb.Ecommerce.Common.Context.Country.Code2.ToLower() u-margin-right"></span> 3750 </li> 3751 } 3752 3753 </ul> 3754 3755 </div> 3756 3757 if (customCountrySelector) 3758 { 3759 string logo = Model.Area.Item.GetItem("Layout").GetFile("LogoImage") != null ? Model.Area.Item.GetItem("Layout").GetFile("LogoImage").PathUrlEncoded : "/Files/Images/logo-dynamicweb.png"; 3760 if (Path.GetExtension(logo).ToLower() != ".svg") 3761 { 3762 int logoHeight = Model.Area.Item.GetItem("Layout").GetInt32("LogoHeight"); 3763 logoHeight = logoHeight > 0 && Pageview.Device.ToString() != "Mobile" ? logoHeight : 40; 3764 logo = "/Admin/Public/GetImage.ashx?height=" + Converter.ToString(logoHeight) + "&amp;crop=5&amp;Compression=75&amp;image=" + logo; 3765 } 3766 else 3767 { 3768 logo = HttpUtility.UrlDecode(logo); 3769 } 3770 <div class="js-custom-country-selector-area custom-country-selector-area custom-country-selector-area--mobile"> 3771 <div class="country-container center-container dw-mod"> 3772 @{ 3773 string toggleShippingCountryForm = "u-hidden"; 3774 } 3775 @if (!isShippingCountryCookieSet) 3776 { 3777 toggleShippingCountryForm = ""; 3778 <img src="@logo" alt="Logo" class="mobile-img" /> 3779 <p class="header header--mobile">@Translate("CountrySelector.Welcome", "Velkommen til vores webshop!")</p> 3780 } 3781 <div class="selected-shipping-country selected-shipping-country--mobile"> 3782 <p> 3783 @Translate("CountrySelector.CurrentShippingCountry", "Forsendelsesland: ") 3784 <span> @currentCountry.Name | </span><span>@Dynamicweb.Ecommerce.Common.Context.Currency.Code</span> 3785 <span class="u-margin-left flag-icon flag-icon-@currentCountry.Code2.ToLower()"></span> 3786 </p> 3787 </div> 3788 3789 <form method="post" class="@toggleShippingCountryForm"> 3790 <input type="hidden" name="SetCountryCode" value="@currentCountry.Code2" /> 3791 <button class="btn btn--primary dw-mod js-custom-country-selector-confirm mobile-button"> 3792 @Translate("CountrySelector.ConfirmSelection", "Jeg er enig, og vil gerne forts&aelig;tte til webshoppen") 3793 </button> 3794 </form> 3795 3796 <div class="other-options other-options--mobile"> 3797 <div class="option"> 3798 <p>@Translate("CountrySelector.PickOtherShippingHeader", "V&aelig;lg et andet forsendelsesland")</p> 3799 @foreach (var country in websiteShippingCountries.Where(c => c.GetString("CountryCode") != currentCountry.Code2)) 3800 { 3801 string countryCode = country.GetString("CountryCode"); 3802 var countryDw = new Dynamicweb.Ecommerce.International.CountryService().GetCountry(countryCode); 3803 string countryName = countryDw != null ? countryDw.Name : countryCode; 3804 string countryFlagIconClass = "flag-icon-" + countryCode.ToLower(); 3805 3806 string currencyCode = country.GetString("CurrencyCode"); 3807 3808 <form action="/" method="post"> 3809 <input type="hidden" name="SetCountryCode" value="@countryCode" /> 3810 <button class="" type="submit">@countryName | @currencyCode <span class="u-margin-left flag-icon @countryFlagIconClass"></span></button> 3811 </form> 3812 } 3813 3814 </div> 3815 <div class="option"> 3816 <p>@Translate("CountrySelector.GoToOtherWebshopHeader", "G&aring; til en af vores andre webshops")</p> 3817 @foreach (var websiteLink in Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItems("WebsiteLinks")) 3818 { 3819 string countryCode = websiteLink.GetString("CountryCode"); 3820 string countryFlagIconClass = "flag-icon-" + countryCode.ToLower(); 3821 string linkUrl = websiteLink.GetString("Link"); 3822 string linkText = websiteLink.GetString("Text"); 3823 3824 <div> 3825 <a href="@linkUrl"> 3826 <span class="u-margin-right flag-icon @countryFlagIconClass"></span> 3827 <span>@linkText</span> 3828 </a> 3829 </div> 3830 3831 } 3832 </div> 3833 </div> 3834 </div> 3835 </div> 3836 } 3837 3838 } 3839 3840 @helper RenderMobileTopSearch() 3841 { 3842 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 3843 3844 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 3845 <div class="menu__link menu__link--icon dw-mod openBtn @(siteURL.Contains("hd2412") ? "hd2412-search-icon" : "hededanmark-search-icon")"> 3846 @* To switch from orange icon and search text - HD2412 *@ 3847 @if (siteURL.Contains("hd2412")) 3848 { 3849 <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> 3850 } 3851 3852 else 3853 { 3854 <span class="closebtn icon-nz icon-nz-search" id="closebtn" title="Close Overlay"></span> 3855 } 3856 </div> 3857 </li> 3858 3859 <script defer> 3860 var clickState = 0; 3861 var btn = document.querySelector('.openBtn'); 3862 3863 btn.addEventListener('click', function () { 3864 3865 if (clickState == 0) { 3866 // code snippet 1 3867 document.getElementById("searchOverlay").style.display = "block"; 3868 3869 document.getElementById("closebtn").classList.remove('icon-nz-search'); 3870 document.getElementById("closebtn").classList.add('icon-nz-close'); 3871 document.body.classList.add('no-scroll'); 3872 clickState = 1; 3873 } else { 3874 // code snippet 2 3875 document.getElementById("searchOverlay").style.display = "none"; 3876 document.getElementById("closebtn").classList.remove('icon-nz-close'); 3877 document.getElementById("closebtn").classList.add('icon-nz-search'); 3878 document.body.classList.remove('no-scroll'); 3879 3880 clickState = 0; 3881 } 3882 3883 }); 3884 3885 </script> 3886 } 3887 3888 @helper RenderMobileTopMiniCart() 3889 { 3890 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 3891 int cartPageId = GetPageIdByNavigationTag("CartPage"); 3892 double cartProductsCount = Model.Cart.TotalProductsCount; 3893 3894 <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')"> 3895 <div class="mini-cart dw-mod"> 3896 <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"> 3897 <div class="u-inline u-position-relative"> 3898 <span class="icon-nz icon-nz-cart dw-mod"></span> 3899 <div class="mini-cart__counter dw-mod"> 3900 <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"> 3901 <div class="js-mini-cart-counter-content"> 3902 @cartProductsCount 3903 </div> 3904 </div> 3905 </div> 3906 </div> 3907 </a> 3908 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 3909 { 3910 <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> 3911 } 3912 </div> 3913 </li> 3914 } 3915 3916 @helper RenderMobileTopSearchBar() 3917 { 3918 string searchFeedId = ""; 3919 string searchSecondFeedId = ""; 3920 int groupsFeedId; 3921 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 3922 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 3923 string resultPageLink; 3924 string searchPlaceholder; 3925 string searchType = "product-search"; 3926 string searchTemplate; 3927 string searchContentTemplate = ""; 3928 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 3929 bool showGroups = true; 3930 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 3931 3932 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 3933 { 3934 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 3935 resultPageLink = contentSearchPageLink; 3936 searchPlaceholder = Translate("FullscreenSearchText"); 3937 groupsFeedId = 0; 3938 searchType = "content-search"; 3939 searchTemplate = "SearchPagesTemplate"; 3940 showGroups = false; 3941 } 3942 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 3943 { 3944 searchFeedId = productsPageId + "&feed=true"; 3945 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 3946 resultPageLink = Converter.ToString(productsPageId); 3947 searchPlaceholder = Translate("Search products or pages"); 3948 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 3949 searchType = "combined-search"; 3950 searchTemplate = "SearchProductsTemplateWrap"; 3951 searchContentTemplate = "SearchPagesTemplateWrap"; 3952 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 3953 } 3954 else 3955 { 3956 resultPageLink = Converter.ToString(productsPageId); 3957 searchFeedId = productsPageId + "&feed=true"; 3958 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 3959 searchPlaceholder = Translate("Search products"); 3960 searchTemplate = "SearchProductsTemplate"; 3961 searchType = "product-search"; 3962 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 3963 } 3964 3965 bool isWebshop = false; 3966 3967 // Check if we're on a webshop 3968 IList<Area> areaIds = Dynamicweb.Services.Areas.GetAreas(); 3969 if (areaIds.Any(x => x.ID == 2 || x.ID == 3 || x.ID == 33)) 3970 { 3971 isWebshop = true; 3972 } 3973 3974 3975 SearchConfiguration searchConfiguration = null; 3976 3977 switch (searchType) 3978 { 3979 case "contentSearch": 3980 searchConfiguration = new SearchConfiguration() 3981 { 3982 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true", 3983 resultPageLink = contentSearchPageLink, 3984 searchPlaceholder = Translate("FullscreenSearchText"), 3985 groupsFeedId = 0, 3986 searchType = "content-search", 3987 searchTemplate = "SearchPagesTemplate", 3988 showGroups = false 3989 }; 3990 break; 3991 case "combinedSearch": 3992 searchConfiguration = new SearchConfiguration() 3993 { 3994 searchFeedId = productsPageId + "&feed=true", 3995 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true", 3996 resultPageLink = Converter.ToString(productsPageId), 3997 searchPlaceholder = Translate("Search products or pages"), 3998 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"), 3999 searchType = "combined-search", 4000 searchTemplate = "SearchProductsTemplateWrap", 4001 searchContentTemplate = "SearchPagesTemplateWrap", 4002 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector") 4003 }; 4004 break; 4005 default: //productSearch 4006 searchConfiguration = new SearchConfiguration() 4007 { 4008 resultPageLink = Converter.ToString(productsPageId), 4009 searchFeedId = productsPageId + "&feed=true", 4010 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"), 4011 searchPlaceholder = Translate("Search products"), 4012 searchTemplate = "SearchProductsTemplate", 4013 searchType = "product-search", 4014 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector") 4015 }; 4016 break; 4017 } 4018 searchConfiguration.searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 4019 4020 4021 4022 <div id="searchOverlay" class="overlay"> 4023 <div class="overlay-content"> 4024 @if (!isWebshop) 4025 { 4026 <div class="menu menu--dropdown menu--dropdown-right u-no-padding u-w380px grid__cell dw-mod"> 4027 <div class="typeahead js-typeahead search-field-fullscreen" id="ProductSearchBar" 4028 data-page-size="7" 4029 data-search-feed-id="@searchConfiguration.searchFeedId" 4030 data-search-second-feed-id="@searchConfiguration.searchSecondFeedId" 4031 data-result-page-id="@searchConfiguration.resultPageLink" 4032 data-search-type="@searchConfiguration.searchType"> 4033 <div class="typeahead-search-field dw-mod" id="typeahead-search-field"> 4034 4035 <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"> 4036 4037 <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"> 4038 <span class="icon-nz icon-nz-search input-search-icon @(siteURL.Contains("hd2412") ? "orange-text dw-mod" : "")"></span> 4039 </a> 4040 4041 <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"> 4042 <span class="icon-nz icon-nz-arrow-long-right input-arrow-icon"></span> 4043 </a> 4044 4045 4046 @if (string.IsNullOrEmpty(searchConfiguration.searchSecondFeedId)) 4047 { 4048 <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> 4049 } 4050 else 4051 { 4052 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--right-aligned"> 4053 <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> 4054 <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> 4055 </div> 4056 } 4057 </div> 4058 </div> 4059 </div> 4060 } 4061 // HD2412 Instant Search 4062 else 4063 { 4064 <div class="menu menu--dropdown menu--dropdown-right u-no-padding u-w380px grid__cell dw-mod"> 4065 <div id="searchContainer"> 4066 @{ 4067 string noResultsText = Translate("InstantSearch.NoResults", "No results found"); 4068 } 4069 <Search 4070 no-search-result="@noResultsText"></Search> 4071 </div> 4072 </div> 4073 } 4074 </div> 4075 </div> 4076 4077 <script defer> 4078 document.addEventListener("DOMContentLoaded", function (event) { 4079 4080 4081 4082 var bestPictures = new Bloodhound({ 4083 datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), 4084 4085 queryTokenizer: Bloodhound.tokenizers.whitespace, 4086 4087 prefetch: { 4088 url:'/Default.aspx?ID=@searchFeedId', 4089 transform: function (data) { // we modify the prefetch response 4090 var newData = []; // here to match the response format 4091 data.forEach(function (item) { // of the remote endpoint 4092 newData.push({'name': item}); 4093 }); 4094 return newData; 4095 } 4096 }, 4097 4098 remote: { 4099 url: '/Default.aspx?ID=@searchFeedId&Search=%QUERY', 4100 wildcard: '%QUERY' 4101 } 4102 }); 4103 4104 4105 $('#typeahead-search-field .typeahead').typeahead({ 4106 minLength: 1, 4107 highlight: true 4108 }, 4109 { 4110 name: 'name', 4111 display: 'name', 4112 source: bestPictures, 4113 limit: 3, 4114 async: true, 4115 templates: { 4116 empty: [ 4117 '<div class="empty-message">', 4118 '@Translate("Your search gave 0 results")', 4119 '</div>' 4120 ].join('\n'), 4121 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>') 4122 } 4123 4124 }).on('keypress', function(e) { 4125 if (e.which == 13) { 4126 var q = $('input.typeahead.tt-input').val(); 4127 window.location.href = "/Default.aspx?ID=@resultPageLink&Search="+q; 4128 } 4129 }); 4130 }); 4131 4132 </script> 4133 } 4134 4135 @helper RenderMobileMiniCartCounterContent() 4136 { 4137 bool showPrice = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 4138 string counterPosition = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue : "right"; 4139 bool showPriceInMiniCartCounter = Pageview.Device.ToString() != "Mobile" && counterPosition == "right" && showPrice; 4140 4141 <script id="MiniCartCounterContent" type="text/x-template"> 4142 {{#.}} 4143 <div class="js-mini-cart-counter-content dw-mod"> 4144 @if (showPriceInMiniCartCounter) 4145 { 4146 @Translate("Cart")<text>({{numberofproducts}}) {{totalprice}}</text> 4147 } 4148 else 4149 { 4150 <text>{{numberofproducts}}</text> 4151 } 4152 </div> 4153 {{/.}} 4154 </script> 4155 }</text> 4156 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4157 4158 @using System 4159 @using System.Web 4160 @using System.Collections.Generic 4161 @using Dynamicweb.Frontend 4162 @using Dynamicweb.Rapido.Blocks.Extensibility 4163 @using Dynamicweb.Rapido.Blocks 4164 4165 @functions { 4166 BlocksPage mobileNavigationBlocksPage = BlocksPage.GetBlockPage("Master"); 4167 } 4168 4169 @{ 4170 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 4171 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 4172 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 4173 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 4174 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 4175 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 4176 4177 Block mobileNavigation = new Block() 4178 { 4179 Id = "MobileNavigation", 4180 SortId = 10, 4181 Template = MobileNavigation(), 4182 SkipRenderBlocksList = true 4183 }; 4184 mobileNavigationBlocksPage.Add(MasterBlockId.MasterTopSnippets, mobileNavigation); 4185 4186 if (Model.CurrentUser.ID > 0 && !hideMyProfileLink) 4187 { 4188 Block mobileNavigationSignIn = new Block 4189 { 4190 Id = "MobileNavigationSignIn", 4191 SortId = 10, 4192 Template = RenderMobileNavigationSignIn() 4193 }; 4194 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationSignIn); 4195 } 4196 4197 Block mobileNavigationMenu = new Block 4198 { 4199 Id = "MobileNavigationMenu", 4200 SortId = 20, 4201 Template = RenderMobileNavigationMenu() 4202 }; 4203 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationMenu); 4204 4205 Block mobileNavigationActions = new Block 4206 { 4207 Id = "MobileNavigationActions", 4208 SortId = 30, 4209 Template = RenderMobileNavigationActions(), 4210 SkipRenderBlocksList = true 4211 }; 4212 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationActions); 4213 4214 if (!navigationItemsHideSignIn) 4215 { 4216 if (Model.CurrentUser.ID <= 0) 4217 { 4218 Block mobileNavigationSignInAction = new Block 4219 { 4220 Id = "MobileNavigationSignInAction", 4221 SortId = 10, 4222 Template = RenderMobileNavigationSignInAction() 4223 }; 4224 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignInAction); 4225 4226 if (!hideCreateAccountLink) 4227 { 4228 Block mobileNavigationCreateAccountAction = new Block 4229 { 4230 Id = "MobileNavigationCreateAccountAction", 4231 SortId = 20, 4232 Template = RenderMobileNavigationCreateAccountAction() 4233 }; 4234 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationCreateAccountAction); 4235 } 4236 } 4237 else 4238 { 4239 if (!hideMyOrdersLink) 4240 { 4241 Block mobileNavigationOrdersAction = new Block 4242 { 4243 Id = "MobileNavigationOrdersAction", 4244 SortId = 20, 4245 Template = RenderMobileNavigationOrdersAction() 4246 }; 4247 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationOrdersAction); 4248 } 4249 if (!hideMyFavoritesLink) 4250 { 4251 Block mobileNavigationFavoritesAction = new Block 4252 { 4253 Id = "MobileNavigationFavoritesAction", 4254 SortId = 30, 4255 Template = RenderMobileNavigationFavoritesAction() 4256 }; 4257 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationFavoritesAction); 4258 } 4259 if (!hideMySavedCardsLink) 4260 { 4261 Block mobileNavigationSavedCardsAction = new Block 4262 { 4263 Id = "MobileNavigationFavoritesAction", 4264 SortId = 30, 4265 Template = RenderMobileNavigationSavedCardsAction() 4266 }; 4267 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSavedCardsAction); 4268 } 4269 4270 Block mobileNavigationSignOutAction = new Block 4271 { 4272 Id = "MobileNavigationSignOutAction", 4273 SortId = 40, 4274 Template = RenderMobileNavigationSignOutAction() 4275 }; 4276 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignOutAction); 4277 } 4278 } 4279 } 4280 4281 4282 @helper MobileNavigation() 4283 { 4284 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigation").OrderBy(item => item.SortId).ToList(); 4285 4286 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 4287 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 4288 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 4289 string mobileTopDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design") != null ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 4290 string position = mobileTopDesign == "nav-left" || mobileTopDesign == "nav-search-left" ? "left" : "right"; 4291 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 4292 string firstUSPLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FirstLink"); 4293 string secondUSPLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("SecondLink"); 4294 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4295 string liClasses = topLayout != "normal" ? "menu__item--top-level" : "menu--clean"; 4296 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4297 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() : ""; 4298 bool customCountrySelector = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetBoolean("CustomCountrySelector"); 4299 4300 4301 <!-- Trigger for mobile navigation --> 4302 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger mobile-nav-trigger--@position" autocomplete="off" /> 4303 4304 <!-- Mobile navigation --> 4305 <nav class="mobile-navigation mobile-navigation--@position dw-mod"> 4306 <div class="mobile-navigation__wrapper" id="mobileNavigationWrapper"> 4307 @RenderBlockList(subBlocks) 4308 <ul class="menu menu-mobile dwnavigation"> 4309 @{ 4310 IList<ItemViewModel> uspLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItems("UspLink"); 4311 } 4312 @if (uspLink != null && uspLink.Any()) 4313 { 4314 foreach (ItemViewModel link in uspLink) 4315 { 4316 string linkUrl = link.GetString("Link"); 4317 string linkText = link.GetString("LinkText"); 4318 4319 <li class="menu-mobile__item dw-mod"> 4320 <a class="menu-mobile__link dw-mod menu-mobile__link--level-0" href="@linkUrl">@linkText</a> 4321 </li> 4322 } 4323 } 4324 </ul> 4325 <div class="grid grid--justify-start u-margin-top mobile-usp-bar"> 4326 <div class="grid__col-12"> 4327 <div class="usp-first-link-container-mobile dw-mod"> 4328 4329 <span class="u-color-light">@firstUSPLink</span> 4330 </div> 4331 </div> 4332 <div class="grid__col-8"> 4333 4334 <div class="usp-second-link-container-mobile dw-mod"> 4335 4336 <span class="u-color-light">@secondUSPLink</span> 4337 </div> 4338 </div> 4339 4340 @{ 4341 4342 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 4343 4344 string selectedLanguage = ""; 4345 string langName = ""; 4346 foreach (var lang in Model.Languages) 4347 { 4348 if (lang.IsCurrent) 4349 { 4350 selectedLanguage = lang.Name; 4351 langName = Dynamicweb.Services.Areas.GetArea(lang.ID).DisplayName; 4352 } 4353 } 4354 } 4355 @if (!customCountrySelector) 4356 { 4357 <ul class="menu menu-mobile language-switcher-mobile"> 4358 <li class="menu-mobile__item dw-mod"> 4359 @if (isSlidesDesign) 4360 { 4361 <input id="MobileMenuCheck_Language" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(1);"> 4362 } 4363 else 4364 { 4365 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 4366 } 4367 @foreach (var langnav in Model.Languages) 4368 { 4369 4370 if (langnav.IsCurrent) 4371 { 4372 4373 4374 string langInfonav = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(langnav.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>"; 4375 4376 4377 <div class="menu-mobile__link__wrap"> 4378 <label for="MobileMenuCheck_Language" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"> @langInfonav @Translate("Language")</label> 4379 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger dw-mod"></label> 4380 </div> 4381 4382 } 4383 4384 } 4385 4386 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 4387 @if (isSlidesDesign) 4388 { 4389 <li class="menu-mobile__item dw-mod"> 4390 <div class="menu-mobile__link__wrap"> 4391 <input id="MobileMenuCheck_Language_back" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(0);" /> 4392 <label for="MobileMenuCheck_Language_back" class="menu-mobile__trigger menu-mobile__trigger--back"></label> 4393 <label for="MobileMenuCheck_Language_back" class="menu-mobile__link dw-mod ">@Translate("Back")</label> 4394 </div> 4395 </li> 4396 } 4397 @foreach (var lang in Model.Languages) 4398 { 4399 var langNameDropdown = Dynamicweb.Services.Areas.GetArea(lang.ID).DisplayName; 4400 4401 string langInfonav = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>"; 4402 string url = $"/Default.aspx?ID={lang.Page.ID}"; 4403 4404 if (string.IsNullOrEmpty(lang.PrimaryDomain) == false) 4405 { 4406 url = $"https://{lang.PrimaryDomain}/Default.aspx?ID={lang.FirstPage.ID}"; 4407 } 4408 4409 4410 <li class="menu-mobile__item dw-mod"> 4411 <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> 4412 </li> 4413 } 4414 </ul> 4415 </li> 4416 </ul> 4417 } 4418 </div> 4419 </div> 4420 </nav> 4421 4422 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 4423 4424 if (!onlyPreview) 4425 { 4426 <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> 4427 } 4428 } 4429 4430 @helper RenderMobileNavigationSignIn() 4431 { 4432 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4433 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4434 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4435 string myProfilePageLink = linkStart + myProfilePageId; 4436 string userName = Model.CurrentUser.FirstName ?? ""; 4437 userName += " " + (Model.CurrentUser.LastName ?? ""); 4438 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 4439 4440 <ul class="menu menu-mobile"> 4441 <li class="menu-mobile__item"> 4442 <a href="@myProfilePageLink" class="menu-mobile__link dw-mod"><span class="icon-nz icon-nz-user dw-mod"></span> @userName</a> 4443 </li> 4444 </ul> 4445 } 4446 4447 @helper RenderMobileNavigationMenu() 4448 { 4449 var isHD2412 = Dynamicweb.Context.Current.Request.QueryString; 4450 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 4451 string menuTemplate = isSlidesDesign ? "BaseMenuForMobileSlides.xslt" : "BaseMenuForMobileExpandable.xslt"; 4452 string levels = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels") : "3"; 4453 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 4454 int startLevel = renderPagesInToolBar ? 1 : 0; 4455 4456 if (isHD2412.Equals("hd2412")) 4457 { 4458 4459 @RenderNavigation(new 4460 { 4461 id = "mobilenavigation", 4462 cssclass = "menu menu-mobile dwnavigation ecom-mobile-menu", 4463 startLevel = @startLevel, 4464 ecomStartLevel = @startLevel + 1, 4465 endlevel = @levels, 4466 expandmode = "all", 4467 template = @menuTemplate 4468 }) 4469 } 4470 4471 else 4472 { 4473 @RenderNavigation(new 4474 { 4475 id = "mobilenavigation", 4476 cssclass = "menu menu-mobile dwnavigation", 4477 startLevel = @startLevel, 4478 ecomStartLevel = @startLevel + 1, 4479 endlevel = @levels, 4480 expandmode = "all", 4481 template = @menuTemplate 4482 }) 4483 } 4484 4485 if (isSlidesDesign) 4486 { 4487 <script> 4488 function goToLevel(level) { 4489 document.getElementById('mobileNavigationWrapper').style.left = -(level * 100) + "%"; 4490 } 4491 4492 document.addEventListener('DOMContentLoaded', function () { 4493 goToLevel(document.getElementById('mobileNavigationWrapper').querySelectorAll('input[type=radio]:checked').length); 4494 }); 4495 </script> 4496 } 4497 4498 if (renderPagesInToolBar) 4499 { 4500 @RenderNavigation(new 4501 { 4502 id = "topToolsMobileNavigation", 4503 cssclass = "menu menu-mobile dwnavigation", 4504 template = "ToolsMenuForMobile.xslt" 4505 }) 4506 } 4507 } 4508 4509 @helper RenderMobileNavigationActions() 4510 { 4511 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigationActions").OrderBy(item => item.SortId).ToList(); ; 4512 4513 <ul class="menu menu-mobile"> 4514 @RenderBlockList(subBlocks) 4515 </ul> 4516 } 4517 4518 @helper RenderMobileNavigationSignInAction() 4519 { 4520 <li class="menu-mobile__item"> 4521 <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> 4522 </li> 4523 } 4524 4525 @helper RenderMobileNavigationCreateAccountAction() 4526 { 4527 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 4528 4529 <li class="menu-mobile__item"> 4530 <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> 4531 </li> 4532 } 4533 4534 @helper RenderMobileNavigationProfileAction() 4535 { 4536 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4537 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4538 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4539 string myProfilePageLink = linkStart + myProfilePageId; 4540 4541 <li class="menu-mobile__item"> 4542 <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> 4543 </li> 4544 } 4545 4546 @helper RenderMobileNavigationOrdersAction() 4547 { 4548 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4549 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4550 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 4551 string myOrdersPageLink = linkStart + myOrdersPageId; 4552 string ordersIcon = "fas fa-list"; 4553 4554 <li class="menu-mobile__item"> 4555 <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> 4556 </li> 4557 } 4558 4559 @helper RenderMobileNavigationFavoritesAction() 4560 { 4561 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4562 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4563 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 4564 string myFavoritesPageLink = linkStart + myFavoritesPageId; 4565 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"; 4566 4567 4568 <li class="menu-mobile__item"> 4569 <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> 4570 </li> 4571 } 4572 4573 @helper RenderMobileNavigationSavedCardsAction() 4574 { 4575 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4576 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4577 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 4578 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 4579 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"; 4580 4581 <li class="menu-mobile__item"> 4582 <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> 4583 </li> 4584 } 4585 4586 @helper RenderMobileNavigationSignOutAction() 4587 { 4588 int pageId = Model.TopPage.ID; 4589 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"; 4590 4591 <li class="menu-mobile__item"> 4592 <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> 4593 </li> 4594 } 4595 </text> 4596 } 4597 else 4598 { 4599 string headerTemplate = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("HeaderTemplate"); 4600 4601 if (headerTemplate.Contains("Header-v2")) 4602 { 4603 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/co3/header.css" as="style" media="screen"> 4604 } 4605 4606 if (string.IsNullOrEmpty(headerTemplate)) 4607 { 4608 headerTemplate = "MasterBlocks/Header.cshtml"; 4609 } 4610 @RenderingService.Instance.PartialView(headerTemplate, Model) 4611 4612 } 4613 4614 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4615 4616 @using System 4617 @using System.Web 4618 @using Dynamicweb.Rapido.Blocks.Extensibility 4619 @using Dynamicweb.Rapido.Blocks 4620 4621 @{ 4622 Block impersonationBar = new Block 4623 { 4624 Id = "ImpersonationBar", 4625 SortId = 50, 4626 Template = RenderImpersonationBar(), 4627 Design = new Design 4628 { 4629 Size = "auto-width", 4630 HidePadding = true, 4631 RenderType = RenderType.Column 4632 } 4633 }; 4634 4635 if (Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) 4636 { 4637 BlocksPage.GetBlockPage("Master").Add("MasterHeader", impersonationBar); 4638 } 4639 } 4640 4641 @helper RenderImpersonationBar() 4642 { 4643 int impersonationPageId = GetPageIdByNavigationTag("Impersonation"); 4644 4645 <div class="u-color-warning--bg"> 4646 <div class="center-container top-container__center-container dw-mod"> 4647 @*Impersonation*@ 4648 <div class="grid"> 4649 <div class="grid--align-self-center grid__col-x"> 4650 @if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 4651 { 4652 string stopImpersonateTranslation = Translate("Stop impersonation"); 4653 string username = ""; 4654 if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) 4655 { 4656 username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; 4657 } 4658 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) 4659 { 4660 username = Model.CurrentSecondaryUser.Name; 4661 } 4662 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) 4663 { 4664 username = Model.CurrentSecondaryUser.Email; 4665 } 4666 else 4667 { 4668 username = Model.CurrentSecondaryUser.UserName; 4669 } 4670 <div class="grid-cell"> 4671 <div class="u-pull--left u-bold u-margin-top"> 4672 <i class="fas fa-user-secret"></i> 4673 @Pageview.User.UserName<text>&nbsp;</text>@Translate("is impersonating")<text>&nbsp;</text>@username 4674 </div> 4675 <form method="post" class="u-pull--right u-no-margin"> 4676 <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 4677 </form> 4678 </div> 4679 } 4680 else 4681 { 4682 string viewListTranslation = Translate("View the list of users you can impersonate"); 4683 <div class="grid-cell u-bold"> 4684 <i class="fas fa-user-secret"></i> 4685 <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> 4686 </div> 4687 } 4688 </div> 4689 </div> 4690 </div> 4691 </div> 4692 } 4693 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4694 4695 @using Dynamicweb.Rapido.Blocks 4696 4697 @{ 4698 BlocksPage miniCartBlocksPage = BlocksPage.GetBlockPage("Master"); 4699 string orderlinesView = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("OrderlinesView") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("OrderlinesView").SelectedValue : "table"; 4700 4701 Block orderLines = new Block 4702 { 4703 Id = "MiniCartOrderLines", 4704 SkipRenderBlocksList = true, 4705 BlocksList = new List<Block> 4706 { 4707 new Block { 4708 Id = "MiniCartOrderLinesList", 4709 SortId = 20, 4710 Template = RenderMiniCartOrderLinesList() 4711 } 4712 } 4713 }; 4714 4715 Block orderlinesScriptTemplates = new Block 4716 { 4717 Id = "OrderlinesScriptTemplates" 4718 }; 4719 4720 if (orderlinesView == "table") 4721 { 4722 orderLines.Template = RenderMiniCartOrderLinesTable(); 4723 orderLines.BlocksList.Add( 4724 new Block 4725 { 4726 Id = "MiniCartOrderlinesTableHeader", 4727 SortId = 10, 4728 Template = RenderMiniCartOrderLinesHeader() 4729 } 4730 ); 4731 4732 orderlinesScriptTemplates.Template = RenderMiniCartScriptsTableTemplates(); 4733 } 4734 else 4735 { 4736 orderLines.Template = RenderMiniCartOrderLinesBlocks(); 4737 orderlinesScriptTemplates.Template = RenderMiniCartScriptsListTemplates(); 4738 } 4739 4740 miniCartBlocksPage.Add("MasterBottomSnippets", orderlinesScriptTemplates); 4741 4742 Block miniCartScriptTemplates = new Block() 4743 { 4744 Id = "MasterMiniCartTemplates", 4745 SortId = 1, 4746 Template = RenderMiniCartScriptTemplates(), 4747 SkipRenderBlocksList = true, 4748 BlocksList = new List<Block> 4749 { 4750 orderLines, 4751 new Block { 4752 Id = "MiniCartFooter", 4753 Template = RenderMiniCartFooter(), 4754 SortId = 50, 4755 SkipRenderBlocksList = true, 4756 BlocksList = new List<Block> 4757 { 4758 new Block { 4759 Id = "MiniCartFees", 4760 Template = RenderMiniCartFees(), 4761 SortId = 30 4762 }, 4763 new Block { 4764 Id = "MiniCartPoints", 4765 Template = RenderMiniCartPoints(), 4766 SortId = 40 4767 }, 4768 new Block { 4769 Id = "MiniCartTotal", 4770 Template = RenderMiniCartTotal(), 4771 SortId = 50 4772 }, 4773 new Block { 4774 Id = "MiniCartActions", 4775 Template = RenderMiniCartActions(), 4776 SortId = 60 4777 } 4778 } 4779 } 4780 } 4781 }; 4782 4783 miniCartBlocksPage.Add("MasterBottomSnippets", miniCartScriptTemplates); 4784 } 4785 4786 @helper RenderMiniCartScriptsTableTemplates() 4787 { 4788 <script id="MiniCartOrderline" type="text/x-template"> 4789 {{#unless isEmpty}} 4790 <tr> 4791 <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> 4792 <td class="u-va-middle"> 4793 <a href="{{link}}" class="mini-cart-orderline__name" title="{{name}}">{{name}}</a> 4794 {{#if variantname}} 4795 <a href="{{link}}" class="mini-cart-orderline__name mini-cart-orderline__name--sm">{{variantname}}</a> 4796 {{/if}} 4797 {{#if unitname}} 4798 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm">{{unitname}}</div> 4799 {{/if}} 4800 </td> 4801 <td class="u-ta-right u-va-middle">{{quantity}}</td> 4802 <td class="u-ta-right u-va-middle"> 4803 {{#if pointsTotal}} 4804 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 4805 {{else}} 4806 {{totalprice}} 4807 {{/if}} 4808 </td> 4809 </tr> 4810 {{/unless}} 4811 </script> 4812 4813 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 4814 {{#unless isEmpty}} 4815 <tr class="table__row--no-border"> 4816 <td class="u-w60px">&nbsp;</td> 4817 <td><div class="mini-cart-orderline__name dw-mod"><strong>{{name}}</strong></div></td> 4818 <td class="u-ta-right">&nbsp;</td> 4819 <td class="u-ta-right">{{totalprice}}</td> 4820 </tr> 4821 {{/unless}} 4822 </script> 4823 } 4824 4825 @helper RenderMiniCartScriptsListTemplates() 4826 { 4827 int cartOrderlinesFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 4828 <script id="MiniCartOrderline" type="text/x-template"> 4829 {{#unless isEmpty}} 4830 <div class="mini-cart-orderline grid dw-mod"> 4831 <div class="grid__col-4"> 4832 <a href="{{link}}" class="{{hideimage}}"> 4833 <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}}"> 4834 </a> 4835 </div> 4836 <div class="grid__col-8"> 4837 <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> 4838 {{#if variantname}} 4839 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("Variant"): {{variantname}}</div> 4840 {{/if}} 4841 {{#if customFields.LogoSelector}} 4842 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("LogoSelectortitle", "Valgt firma"): {{customFields.LogoSelector}}</div> 4843 {{/if}} 4844 {{#if unitname}} 4845 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("Unit"): {{unitname}}</div> 4846 {{/if}} 4847 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod"> 4848 @Translate("Qty"): 4849 <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}}"> 4850 </div> 4851 4852 <div class="grid__cell-footer"> 4853 <div class="grid__cell"> 4854 <div class="u-pull--left mini-cart-orderline__price dw-mod"> 4855 {{#if pointsTotal}} 4856 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 4857 {{else}} 4858 {{TotalPrice}} 4859 {{/if}} 4860 </div> 4861 <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> 4862 </div> 4863 </div> 4864 </div> 4865 </div> 4866 {{/unless}} 4867 </script> 4868 4869 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 4870 {{#unless isEmpty}} 4871 <div class="mini-cart-orderline mini-cart-orderline--discount grid dw-mod"> 4872 <div class="grid__col-4"> 4873 </div> 4874 <div class="grid__col-8"> 4875 <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> 4876 4877 <div class="grid__cell-footer"> 4878 <div class="grid__cell"> 4879 <div class="u-pull--left mini-cart-orderline__price dw-mod"> 4880 {{TotalPrice}} 4881 </div> 4882 </div> 4883 </div> 4884 4885 </div> 4886 4887 </div> 4888 {{/unless}} 4889 </script> 4890 } 4891 4892 @helper RenderMiniCartScriptTemplates() 4893 { 4894 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMiniCartTemplates").OrderBy(item => item.SortId).ToList(); 4895 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 4896 string cartPageLink = string.Concat("/Default.aspx?ID=", GetPageIdByNavigationTag("CartPage")); 4897 4898 <script id="MiniCartContent" type="text/x-template"> 4899 {{#.}} 4900 {{#unless isEmpty}} 4901 @if (useGoogleTagManager) 4902 { 4903 <text>{{{googleEnchantImpressionEmptyCart OrderLines}}}</text> 4904 } 4905 @RenderBlockList(subBlocks) 4906 {{/unless}} 4907 {{#if isEmpty}} 4908 {{{locationReload '@cartPageLink'}}} 4909 {{/if}} 4910 {{/.}} 4911 </script> 4912 } 4913 4914 @helper RenderMiniCartOrderLinesTable() 4915 { 4916 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 4917 4918 <div class="u-overflow-auto"> 4919 <table class="table mini-cart-table dw-mod"> 4920 @RenderBlockList(subBlocks) 4921 </table> 4922 </div> 4923 } 4924 4925 @helper RenderMiniCartOrderLinesBlocks() 4926 { 4927 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 4928 4929 <div class="u-overflow-auto"> 4930 @RenderBlockList(subBlocks) 4931 </div> 4932 } 4933 4934 @helper RenderMiniCartOrderLinesHeader() 4935 { 4936 <thead> 4937 <tr> 4938 <td>&nbsp;</td> 4939 <td>@Translate("Product")</td> 4940 <td class="u-ta-right">@Translate("Qty")</td> 4941 <td class="u-ta-right" width="120">@Translate("Price")</td> 4942 </tr> 4943 </thead> 4944 } 4945 4946 @helper RenderMiniCartOrderLinesList() 4947 { 4948 <text> 4949 {{#OrderLines}} 4950 {{#ifCond template "===" "CartOrderline"}} 4951 {{>MiniCartOrderline}} 4952 {{/ifCond}} 4953 {{#ifCond template "===" "CartOrderlineDiscount"}} 4954 {{>MiniCartOrderlineDiscount}} 4955 {{/ifCond}} 4956 {{#ifCond template "===" "CartOrderlineMobile"}} 4957 {{>MiniCartOrderline}} 4958 {{/ifCond}} 4959 {{/OrderLines}} 4960 </text> 4961 } 4962 4963 @helper RenderMiniCartFees() 4964 { 4965 <div class="grid u-border-top grid--external-bleed-bottom"> 4966 <div class="grid__col-6 u-bold u-no-padding-bottom no-padding-left no-padding-right"> 4967 @Translate("Subtotal") 4968 </div> 4969 <div class="grid__col-6 grid--align-end u-bold u-no-padding-bottom no-padding-left no-padding-right">{{subtotalprice}}</div> 4970 <div class="grid__col-6 u-no-padding-top u-no-padding"> 4971 @Translate("VAT") 4972 </div> 4973 <div class="grid__col-6 grid--align-end u-no-padding-top u-no-padding-bottom no-padding-left no-padding-right">{{totalvat}}</div> 4974 </div> 4975 4976 <div class="grid grid--external-bleed-bottom u-no-padding-bottom "> 4977 {{#if HasShippingMethodSelected}} 4978 <div class="grid__col-6 no-padding-left no-padding-right"> 4979 {{shippingmethod}} 4980 </div> 4981 <div class="grid__col-6 grid--align-end u-no-padding-bottom no-padding-left no-padding-right">{{shippingfee}}</div> 4982 {{/if}} 4983 </div> 4984 4985 4986 4987 } 4988 4989 @helper RenderMiniCartFooter() 4990 { 4991 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartFooter").OrderBy(item => item.SortId).ToList(); 4992 4993 <div class="mini-cart__footer dw-mod"> 4994 @RenderBlockList(subBlocks) 4995 </div> 4996 } 4997 4998 @helper RenderMiniCartActions() 4999 { 5000 int cartPageId = GetPageIdByNavigationTag("CartPage"); 5001 5002 <button type="button" title="@Translate("Empty cart")" class="btn btn-clear-cart no-padding-left" onclick="googleEnchantImpressionEmptyCart(); Cart.EmptyCart(event);">@Translate("Empty cart")</button> 5003 <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> 5004 } 5005 5006 @helper RenderMiniCartPoints() 5007 { 5008 <text> 5009 {{#if earnings}} 5010 <div class="grid grid--external-bleed-bottom"> 5011 <div class="grid__col-6">@Translate("Earnings")</div> 5012 <div class="grid__col-6 grid--align-end"> 5013 <div> 5014 <span class="u-color--loyalty-points">{{earnings}}</span> @Translate("points") 5015 </div> 5016 </div> 5017 </div> 5018 {{/if}} 5019 </text> 5020 } 5021 5022 @helper RenderMiniCartTotal() 5023 { 5024 <div class="mini-cart-totals grid u-margin-bottom dw-mod "> 5025 <div class="grid__col-6 no-padding-left no-padding-right">@Translate("Total")</div> 5026 <div class="grid__col-6 grid--align-end no-padding-left no-padding-right">{{totalprice}}</div> 5027 </div> 5028 } 5029 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5030 5031 @using Dynamicweb.Rapido.Blocks.Extensibility 5032 @using Dynamicweb.Rapido.Blocks 5033 5034 @{ 5035 bool addToCartNotificationOnlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 5036 string addToCartNotificationType = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType").SelectedValue : ""; 5037 5038 if (!addToCartNotificationOnlyPreview && !string.IsNullOrEmpty(addToCartNotificationType)) { 5039 if (addToCartNotificationType == "modal") 5040 { 5041 Block addToCartNotificationModal = new Block 5042 { 5043 Id = "AddToCartNotificationModal", 5044 Template = RenderAddToCartNotificationModal() 5045 }; 5046 5047 Block addToCartNotificationScript = new Block 5048 { 5049 Id = "AddToCartNotificationScript", 5050 Template = RenderAddToCartNotificationModalScript() 5051 }; 5052 BlocksPage.GetBlockPage("Master").Add("MasterTopSnippets", addToCartNotificationModal); 5053 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 5054 } 5055 else if (addToCartNotificationType == "toggle") 5056 { 5057 Block addToCartNotificationScript = new Block 5058 { 5059 Id = "AddToCartNotificationScript", 5060 Template = RenderAddToCartNotificationToggleScript() 5061 }; 5062 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 5063 } 5064 } 5065 } 5066 5067 @helper RenderAddToCartNotificationModal() 5068 { 5069 <div id="LastAddedProductModal" data-template="LastAddedProductTemplate"></div> 5070 } 5071 5072 @helper RenderAddToCartNotificationModalScript() 5073 { 5074 int cartPageId = GetPageIdByNavigationTag("CartPage"); 5075 5076 <script id="LastAddedProductTemplate" type="text/x-template"> 5077 <!-- Trigger for the login modal --> 5078 <input type="checkbox" id="LastAddedProductModalTrigger" class="modal-trigger" /> 5079 5080 <!-- Login modal --> 5081 <div class="modal-container"> 5082 <label for="LastAddedProductModalTrigger" class="modal-overlay"></label> 5083 <div class="modal modal--md"> 5084 <div class="modal__header"> 5085 <h2>@Translate("Product is added to the cart")</h2> 5086 </div> 5087 <div class="modal__body"> 5088 <div class="grid"> 5089 <div class="grid__col-2"> 5090 <a href="{{productInfo.link}}"> 5091 <img src="{{productInfo.image}}" alt="{{productInfo.name}}" class="dw-mod" /> 5092 </a> 5093 </div> 5094 <div class="u-padding grid--align-self-center"> 5095 <span>{{quantity}}</span> x 5096 </div> 5097 <div class="grid__col-auto grid--align-self-center"> 5098 <div>{{productInfo.name}}</div> 5099 {{#if productInfo.variantName}} 5100 <small class="u-margin-bottom-5px">{{productInfo.variantName}}</small> 5101 {{/if}} 5102 {{#if productInfo.unitName}} 5103 <small class="u-margin-bottom-5px">{{productInfo.unitName}}</small> 5104 {{/if}} 5105 </div> 5106 </div> 5107 <div class="modal__footer u-margin-top--lg"> 5108 <label class="btn btn--secondary u-pull--left u-no-margin dw-mod btn--sm" for="LastAddedProductModalTrigger">@Translate("Continue shopping")</label> 5109 <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> 5110 </div> 5111 </div> 5112 <label class="modal__close-btn" for="LastAddedProductModalTrigger"></label> 5113 </div> 5114 </div> 5115 </script> 5116 <script> 5117 document.addEventListener('addToCart', function (event) { 5118 Cart.ShowLastAddedProductModal(event.detail); 5119 }); 5120 </script> 5121 } 5122 5123 @helper RenderAddToCartNotificationToggleScript() 5124 { 5125 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 5126 5127 <script> 5128 document.addEventListener('addToCart', function () { 5129 Cart.ToggleMiniCart('miniCartTrigger', 'miniCart', 'cartCounter', '@miniCartFeedPageId'); 5130 }); 5131 </script> 5132 } 5133 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5134 5135 @using System 5136 @using System.Web 5137 @using System.Collections.Generic 5138 @using Dynamicweb.Rapido.Blocks.Extensibility 5139 @using Dynamicweb.Rapido.Blocks 5140 5141 @functions { 5142 BlocksPage footerBlocksPage = BlocksPage.GetBlockPage("Master"); 5143 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 5144 } 5145 5146 @{ 5147 string footerColumnOneContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne").GetString("Content"); 5148 string footerColumnTwoContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo").GetString("Content"); 5149 string footerColumnThreeContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree").GetString("Content"); 5150 string footerColumnOneHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne").GetString("Header"); 5151 string footerColumnTwoHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo").GetString("Header"); 5152 string footerColumnThreeHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree").GetString("Header"); 5153 5154 Block masterFooterContent = new Block() 5155 { 5156 Id = "MasterFooterContent", 5157 SortId = 10, 5158 Template = RenderFooter(), 5159 SkipRenderBlocksList = true 5160 }; 5161 footerBlocksPage.Add(MasterBlockId.MasterFooter, masterFooterContent); 5162 5163 if (!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) 5164 { 5165 Block masterFooterColumnOne = new Block 5166 { 5167 Id = "MasterFooterColumnOne", 5168 SortId = 20, 5169 Template = RenderFooterColumn(footerColumnOneHeader, footerColumnOneContent), 5170 Design = new Design 5171 { 5172 Size = "auto", 5173 RenderType = RenderType.Column 5174 } 5175 }; 5176 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnOne); 5177 } 5178 5179 if (!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) 5180 { 5181 Block masterFooterColumnTwo = new Block 5182 { 5183 Id = "MasterFooterColumnTwo", 5184 SortId = 30, 5185 Template = RenderFooterColumnTwo(footerColumnTwoHeader, footerColumnTwoContent), 5186 Design = new Design 5187 { 5188 Size = "auto", 5189 RenderType = RenderType.Column 5190 } 5191 }; 5192 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnTwo); 5193 } 5194 5195 if (!string.IsNullOrEmpty(footerColumnThreeContent) || !string.IsNullOrEmpty(footerColumnThreeHeader)) 5196 { 5197 Block masterFooterColumnThree = new Block 5198 { 5199 Id = "MasterFooterColumnThree", 5200 SortId = 40, 5201 Template = RenderFooterColumnThree(footerColumnThreeHeader, footerColumnThreeContent), 5202 Design = new Design 5203 { 5204 Size = "auto", 5205 RenderType = RenderType.Column 5206 } 5207 }; 5208 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnThree); 5209 } 5210 5211 if (Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks") != null && Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks").Count > 0 && siteURL.Contains("hededanmark")) 5212 { 5213 Block masterFooterSocialLinks = new Block 5214 { 5215 Id = "MasterFooterSocialLinks", 5216 SortId = 50, 5217 Template = RenderFooterSocialLinks(), 5218 Design = new Design 5219 { 5220 Size = "auto", 5221 RenderType = RenderType.Column 5222 } 5223 }; 5224 footerBlocksPage.Add("MasterFooterContent", masterFooterSocialLinks); 5225 } 5226 5227 if (Model.Area.Item.GetItem("Layout").GetItems("FooterPayments") != null && Model.Area.Item.GetItem("Layout").GetItems("FooterPayments").Count > 0) 5228 { 5229 Block masterFooterPayments = new Block 5230 { 5231 Id = "MasterFooterPayments", 5232 SortId = 60, 5233 Template = RenderFooterPayments(), 5234 Design = new Design 5235 { 5236 Size = "12", 5237 RenderType = RenderType.Column 5238 } 5239 }; 5240 footerBlocksPage.Add("MasterFooterContent", masterFooterPayments); 5241 } 5242 5243 if (Model.Area.Item.GetItem("Layout").GetString("FooterCopyrightText") != "") 5244 { 5245 Block masterFooterCopyright = new Block 5246 { 5247 Id = "MasterFooterCopyright", 5248 SortId = 70, 5249 Template = RenderFooterCopyright(), 5250 Design = new Design 5251 { 5252 Size = "12", 5253 RenderType = RenderType.Column 5254 } 5255 }; 5256 footerBlocksPage.Add("MasterFooterContent", masterFooterCopyright); 5257 5258 } 5259 5260 //If sentence to check if the FooterLogo has content or not 5261 5262 if (Model.Area.Item.GetItem("Layout").GetValue("FooterLogo") != null) 5263 { 5264 Block masterFooterLogo = new Block 5265 { 5266 Id = "MasterFooterLogo", 5267 SortId = 1, 5268 Template = RenderFooterLogo(), 5269 Design = new Design 5270 { 5271 Size = "auto", 5272 RenderType = RenderType.Column 5273 } 5274 }; 5275 footerBlocksPage.Add("MasterFooterContent", masterFooterLogo); 5276 } 5277 } 5278 5279 @helper RenderFooter() 5280 { 5281 List<Block> subBlocks = this.footerBlocksPage.GetBlockListById("MasterFooterContent").OrderBy(item => item.SortId).ToList(); 5282 5283 <footer class="footer dw-mod"> 5284 @RenderFooterLinks() 5285 @RenderFooterNewsletterSignUp() 5286 <div class="center-container top-container__center-container dw-mod"> 5287 <div class="grid grid--external-bleed-x u-padding-top--lg"> 5288 @RenderBlockList(subBlocks) 5289 </div> 5290 </div> 5291 </footer> 5292 } 5293 5294 @helper RenderFooterLinks() 5295 { 5296 <div class="footer__content u-padding u-brand-color-one--bg bottom-navigation-container dw-mod u-flex"> 5297 @{ 5298 string firstPageLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FirstPage"); 5299 string firstPageText = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FirstLinkText"); 5300 5301 string secondPageLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("SecondPage"); 5302 string secondPageText = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("SecondLinkText"); 5303 5304 string thirdPageLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("ThirdPage"); 5305 string thirdPageText = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("ThirdLinkText"); 5306 5307 string fourthPageLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FourthPage"); 5308 string fourthPageText = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FourthLinkText"); 5309 5310 } 5311 5312 @if (!string.IsNullOrEmpty(firstPageText)) 5313 { 5314 <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"> 5315 <div class="grid__col-md-2 grid__col-12 grid--align-center u-no-padding-bottom-xs"> 5316 @if (!string.IsNullOrEmpty(firstPageLink)) 5317 { 5318 <a href="@firstPageLink" class="u-color-light" target="_self" rel="nofollow"> 5319 @firstPageText 5320 </a> 5321 } 5322 5323 else 5324 { 5325 <span class="u-color-light"> 5326 @firstPageText 5327 </span> 5328 } 5329 5330 </div> 5331 <div class="grid__col-md-1 grid__col-12 grid--direction-row grid--align-center grid--justify-center u-no-padding-bottom-xs"> 5332 <span>-</span> 5333 5334 </div> 5335 <div class="grid__col-md-2 grid__col-12 grid--align-center u-no-padding-bottom-xs"> 5336 @if (!string.IsNullOrEmpty(secondPageLink)) 5337 { 5338 <a href="@secondPageLink" class="u-color-light" target="_self" rel="nofollow"> 5339 @secondPageText 5340 </a> 5341 } 5342 5343 else 5344 { 5345 <span class="u-color-light"> 5346 @secondPageText 5347 </span> 5348 } 5349 5350 </div> 5351 <div class="grid__col-md-1 grid__col-12 grid--direction-row grid--align-center grid--justify-center u-no-padding-bottom-xs"> 5352 <span>-</span> 5353 5354 </div> 5355 <div class="grid__col-md-2 grid__col-12 grid--align-center u-no-padding-bottom-xs"> 5356 @if (!string.IsNullOrEmpty(thirdPageLink)) 5357 { 5358 <a href="@thirdPageLink" class="u-color-light" target="_self" rel="nofollow"> 5359 @thirdPageText 5360 </a> 5361 } 5362 else 5363 { 5364 <span class="u-color-light"> 5365 @thirdPageText 5366 </span> 5367 } 5368 </div> 5369 5370 <div class="grid__col-md-1 grid__col-12 grid--direction-row grid--align-center grid--justify-center u-no-padding-bottom-xs"> 5371 <span>-</span> 5372 5373 </div> 5374 5375 5376 <div class="grid__col-md-2 grid__col-12 grid--align-center"> 5377 @if (!string.IsNullOrEmpty(fourthPageLink)) 5378 { 5379 <a href="@fourthPageLink" class="u-color-light" target="_self" rel="nofollow"> 5380 @fourthPageText 5381 </a> 5382 } 5383 else 5384 { 5385 <span class="u-color-light"> 5386 @fourthPageText 5387 </span> 5388 } 5389 </div> 5390 </div> 5391 } 5392 </div> 5393 } 5394 5395 5396 @helper RenderFooterColumn(string header, string content) 5397 { 5398 <div class="footer__content dw-mod u-flex grid--justify-start"> 5399 <div class="u-flex grid__col-12 grid--align-start"> 5400 <strong class="footer__heading dw-mod">@header</strong> 5401 <div class="footer-content-rte"> 5402 @content 5403 5404 </div> 5405 5406 </div> 5407 </div> 5408 } 5409 5410 @helper RenderFooterColumnTwo(string header, string content) 5411 { 5412 <div class="footer__content dw-mod u-flex grid--justify-start"> 5413 <div class="u-flex grid__col-12 grid--align-start"> 5414 <strong class="footer__heading dw-mod">@header</strong> 5415 <div class="footer-content-rte"> 5416 @content 5417 5418 </div> 5419 5420 </div> 5421 </div> 5422 } 5423 5424 @helper RenderFooterColumnThree(string header, string content) 5425 { 5426 <div class="footer__content dw-mod u-flex grid--justify-start"> 5427 <div class="u-flex grid__col-12 grid--align-start"> 5428 <strong class="footer__heading dw-mod">@header</strong> 5429 <div class="footer-content-rte"> 5430 5431 @content 5432 5433 </div> 5434 5435 </div> 5436 </div> 5437 } 5438 5439 @helper RenderFooterNewsletterSignUp() 5440 { 5441 bool newsletterCheckBox = Model.Area.Item.GetItem("Layout").GetBoolean("FooterNewsletterSignUp"); 5442 string formId = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FormId"); 5443 string formAction = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FormAction"); 5444 string newsletterId = $"_form_{formId}_"; 5445 string submitForm = $"_form_{formId}_submit"; 5446 string hiddenFields = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("HiddenFields"); 5447 string recaptchaId = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("RecaptchaId"); 5448 5449 if (newsletterCheckBox) 5450 { 5451 <div class="footer__content footer__content-newsletter dw-mod"> 5452 <form class="form center-container dw-mod" name="NewsletterRedirect" action="@formAction" id="@newsletterId" method="get" enctype="multipart/form-data"> 5453 @hiddenFields 5454 <div class="grid__col-12 grid__col--bleed newsletter-grid--direction-row"> 5455 <div class="grid__col-lg-3 grid__col-12 mailing-list-container"> 5456 <h3>@Translate("Mailing list")</h3> 5457 </div> 5458 <div class="grid__col-lg-3 grid__col-12 footer-newsletter-item"> 5459 <input name="fullname" id="NewsletterName" type="text" placeholder='@Translate("Your name", "Your name")' class="newsletter-input" aria-label="newsletter fullname" /> 5460 </div> 5461 <div class="grid__col-lg-3 grid__col-12 footer-newsletter-item"> 5462 <input name="email" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' class="newsletter-input" aria-label="newsletter email" /> 5463 </div> 5464 5465 @if (!string.IsNullOrEmpty(recaptchaId)) 5466 { 5467 <div class="grid__col-lg-4 grid__col-12"> 5468 <div class="g-recaptcha" data-callback="recaptchaCallback" data-sitekey="@recaptchaId"> 5469 </div> 5470 </div> 5471 <div class="grid__col-lg-3 grid__col-12 submit footer-newsletter-item"> 5472 <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" /> 5473 </div> 5474 } 5475 else 5476 { 5477 <div class="grid__col-lg-3 grid__col-12 submit footer-newsletter-item"> 5478 <input class="btn btn--secondary btn--condensed newsletter-submit u-bold" type="submit" id="@submitForm" value='@Translate("Go", "Go")' aria-label="submit newsletter form" /> 5479 </div> 5480 } 5481 5482 </div> 5483 </form> 5484 </div> 5485 5486 <script defer type="text/javascript"> 5487 window.cfields = []; 5488 window._show_thank_you = function(id, message, trackcmp_url) { 5489 var form = document.getElementById('_form_' + id + '_'), thank_you = form.querySelector('._form-thank-you'); 5490 form.querySelector('._form-content').style.display = 'none'; 5491 thank_you.innerHTML = message; 5492 thank_you.style.display = 'block'; 5493 if (typeof(trackcmp_url) != 'undefined' && trackcmp_url) { 5494 // Site tracking URL to use after inline form submission. 5495 _load_script(trackcmp_url); 5496 } 5497 if (typeof window._form_callback !== 'undefined') window._form_callback(id); 5498 }; 5499 window._show_error = function(id, message, html) { 5500 var form = document.getElementById('_form_' + id + '_'), err = document.createElement('div'), button = form.querySelector('button'), old_error = form.querySelector('._form_error'); 5501 if (old_error) old_error.parentNode.removeChild(old_error); 5502 err.innerHTML = message; 5503 err.className = '_error-inner _form_error _no_arrow'; 5504 var wrapper = document.createElement('div'); 5505 wrapper.className = '_form-inner'; 5506 wrapper.appendChild(err); 5507 button.parentNode.insertBefore(wrapper, button); 5508 document.querySelector('[id^="_form"][id$="_submit"]').disabled = false; 5509 if (html) { 5510 var div = document.createElement('div'); 5511 div.className = '_error-html'; 5512 div.innerHTML = html; 5513 err.appendChild(div); 5514 } 5515 }; 5516 window._load_script = function(url, callback) { 5517 var head = document.querySelector('head'), script = document.createElement('script'), r = false; 5518 script.type = 'text/javascript'; 5519 script.charset = 'utf-8'; 5520 script.src = url; 5521 if (callback) { 5522 script.onload = script.onreadystatechange = function() { 5523 if (!r && (!this.readyState || this.readyState == 'complete')) { 5524 r = true; 5525 callback(); 5526 } 5527 }; 5528 } 5529 head.appendChild(script); 5530 }; 5531 (function() { 5532 if (window.location.search.search("excludeform") !== -1) return false; 5533 var getCookie = function(name) { 5534 var match = document.cookie.match(new RegExp('(^|; )' + name + '=([^;]+)')); 5535 return match ? match[2] : null; 5536 } 5537 var setCookie = function(name, value) { 5538 var now = new Date(); 5539 var time = now.getTime(); 5540 var expireTime = time + 1000 * 60 * 60 * 24 * 365; 5541 now.setTime(expireTime); 5542 document.cookie = name + '=' + value + '; expires=' + now + ';path=/'; 5543 } 5544 var addEvent = function(element, event, func) { 5545 if (element.addEventListener) { 5546 element.addEventListener(event, func); 5547 } else { 5548 var oldFunc = element['on' + event]; 5549 element['on' + event] = function() { 5550 oldFunc.apply(this, arguments); 5551 func.apply(this, arguments); 5552 }; 5553 } 5554 } 5555 var _removed = false; 5556 var form_to_submit = document.getElementById('@newsletterId'); 5557 var allInputs = form_to_submit.querySelectorAll('input, select, textarea'), tooltips = [], submitted = false; 5558 5559 var getUrlParam = function(name) { 5560 var regexStr = '[\?&]' + name + '=([^&#]*)'; 5561 var results = new RegExp(regexStr, 'i').exec(window.location.href); 5562 return results != undefined ? decodeURIComponent(results[1]) : false; 5563 }; 5564 5565 for (var i = 0; i < allInputs.length; i++) { 5566 var regexStr = "field\\[(\\d+)\\]"; 5567 var results = new RegExp(regexStr).exec(allInputs[i].name); 5568 if (results != undefined) { 5569 allInputs[i].dataset.name = window.cfields[results[1]]; 5570 } else { 5571 allInputs[i].dataset.name = allInputs[i].name; 5572 } 5573 var fieldVal = getUrlParam(allInputs[i].dataset.name); 5574 5575 if (fieldVal) { 5576 if (allInputs[i].type == "radio" || allInputs[i].type == "checkbox") { 5577 if (allInputs[i].value == fieldVal) { 5578 allInputs[i].checked = true; 5579 } 5580 } else { 5581 allInputs[i].value = fieldVal; 5582 } 5583 } 5584 } 5585 5586 var remove_tooltips = function() { 5587 for (var i = 0; i < tooltips.length; i++) { 5588 tooltips[i].tip.parentNode.removeChild(tooltips[i].tip); 5589 } 5590 tooltips = []; 5591 }; 5592 var remove_tooltip = function(elem) { 5593 for (var i = 0; i < tooltips.length; i++) { 5594 if (tooltips[i].elem === elem) { 5595 tooltips[i].tip.parentNode.removeChild(tooltips[i].tip); 5596 tooltips.splice(i, 1); 5597 return; 5598 } 5599 } 5600 }; 5601 var create_tooltip = function(elem, text) { 5602 var tooltip = document.createElement('div'), arrow = document.createElement('div'), inner = document.createElement('div'), new_tooltip = {}; 5603 if (elem.type != 'radio' && elem.type != 'checkbox') { 5604 tooltip.className = '_error'; 5605 arrow.className = '_error-arrow'; 5606 inner.className = '_error-inner'; 5607 inner.innerHTML = text; 5608 tooltip.appendChild(arrow); 5609 tooltip.appendChild(inner); 5610 elem.parentNode.appendChild(tooltip); 5611 } else { 5612 tooltip.className = '_error-inner _no_arrow'; 5613 tooltip.innerHTML = text; 5614 elem.parentNode.insertBefore(tooltip, elem); 5615 new_tooltip.no_arrow = true; 5616 } 5617 new_tooltip.tip = tooltip; 5618 new_tooltip.elem = elem; 5619 tooltips.push(new_tooltip); 5620 return new_tooltip; 5621 }; 5622 var resize_tooltip = function(tooltip) { 5623 var rect = tooltip.elem.getBoundingClientRect(); 5624 var doc = document.documentElement, scrollPosition = rect.top - ((window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0)); 5625 if (scrollPosition < 40) { 5626 tooltip.tip.className = tooltip.tip.className.replace(/ ?(_above|_below) ?/g, '') + ' _below'; 5627 } else { 5628 tooltip.tip.className = tooltip.tip.className.replace(/ ?(_above|_below) ?/g, '') + ' _above'; 5629 } 5630 }; 5631 var resize_tooltips = function() { 5632 if (_removed) return; 5633 for (var i = 0; i < tooltips.length; i++) { 5634 if (!tooltips[i].no_arrow) resize_tooltip(tooltips[i]); 5635 } 5636 }; 5637 var validate_field = function(elem, remove) { 5638 var tooltip = null, value = elem.value, no_error = true; 5639 remove ? remove_tooltip(elem) : false; 5640 if (elem.type != 'checkbox') elem.className = elem.className.replace(/ ?_has_error ?/g, ''); 5641 if (elem.getAttribute('required') !== null) { 5642 if (elem.type == 'radio' || (elem.type == 'checkbox' && /any/.test(elem.className))) { 5643 var elems = form_to_submit.elements[elem.name]; 5644 if (!(elems instanceof NodeList || elems instanceof HTMLCollection) || elems.length <= 1) { 5645 no_error = elem.checked; 5646 } 5647 else { 5648 no_error = false; 5649 for (var i = 0; i < elems.length; i++) { 5650 if (elems[i].checked) no_error = true; 5651 } 5652 } 5653 if (!no_error) { 5654 tooltip = create_tooltip(elem, "Please select an option."); 5655 } 5656 } else if (elem.type =='checkbox') { 5657 var elems = form_to_submit.elements[elem.name], found = false, err = []; 5658 no_error = true; 5659 for (var i = 0; i < elems.length; i++) { 5660 if (elems[i].getAttribute('required') === null) continue; 5661 if (!found && elems[i] !== elem) return true; 5662 found = true; 5663 elems[i].className = elems[i].className.replace(/ ?_has_error ?/g, ''); 5664 if (!elems[i].checked) { 5665 no_error = false; 5666 elems[i].className = elems[i].className + ' _has_error'; 5667 err.push("Checking %s is required".replace("%s", elems[i].value)); 5668 } 5669 } 5670 if (!no_error) { 5671 tooltip = create_tooltip(elem, err.join('<br/>')); 5672 } 5673 } else if (elem.tagName == 'SELECT') { 5674 var selected = true; 5675 if (elem.multiple) { 5676 selected = false; 5677 for (var i = 0; i < elem.options.length; i++) { 5678 if (elem.options[i].selected) { 5679 selected = true; 5680 break; 5681 } 5682 } 5683 } else { 5684 for (var i = 0; i < elem.options.length; i++) { 5685 if (elem.options[i].selected && !elem.options[i].value) { 5686 selected = false; 5687 } 5688 } 5689 } 5690 if (!selected) { 5691 elem.className = elem.className + ' _has_error'; 5692 no_error = false; 5693 tooltip = create_tooltip(elem, "Please select an option."); 5694 } 5695 } else if (value === undefined || value === null || value === '') { 5696 elem.className = elem.className + ' _has_error'; 5697 no_error = false; 5698 tooltip = create_tooltip(elem, "This field is required."); 5699 } 5700 } 5701 if (no_error && elem.name == 'email') { 5702 if (!value.match(/^[\+_a-z0-9-'&=]+(\.[\+_a-z0-9-']+)*@@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/i)) { 5703 elem.className = elem.className + ' _has_error'; 5704 no_error = false; 5705 tooltip = create_tooltip(elem, "Enter a valid email address."); 5706 } 5707 } 5708 if (no_error && /date_field/.test(elem.className)) { 5709 if (!value.match(/^\d\d\d\d-\d\d-\d\d$/)) { 5710 elem.className = elem.className + ' _has_error'; 5711 no_error = false; 5712 tooltip = create_tooltip(elem, "Enter a valid date."); 5713 } 5714 } 5715 tooltip ? resize_tooltip(tooltip) : false; 5716 return no_error; 5717 }; 5718 var needs_validate = function(el) { 5719 return el.name == 'email' || el.getAttribute('required') !== null; 5720 }; 5721 var validate_form = function(e) { 5722 var err = form_to_submit.querySelector('._form_error'), no_error = true; 5723 if (!submitted) { 5724 submitted = true; 5725 for (var i = 0, len = allInputs.length; i < len; i++) { 5726 var input = allInputs[i]; 5727 if (needs_validate(input)) { 5728 if (input.type == 'text') { 5729 addEvent(input, 'blur', function() { 5730 this.value = this.value.trim(); 5731 validate_field(this, true); 5732 }); 5733 addEvent(input, 'input', function() { 5734 validate_field(this, true); 5735 }); 5736 } else if (input.type == 'radio' || input.type == 'checkbox') { 5737 (function(el) { 5738 var radios = form_to_submit.elements[el.name]; 5739 for (var i = 0; i < radios.length; i++) { 5740 addEvent(radios[i], 'click', function() { 5741 validate_field(el, true); 5742 }); 5743 } 5744 })(input); 5745 } else if (input.tagName == 'SELECT') { 5746 addEvent(input, 'change', function() { 5747 validate_field(this, true); 5748 }); 5749 } else if (input.type == 'textarea'){ 5750 addEvent(input, 'input', function() { 5751 validate_field(this, true); 5752 }); 5753 } 5754 } 5755 } 5756 } 5757 remove_tooltips(); 5758 for (var i = 0, len = allInputs.length; i < len; i++) { 5759 var elem = allInputs[i]; 5760 if (needs_validate(elem)) { 5761 if (elem.tagName.toLowerCase() !== "select") { 5762 elem.value = elem.value.trim(); 5763 } 5764 validate_field(elem) ? true : no_error = false; 5765 } 5766 } 5767 if (!no_error && e) { 5768 e.preventDefault(); 5769 } 5770 resize_tooltips(); 5771 return no_error; 5772 }; 5773 addEvent(window, 'resize', resize_tooltips); 5774 addEvent(window, 'scroll', resize_tooltips); 5775 window['recaptcha_callback'] = function () { 5776 // Get all recaptchas in the DOM (there may be more than one form on the page). 5777 var recaptchas = document.getElementsByClassName("g-recaptcha"); 5778 for (var i in recaptchas) { 5779 // Set the recaptcha element ID, so the recaptcha can be applied to each element. 5780 var recaptcha_id = "recaptcha_" + i; 5781 recaptchas[i].id = recaptcha_id; 5782 var el = document.getElementById(recaptcha_id); 5783 if (el != null) { 5784 var sitekey = el.getAttribute("data-sitekey"); 5785 var stoken = el.getAttribute("data-stoken"); 5786 grecaptcha.render(recaptcha_id, { "sitekey": sitekey, "stoken": stoken }); 5787 } 5788 } 5789 }; _load_script("//www.google.com/recaptcha/api.js?onload=recaptcha_callback&render=explicit"); 5790 window._old_serialize = null; 5791 if (typeof serialize !== 'undefined') window._old_serialize = window.serialize; 5792 _load_script("//d3rxaij56vjege.cloudfront.net/form-serialize/0.3/serialize.min.js", function() { 5793 window._form_serialize = window.serialize; 5794 if (window._old_serialize) window.serialize = window._old_serialize; 5795 }); 5796 var form_submit = function(e) { 5797 e.preventDefault(); 5798 if (validate_form()) { 5799 // use this trick to get the submit button & disable it using plain javascript 5800 document.querySelector('#@submitForm').disabled = true; 5801 var serialized = _form_serialize(document.getElementById('@newsletterId')); 5802 var err = form_to_submit.querySelector('._form_error'); 5803 err ? err.parentNode.removeChild(err) : false; 5804 _load_script('@formAction' + '?' + serialized + '&jsonp=true'); 5805 } 5806 return false; 5807 }; 5808 addEvent(form_to_submit, 'submit', form_submit); 5809 })(); 5810 function recaptchaCallback() { 5811 $(".js-submit-form").removeAttr('disabled'); 5812 } 5813 5814 </script> 5815 } 5816 } 5817 5818 @helper RenderFooterSocialLinks() 5819 { 5820 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 5821 5822 if (Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks") != null) 5823 { 5824 if (siteURL.Contains("hededanmark")) 5825 { 5826 <div class="footer__content dw-mod"> 5827 <div class="collection dw-mod"> 5828 @foreach (var socialitem in Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks")) 5829 { 5830 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 5831 string socialIconClass = socialIcon.SelectedValue; 5832 string socialIconTitle = socialIcon.SelectedName; 5833 string socialLink = socialitem.GetString("Link"); 5834 5835 <a href="@socialLink" target="_blank" title="@socialIconTitle" class="u-margin-bottom-5px u-padding" rel="noopener"><i class="@socialIconClass fa-2x"></i></a> 5836 } 5837 </div> 5838 </div> 5839 } 5840 } 5841 } 5842 5843 @helper RenderFooterPayments() 5844 { 5845 5846 } 5847 5848 @helper RenderFooterCopyright() 5849 { 5850 5851 } 5852 5853 @* FOOTER LOGO HELPER *@ 5854 @helper RenderFooterLogo() 5855 { 5856 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 5857 5858 object footerLogo = Model.Area.Item.GetItem("Layout").GetFile("FooterLogo"); 5859 object businessName = Model.Area.Item.GetItem("Settings").GetValue("BusinessName"); 5860 string placeHolderImage = "/Files/Images/placeholder.gif"; 5861 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 5862 5863 if (siteURL.Contains("hededanmark")) 5864 { 5865 <div class="footer__content dw-mod"> 5866 <div class="grid footer-logo-container grid--justify-center dw-mod"> 5867 <div class="dw-mod"> 5868 <a href="/Default.aspx?ID=@firstPageId"> 5869 @* FOOTER LOGO *@ 5870 @if (footerLogo != null || businessName != null) 5871 { 5872 <img class="grid__cell-img logo__img footer-logo dw-mod b-lazy" src="@placeHolderImage" data-src="@footerLogo" alt="@businessName" /> 5873 } 5874 </a> 5875 </div> 5876 </div> 5877 </div> 5878 } 5879 5880 else 5881 { 5882 <div class="footer__content dw-mod"> 5883 <div class="grid footer-logo-container grid--justify-start dw-mod"> 5884 <div class="footer-logo-hd2412 dw-mod"> 5885 <a href="/Default.aspx?ID=@firstPageId"> 5886 @* FOOTER LOGO *@ 5887 @if (footerLogo != null || businessName != null) 5888 { 5889 <img class="grid__cell-img logo__img footer-logo dw-mod b-lazy" src="@placeHolderImage" data-src="@footerLogo" alt="@businessName" /> 5890 } 5891 </a> 5892 </div> 5893 </div> 5894 </div> 5895 } 5896 } 5897 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 5898 @using System 5899 @using System.Web 5900 @using System.Collections.Generic 5901 @using Dynamicweb.Rapido.Blocks.Extensibility 5902 @using Dynamicweb.Rapido.Blocks 5903 @using Dynamicweb.Ecommerce.Common 5904 5905 @{ 5906 BlocksPage referencesBlocksPage = BlocksPage.GetBlockPage("Master"); 5907 5908 Block masterScriptReferences = new Block() 5909 { 5910 Id = "MasterScriptReferences", 5911 SortId = 1, 5912 Template = RenderMasterScriptReferences() 5913 }; 5914 referencesBlocksPage.Add(MasterBlockId.MasterReferences, masterScriptReferences); 5915 } 5916 @helper RenderMasterScriptReferences() 5917 { 5918 5919 <script src="/Files/Templates/Designs/Rapido/js/jquery-3.5.1.min.js" defer></script> 5920 5921 <script src="/Files/Templates/Designs/Rapido/js/urlsearchparamspolyfill.js" defer></script> 5922 5923 <script src="/Files/Templates/Designs/Rapido/js/mark.min.js" defer></script> 5924 5925 <script src="/Files/Templates/Designs/Rapido/js/typeahead.js" defer></script> 5926 5927 <script src="/Files/Templates/Designs/Rapido/js/handlebars-v4.0.12.min.js" defer></script> 5928 <script src="/Files/Templates/Designs/Rapido/js/master.min.js" defer></script> 5929 <script src="/Files/Templates/Designs/Rapido/js/swiper.js" defer></script> 5930 <script src="/Files/Templates/Designs/Rapido/js/jquery.prettySocial.min.js" defer></script> 5931 <script src="/Files/Templates/Designs/Rapido/js/sharer.min.js"></script> 5932 <script src="/Files/Templates/Designs/Rapido/js/jquery.toc.js" defer></script> 5933 5934 <script src="/Files/Templates/Designs/Rapido/js/jquery.combostars.min.js" defer></script> 5935 <script> 5936 // Picture element HTML5 shiv 5937 document.createElement("picture"); 5938 </script> 5939 <script src="/Files/Templates/Designs/Rapido/js/picturefill.min.js" defer></script> 5940 5941 <script src="/Files/Templates/Designs/Rapido/js/nz/main.js" defer></script> 5942 5943 if (Model.Area.Item.GetItem("Custom").GetBoolean("UseCustomJavascript")) 5944 { 5945 <script src="/Files/Templates/Designs/Rapido/js/custom.min.js" defer></script> 5946 PushPromise("/Files/Templates/Designs/Rapido/js/custom.min.js"); 5947 } 5948 5949 PushPromise("/Files/Templates/Designs/Rapido/js/nz/jquery-3.5.1.min.js"); 5950 PushPromise("/Files/Templates/Designs/Rapido/js/typeahead.js"); 5951 PushPromise("/Files/Templates/Designs/Rapido/js/mark.min.js"); 5952 PushPromise("/Files/Templates/Designs/Rapido/js/urlsearchparamspolyfill.js"); 5953 PushPromise("/Files/Templates/Designs/Rapido/js/handlebars-v4.0.12.min.js"); 5954 PushPromise("/Files/Templates/Designs/Rapido/js/master.min.js"); 5955 PushPromise("/Files/Templates/Designs/Rapido/js/swiper.js"); 5956 PushPromise("/Files/Templates/Designs/Rapido/js/jquery.combostars.min.js"); 5957 PushPromise("/Files/Templates/Designs/Rapido/js/sharer.min.js"); 5958 PushPromise("/Files/Templates/Designs/Rapido/js/picturefill.min.js"); 5959 PushPromise("/Files/Templates/Designs/Rapido/js/nz/main.js"); 5960 PushPromise("/Files/Templates/Designs/Rapido/js/jquery.toc.js"); 5961 } 5962 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5963 5964 @using System 5965 @using System.Web 5966 @using System.Collections.Generic 5967 @using Dynamicweb.Rapido.Blocks.Extensibility 5968 @using Dynamicweb.Rapido.Blocks 5969 5970 @{ 5971 BlocksPage searchBlocksPage = BlocksPage.GetBlockPage("Master"); 5972 bool navigationItemsHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 5973 5974 if (!navigationItemsHideSearch) 5975 { 5976 Block masterSearchScriptTemplates = new Block() 5977 { 5978 Id = "MasterSearchScriptTemplates", 5979 SortId = 1, 5980 Template = RenderSearchScriptTemplates() 5981 }; 5982 5983 searchBlocksPage.Add(MasterBlockId.MasterBottomSnippets, masterSearchScriptTemplates); 5984 } 5985 } 5986 5987 @helper RenderSearchScriptTemplates() 5988 { 5989 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 5990 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 5991 bool useFacebookPixel = !string.IsNullOrWhiteSpace(Pageview.AreaSettings.GetItem("Settings").GetString("FacebookPixelID")); 5992 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 5993 bool useGoogleTagManager = !string.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID")); 5994 bool showPrice = !Pageview.AreaSettings.GetItem("Layout").GetBoolean("HidePriceInSearchResults"); 5995 bool showAddToCartButton = !Pageview.AreaSettings.GetItem("Layout").GetBoolean("HideAddToCartButton"); 5996 bool showViewButton = !Pageview.AreaSettings.GetItem("Layout").GetBoolean("HideViewButton"); 5997 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("Layout").GetBoolean("ShowAddToDownloadButton"); 5998 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 5999 6000 <script id="SearchGroupsTemplate" type="text/x-template"> 6001 {{#.}} 6002 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 6003 {{/.}} 6004 </script> 6005 6006 <script id="SearchProductsTemplate" type="text/x-template"> 6007 {{#each .}} 6008 {{#Product}} 6009 {{#ifCond template "!==" "SearchMore"}} 6010 <li class="dropdown__item dropdown__item--seperator dw-mod"> 6011 @if (useFacebookPixel) 6012 { 6013 <text>{{{facebookPixelSearch name number priceDouble currency searchParameter}}}</text> 6014 } 6015 @if (useGoogleTagManager) 6016 { 6017 <text>{{{googleEnchantImpression 'Search results' currency googleImpression}}}</text> 6018 } 6019 <div> 6020 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left" onclick="{{googleImpressionClick}}" title="{{name}}"> 6021 <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> 6022 <div class="u-pull--left"> 6023 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 6024 @if (showPrice && !onlyPreview) 6025 { 6026 if (pointShopOnly) 6027 { 6028 <text> 6029 {{#if havePointPrice}} 6030 <div> 6031 <span class="u-color--loyalty-points">{{points}}</span> @Translate("points") 6032 </div> 6033 {{else}} 6034 <small class="help-text u-no-margin">@Translate("Not available")</small> 6035 {{/if}} 6036 {{#unless canBePurchasedWithPoints}} 6037 {{#if havePointPrice}} 6038 <small class="help-text u-no-margin">@Translate("Not enough points to buy this")</small> 6039 {{/if}} 6040 {{/unless}} 6041 </text> 6042 } 6043 else 6044 { 6045 <div>{{price}}</div> 6046 } 6047 } 6048 </div> 6049 </a> 6050 <div class="u-margin-left u-pull--right"> 6051 @if (showAddToCartButton && !onlyPreview) { 6052 if (pointShopOnly) 6053 { 6054 <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" 6055 onclick="Cart.AddToCart(event, { 6056 id: '{{productId}}', 6057 quantity: 1, 6058 buyForPoints: true, 6059 productInfo: {{productInfo}} 6060 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 6061 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue js-ignore-click-outside"></i> 6062 </button> 6063 } else { 6064 <button type="button" class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside" 6065 onclick="Cart.AddToCart(event, { 6066 id: '{{productId}}', 6067 quantity: 1, 6068 productInfo: {{productInfo}} 6069 }); {{facebookPixelAction}}"> 6070 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue js-ignore-click-outside"></i> 6071 </button> 6072 } 6073 <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> 6074 } 6075 else if (showViewButton) 6076 { 6077 <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> 6078 } 6079 @if (showAddToDownloadButton) 6080 { 6081 <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}}"> 6082 <i class="fas fa-plus js-button-icon"></i> 6083 </button> 6084 } 6085 </div> 6086 </div> 6087 </li> 6088 {{/ifCond}} 6089 {{#ifCond template "===" "SearchMore"}} 6090 {{>SearchMoreProducts}} 6091 {{/ifCond}} 6092 {{/Product}} 6093 {{else}} 6094 <li class="dropdown__item dropdown__item--seperator dw-mod"> 6095 @Translate("Your search gave 0 results") 6096 </li> 6097 {{/each}} 6098 </script> 6099 6100 <script id="SearchMoreProducts" type="text/x-template"> 6101 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 6102 <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 6103 @Translate("View all") 6104 </a> 6105 </li> 6106 </script> 6107 6108 <script id="SearchMorePages" type="text/x-template"> 6109 {{#ifCond activeTo "<" currentTime}} 6110 6111 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 6112 <a href="/Default.aspx?ID=@contentSearchPageLink&Search={{searchParameter}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 6113 @Translate("View all") 6114 </a> 6115 </li> 6116 {{/ifCond}} 6117 6118 </script> 6119 6120 <script id="SearchPagesTemplate" type="text/x-template"> 6121 {{#each .}} 6122 {{#ifCond template "!==" "SearchMore"}} 6123 {{#ifCond activeTo ">=" currentTime}} 6124 6125 <li class="dropdown__item dropdown__item--seperator dw-mod"> 6126 <div> 6127 <a href="/Default.aspx?ID={{id}}" class="js-typeahead-link u-pull--left u-color-inherit"> 6128 <div class="u-margin-right u-pull--left"><i class="fa {{icon}} u-w20px u-ta-center"></i></div> 6129 <div class="u-pull--left"> 6130 <div class="u-bold u-truncate-text u-max-w220px js-typeahead-name">{{name}}</div> 6131 </div> 6132 </a> 6133 </div> 6134 </li> 6135 {{/ifCond}} 6136 6137 6138 {{/ifCond}} 6139 {{#ifCond totalPagesItem "<=" 1 }} 6140 6141 {{#ifCond activeTo "<" currentTime}} 6142 <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable dw-mod"> 6143 @Translate("Your search gave 0 results") 6144 </li> 6145 {{/ifCond}} 6146 {{/ifCond}} 6147 6148 {{#ifCond template "===" "SearchMore"}} 6149 {{#ifCond activeTo ">=" currentTime}} 6150 6151 {{>SearchMorePages}} 6152 {{/ifCond}} 6153 6154 {{/ifCond}} 6155 6156 {{else}} 6157 <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable dw-mod"> 6158 @Translate("Your search gave 0 results") 6159 </li> 6160 6161 6162 {{/each}} 6163 </script> 6164 6165 <script id="SearchPagesTemplateWrap" type="text/x-template"> 6166 <div class="dropdown__column-header">@Translate("Pages")</div> 6167 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 6168 6169 {{>SearchPagesTemplate}} 6170 </ul> 6171 </script> 6172 6173 <script id="SearchProductsTemplateWrap" type="text/x-template"> 6174 <div class="dropdown__column-header">@Translate("Products")</div> 6175 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 6176 {{>SearchProductsTemplate}} 6177 </ul> 6178 </script> 6179 } 6180 6181 6182 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 6183 6184 @using System 6185 @using System.Web 6186 @using System.Collections.Generic 6187 @using Dynamicweb.Rapido.Blocks.Extensibility 6188 @using Dynamicweb.Rapido.Blocks 6189 6190 @{ 6191 BlocksPage bottomSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 6192 6193 Block primaryBottomSnippets = new Block() 6194 { 6195 Id = "MasterJavascriptInitializers", 6196 SortId = 100, 6197 Template = RenderPrimaryBottomSnippets() 6198 }; 6199 bottomSnippetsBlocksPage.Add(MasterBlockId.MasterReferences, primaryBottomSnippets); 6200 } 6201 6202 @helper RenderPrimaryBottomSnippets() { 6203 bool isWireframeMode = Model.Area.Item.GetItem("Settings").GetBoolean("WireframeMode"); 6204 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 6205 6206 if (isWireframeMode) 6207 { 6208 <script> 6209 Wireframe.Init(true); 6210 </script> 6211 } 6212 6213 6214 if (useGoogleTagManager) 6215 { 6216 <script> 6217 document.addEventListener('addToCart', function(event) { 6218 var googleImpression = event.detail.productInfo.googleImpression; 6219 dataLayer.push({ 6220 'event': 'addToCart', 6221 'ecommerce': { 6222 'currencyCode': '@Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency().Code', 6223 'add': { 6224 'products': [{ 6225 'name': googleImpression.name, 6226 'id': googleImpression.id, 6227 'price': googleImpression.price, 6228 'brand': googleImpression.brand, 6229 'category': googleImpression.category, 6230 'variant': googleImpression.variant, 6231 'quantity': event.detail.quantity 6232 }] 6233 } 6234 } 6235 }); 6236 }); 6237 </script> 6238 } 6239 6240 //if digitalwarehouse 6241 if (Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowDownloadCart")) 6242 { 6243 string cartContextId = Converter.ToString(HttpContext.Current.Application["DownloadCartContext"]); 6244 6245 if (string.IsNullOrEmpty(cartContextId)) { 6246 var moduleProps = Dynamicweb.Modules.Properties.GetParagraphModuleSettings(GetPageIdByNavigationTag("DownloadCart"), "eCom_CartV2"); 6247 var cartSettings = new Dynamicweb.Ecommerce.Cart.ModuleSettings(moduleProps); 6248 cartContextId = cartSettings.OrderContextID; 6249 HttpContext.Current.Application["DownloadCartContext"] = cartContextId; 6250 } 6251 6252 <script> 6253 let downloadCart = new DownloadCart({ 6254 cartPageId: @GetPageIdByNavigationTag("MiniCartFeed"), 6255 contextId: "@cartContextId", 6256 addButtonText: "@Translate("Add")", 6257 removeButtonText: "@Translate("Remove")" 6258 }); 6259 </script> 6260 } 6261 6262 <!--$$Javascripts--> 6263 } 6264 @if (File.Exists(HttpContext.Current.Server.MapPath("/MasterBlocks/Custom__Blocks.cshtml"))) 6265 { 6266 <text>@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 6267 6268 @using System 6269 @using System.Web 6270 @using System.Collections.Generic 6271 @using Dynamicweb.Rapido.Blocks 6272 6273 @{ 6274 BlocksPage masterCustomBlocksPage = BlocksPage.GetBlockPage("Master"); 6275 6276 }</text> 6277 } 6278 6279 6280 @functions { 6281 public class ManifestIcon 6282 { 6283 public string src { get; set; } 6284 public string type { get; set; } 6285 public string sizes { get; set; } 6286 } 6287 6288 public class Manifest 6289 { 6290 public string name { get; set; } 6291 public string short_name { get; set; } 6292 public string start_url { get; set; } 6293 public string display { get; set; } 6294 public string background_color { get; set; } 6295 public string theme_color { get; set; } 6296 public List<ManifestIcon> icons { get; set; } 6297 } 6298 } 6299 @{ 6300 if (!String.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("AppName")) && Model.Area.Item.GetItem("Settings").GetFile("AppIcon") != null) 6301 { 6302 Manifest manifest = new Manifest 6303 { 6304 name = Model.Area.Item.GetItem("Settings").GetString("AppName"), 6305 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"), 6306 start_url = "/", 6307 display = "standalone", 6308 background_color = Model.Area.Item.GetItem("Settings").GetString("AppBackgroundColor"), 6309 theme_color = Model.Area.Item.GetItem("Settings").GetString("AppThemeColor") 6310 }; 6311 6312 manifest.icons = new List<ManifestIcon> { 6313 new ManifestIcon { 6314 src = "/Admin/Public/GetImage.ashx?width=192&height=192&crop=5&image=" + Model.Area.Item.GetItem("Settings").GetFile("AppIcon").PathUrlEncoded, 6315 sizes = "192x192", 6316 type = "image/png" 6317 }, 6318 new ManifestIcon { 6319 src = "/Admin/Public/GetImage.ashx?width=512&height=512&crop=5&image=" + Model.Area.Item.GetItem("Settings").GetFile("AppIcon").PathUrlEncoded, 6320 sizes = "512x512", 6321 type = "image/png" 6322 }, 6323 new ManifestIcon { 6324 src = "/Admin/Public/GetImage.ashx?width=1024&height=1024&crop=5&image=" + Model.Area.Item.GetItem("Settings").GetFile("AppIcon").PathUrlEncoded, 6325 sizes = "1024x1024", 6326 type = "image/png" 6327 } 6328 }; 6329 6330 string manifestFilePath = HttpContext.Current.Request.MapPath("/Files/Templates/Designs/Rapido/manifest.json"); 6331 string manifestJSON = Newtonsoft.Json.JsonConvert.SerializeObject(manifest); 6332 string currentManifest = File.ReadAllText(manifestFilePath); 6333 6334 if (manifestJSON != currentManifest) 6335 { 6336 File.WriteAllText(manifestFilePath, manifestJSON); 6337 } 6338 } 6339 } 6340 6341 @{ 6342 var swatches = new Dynamicweb.Content.Items.ColorSwatchService(); 6343 var brandColors = swatches.GetColorSwatch(1); 6344 string brandColorOne = brandColors.Palette["BrandColor1"]; 6345 } 6346 6347 <!DOCTYPE html> 6348 6349 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 6350 <head> 6351 @{ 6352 string GoogleTagManagerID = Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID"); 6353 string FacebookPixelID = Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID"); 6354 6355 if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 6356 { 6357 <script> 6358 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 6359 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 6360 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 6361 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 6362 })(window,document,'script','dataLayer','@GoogleTagManagerID'); 6363 </script> 6364 <!-- Google Tag Manager (noscript) --> 6365 } 6366 } 6367 <meta http-equiv="Accept-CH" content="DPR, Viewport-Width, Width"> 6368 6369 <!-- Rapido version 3.1 --> 6370 <meta charset="utf-8" /> 6371 <title>@Model.Title</title> 6372 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 6373 6374 6375 @if (Dynamicweb.Context.Current.Request.Url.Host.EndsWith("nozebrahosting.dk") || Dynamicweb.Context.Current.Request.Url.Host.EndsWith("dynamicweb.dk")) 6376 { 6377 <meta name="robots" content="noindex, nofollow"> 6378 } 6379 6380 @{ 6381 var noFollowBool = Pageview.Page.Nofollow; 6382 var noIndexBool = Pageview.Page.Noindex; 6383 } 6384 6385 @if (noIndexBool && noFollowBool) 6386 { 6387 <meta name="robots" content="noindex, nofollow"> 6388 } 6389 else if (noFollowBool) 6390 { 6391 <meta name="robots" content="nofollow"> 6392 } 6393 else if (noIndexBool) 6394 { 6395 <meta name="robots" content="noindex"> 6396 } 6397 6398 6399 <meta name="theme-color" content="@brandColorOne" /> 6400 6401 <meta name="description" content="@metaDesc"> 6402 <meta name="keywords" content="@Pageview.Page.Keywords"> 6403 6404 <!-- Open Graph --> 6405 6406 <meta property="og:type" content="@ogType" /> 6407 <meta property="og:site_name" content="@businessName"> 6408 <meta property="og:title" content="@ogTitle" /> 6409 <meta property="og:description" content="@ogDesc" /> 6410 <meta property="og:url" content="@siteURL" /> 6411 <meta property="og:image" content="@domainUrl@ogImage" /> 6412 6413 <link rel="canonical" href="@canonical" /> 6414 6415 <style> 6416 html { 6417 font-family: sans-serif; 6418 line-height: 1.15 6419 } 6420 6421 body { 6422 margin: 0 6423 } 6424 6425 header, nav, section { 6426 display: block 6427 } 6428 6429 h1 { 6430 font-size: 2em; 6431 margin: .67em 0 6432 } 6433 6434 main { 6435 display: block 6436 } 6437 6438 a { 6439 background-color: transparent 6440 } 6441 6442 img { 6443 border-style: none 6444 } 6445 6446 svg:not(:root) { 6447 overflow: hidden 6448 } 6449 6450 button, input { 6451 font-family: inherit; 6452 font-size: inherit; 6453 font-style: inherit; 6454 font-variant: inherit; 6455 font-weight: inherit; 6456 line-height: inherit; 6457 margin: 0 6458 } 6459 6460 button, input { 6461 overflow: visible 6462 } 6463 6464 button { 6465 text-transform: none 6466 } 6467 6468 button, [type="submit"] { 6469 -webkit-appearance: button 6470 } 6471 6472 [type="checkbox"] { 6473 box-sizing: border-box; 6474 padding: 0 6475 } 6476 6477 *::-webkit-file-upload-button { 6478 -webkit-appearance: button; 6479 font-family: inherit; 6480 font-size: inherit; 6481 font-style: inherit; 6482 font-variant: inherit; 6483 font-weight: inherit; 6484 line-height: inherit 6485 } 6486 6487 html { 6488 box-sizing: border-box; 6489 font-size: 62.5%; 6490 height: 100%; 6491 overflow-y: scroll 6492 } 6493 6494 *, ::before, ::after { 6495 box-sizing: inherit 6496 } 6497 6498 body { 6499 font-size: 1.6rem; 6500 line-height: 2.4rem; 6501 font-weight: 400; 6502 font-family: Roboto,Helvetica,Arial,sans-serif; 6503 color: rgb(34,34,34) 6504 } 6505 6506 a { 6507 color: rgb(34,34,34); 6508 text-decoration: none; 6509 word-wrap: break-word 6510 } 6511 6512 ul { 6513 list-style: circle none 6514 } 6515 6516 ul { 6517 padding-left: 0; 6518 margin-top: 0 6519 } 6520 6521 ul ul { 6522 margin: 1.5rem 0 1.5rem 3rem 6523 } 6524 6525 li { 6526 margin-bottom: 1rem 6527 } 6528 6529 img { 6530 display: table; 6531 max-width: 100% 6532 } 6533 6534 input[type="text"], input[type="password"] { 6535 background-color: rgb(255,255,255); 6536 border: 1px solid rgb(209,209,209); 6537 box-shadow: none; 6538 box-sizing: border-box; 6539 height: 38px; 6540 padding: 6px 10px; 6541 -webkit-appearance: none 6542 } 6543 6544 label { 6545 display: block; 6546 margin-bottom: .5rem 6547 } 6548 6549 input[type="checkbox"] { 6550 display: inline 6551 } 6552 6553 h1, h2 { 6554 margin-top: 0; 6555 margin-bottom: 2rem; 6556 font-weight: 300; 6557 word-wrap: break-word; 6558 color: rgb(34,34,34) 6559 } 6560 6561 h1 { 6562 font-size: 4rem; 6563 line-height: 1.2 6564 } 6565 6566 h2 { 6567 font-size: 3.6rem; 6568 line-height: 1.25 6569 } 6570 6571 p { 6572 margin-top: 0 6573 } 6574 6575 div, p { 6576 letter-spacing: normal; 6577 word-spacing: normal; 6578 white-space: normal 6579 } 6580 6581 button, input { 6582 margin-bottom: 1.4rem 6583 } 6584 6585 form, p, ul { 6586 margin-bottom: 2.4rem 6587 } 6588 6589 li { 6590 margin-bottom: 1rem 6591 } 6592 6593 label { 6594 margin-bottom: .25rem 6595 } 6596 6597 .btn { 6598 background-color: transparent; 6599 border-top-left-radius: 0; 6600 border-top-right-radius: 0; 6601 border-bottom-right-radius: 0; 6602 border-bottom-left-radius: 0; 6603 border: 1px solid rgb(187,187,187); 6604 color: inherit; 6605 display: inline-block; 6606 font-size: inherit; 6607 font-weight: 500; 6608 letter-spacing: .1rem; 6609 line-height: 20px; 6610 min-height: 38px; 6611 margin-bottom: 1em; 6612 padding: 8px 30px; 6613 text-align: center; 6614 text-decoration: none; 6615 vertical-align: top; 6616 word-break: break-all 6617 } 6618 6619 .btn--primary { 6620 color: rgb(255,255,255); 6621 background-color: rgb(84,84,84); 6622 border-color: rgb(84,84,84) 6623 } 6624 6625 .btn--full { 6626 width: 100% 6627 } 6628 6629 .btn--link { 6630 border: none; 6631 background-color: transparent 6632 } 6633 6634 .btn--link-clean { 6635 border: none; 6636 background-color: transparent; 6637 padding: 0; 6638 margin: 0; 6639 height: auto; 6640 line-height: 1.4; 6641 min-height: 100% 6642 } 6643 6644 .dropdown { 6645 position: relative; 6646 display: inline-block; 6647 text-align: left 6648 } 6649 6650 .dropdown.dropdown--absolute-position { 6651 list-style: none; 6652 z-index: 70; 6653 background-color: rgb(255,255,255); 6654 position: absolute; 6655 top: 100%; 6656 left: 0; 6657 box-shadow: rgba(0,0,0,.239216) 0 6px 12px; 6658 margin: 0 6659 } 6660 6661 .modal-container { 6662 z-index: 10000; 6663 position: fixed; 6664 top: 0; 6665 right: 0; 6666 bottom: 0; 6667 left: 0; 6668 display: none 6669 } 6670 6671 .modal-overlay { 6672 background-color: rgba(0,0,0,.498039); 6673 width: 100%; 6674 height: 100%; 6675 position: fixed; 6676 z-index: 100; 6677 left: 0; 6678 top: 0 6679 } 6680 6681 .modal { 6682 background-color: rgb(255,255,255); 6683 z-index: 10000; 6684 max-width: calc(100% - 5em); 6685 max-height: calc(100% - 5em); 6686 overflow-y: auto; 6687 position: relative 6688 } 6689 6690 .modal h2 { 6691 margin: 0 6692 } 6693 6694 .modal--xs { 6695 width: 280px 6696 } 6697 6698 .modal__header { 6699 padding: .5em 1em; 6700 border-bottom-width: 1px; 6701 border-bottom-style: solid; 6702 border-bottom-color: rgb(211,211,211) 6703 } 6704 6705 .modal__body { 6706 padding: 1em; 6707 overflow-x: auto 6708 } 6709 6710 .modal-trigger { 6711 display: none !important 6712 } 6713 6714 .form__field-group { 6715 margin-bottom: 1em; 6716 position: relative 6717 } 6718 6719 .form__field-group input { 6720 margin-bottom: 0 6721 } 6722 6723 .form__field-group > * { 6724 width: 100% 6725 } 6726 6727 .form__field-group > [for], .form__field-group > [type="checkbox"] { 6728 display: inline; 6729 width: auto 6730 } 6731 6732 .field-error { 6733 color: rgb(195,66,63); 6734 font-size: 1.47rem; 6735 margin-top: 5px 6736 } 6737 6738 input[type="checkbox"].form__control { 6739 display: inline; 6740 position: absolute; 6741 opacity: 0; 6742 width: auto; 6743 height: 0; 6744 margin: 0 6745 } 6746 6747 input[type="checkbox"].form__control + label { 6748 position: relative; 6749 line-height: 17px; 6750 display: inline-block 6751 } 6752 6753 input[type="checkbox"].form__control + label::before { 6754 content: ''; 6755 width: 17px; 6756 height: 17px; 6757 border: 1px solid rgb(209,209,209); 6758 display: inline-block; 6759 margin-right: 5px; 6760 vertical-align: top 6761 } 6762 6763 input[type="checkbox"].form__control:checked + label::after { 6764 content: ''; 6765 height: 5px; 6766 width: 10px; 6767 border-left-width: 2px; 6768 border-left-color: rgb(84,84,84); 6769 border-left-style: solid; 6770 border-bottom-width: 2px; 6771 border-bottom-color: rgb(84,84,84); 6772 border-bottom-style: solid; 6773 left: 4px; 6774 top: 5px; 6775 display: inline-block; 6776 position: absolute 6777 } 6778 6779 .b-lazy { 6780 max-width: 100%; 6781 opacity: 0 6782 } 6783 6784 .background-image { 6785 position: absolute; 6786 top: 0; 6787 bottom: 0; 6788 left: 0; 6789 right: 0 6790 } 6791 6792 .background-image::after { 6793 content: ''; 6794 position: absolute; 6795 top: 0; 6796 bottom: 0; 6797 left: 0; 6798 right: 0; 6799 background-color: inherit 6800 } 6801 6802 .background-image__wrapper { 6803 position: absolute; 6804 width: 100%; 6805 height: 100%; 6806 top: 0; 6807 overflow: hidden 6808 } 6809 6810 .background-image__cover { 6811 height: 100%; 6812 display: block; 6813 max-width: 100%; 6814 width: 100% 6815 } 6816 6817 .image { 6818 position: relative; 6819 top: 0; 6820 bottom: 0; 6821 left: 0; 6822 right: 0 6823 } 6824 6825 .image::after { 6826 content: ''; 6827 position: absolute; 6828 top: 0; 6829 bottom: 0; 6830 left: 0; 6831 right: 0; 6832 background-color: inherit 6833 } 6834 6835 .image-filter { 6836 overflow: hidden 6837 } 6838 6839 .typeahead { 6840 position: relative; 6841 z-index: 70; 6842 color: rgb(34,34,34); 6843 max-width: 600px; 6844 width: 100% 6845 } 6846 6847 .typeahead-search-field { 6848 margin: 0; 6849 border-top-left-radius: 0; 6850 border-top-right-radius: 0; 6851 border-bottom-right-radius: 0; 6852 border-bottom-left-radius: 0; 6853 position: relative 6854 } 6855 6856 @@media (max-width:479px) { 6857 .u-hidden-xxs { 6858 display: none !important 6859 } 6860 } 6861 6862 .grid { 6863 display: -webkit-flex; 6864 zoom: 1; 6865 -webkit-flex-wrap: wrap; 6866 padding: 0; 6867 margin: 0; 6868 position: relative; 6869 width: 100%; 6870 max-width: 100%; 6871 list-style-type: none; 6872 word-spacing: -0.43em !important 6873 } 6874 6875 .grid::before, .grid::after { 6876 letter-spacing: normal; 6877 word-spacing: normal; 6878 white-space: normal; 6879 max-width: 100% 6880 } 6881 6882 .grid ::before, .grid ::after { 6883 letter-spacing: normal; 6884 word-spacing: normal; 6885 white-space: normal 6886 } 6887 6888 .grid .grid { 6889 -webkit-flex: 1 1 auto 6890 } 6891 6892 .grid * { 6893 box-sizing: border-box 6894 } 6895 6896 .grid ::before, .grid ::after { 6897 box-sizing: border-box 6898 } 6899 6900 [class*="grid__col-"] { 6901 display: -webkit-flex; 6902 zoom: 1; 6903 -webkit-flex-direction: column; 6904 letter-spacing: normal; 6905 word-spacing: normal; 6906 white-space: normal; 6907 position: relative; 6908 width: 100%; 6909 vertical-align: top; 6910 padding: .5em 6911 } 6912 6913 .grid__cell { 6914 position: relative; 6915 display: block; 6916 -webkit-flex: 1 1 auto 6917 } 6918 6919 .grid__col-1 { 6920 width: 8.33333333% 6921 } 6922 6923 @@media (min-width:480px) { 6924 .grid__col-xs-12 { 6925 width: 100% 6926 } 6927 } 6928 6929 @@media (min-width:768px) { 6930 .grid__col-sm-12 { 6931 width: 100% 6932 } 6933 6934 .grid__col-sm-4 { 6935 width: 33.33333333% 6936 } 6937 } 6938 6939 @@media (min-width:992px) { 6940 .grid__col-md-12 { 6941 width: 100% 6942 } 6943 6944 .grid__col-md-6 { 6945 width: 50% 6946 } 6947 6948 .grid__col-md-3 { 6949 width: 25% 6950 } 6951 } 6952 6953 @@media (min-width:1200px) { 6954 .grid__col-lg-6 { 6955 width: 50% 6956 } 6957 6958 .grid__col-lg-3 { 6959 width: 25% 6960 } 6961 } 6962 6963 @@media (min-width:992px) { 6964 .grid__col-md-auto { 6965 -webkit-flex: 1 0 0; 6966 width: 0 6967 } 6968 6969 .grid__col-md-auto-width { 6970 width: auto 6971 } 6972 } 6973 6974 @@media (min-width:1200px) { 6975 .grid__col-lg-auto { 6976 -webkit-flex: 1 0 0; 6977 width: 0 6978 } 6979 6980 .grid__col-lg-auto-width { 6981 width: auto 6982 } 6983 } 6984 6985 .grid--wrap { 6986 -webkit-flex-wrap: wrap 6987 } 6988 6989 .grid--align-content-start { 6990 -webkit-align-content: flex-start 6991 } 6992 6993 .grid--align-self-end { 6994 -webkit-align-self: flex-end; 6995 vertical-align: bottom 6996 } 6997 6998 .grid--align-self-center { 6999 -webkit-align-self: center; 7000 vertical-align: middle 7001 } 7002 7003 .grid--justify-end { 7004 text-align: right; 7005 -webkit-justify-content: flex-end 7006 } 7007 7008 .grid--justify-end .grid__cell, .grid--justify-end [class*="grid__col-"] { 7009 text-align: initial 7010 } 7011 7012 .grid--justify-center { 7013 text-align: center; 7014 -webkit-justify-content: center 7015 } 7016 7017 .grid--justify-center .grid__cell, .grid--justify-center [class*="grid__col-"] { 7018 text-align: initial 7019 } 7020 7021 .grid__col--bleed { 7022 padding: 0 7023 } 7024 7025 .grid__col--bleed-x { 7026 padding: .5em 0 7027 } 7028 7029 .grid__cell-img { 7030 display: -webkit-flex; 7031 -webkit-flex: 0 0 auto; 7032 margin-left: 0; 7033 margin-right: 0; 7034 max-width: 100%; 7035 height: auto 7036 } 7037 7038 .grid__cell-img--centered { 7039 width: auto; 7040 margin: 0 auto 7041 } 7042 7043 .grid__cell-footer { 7044 display: -webkit-flex; 7045 zoom: 1; 7046 width: 100%; 7047 margin-top: auto 7048 } 7049 7050 .site { 7051 left: 0; 7052 position: relative; 7053 width: 100vw; 7054 max-width: 100% 7055 } 7056 7057 .page { 7058 min-height: 500px 7059 } 7060 7061 .top-container__center-container { 7062 padding: 0 1em 7063 } 7064 7065 .top-container--sticky { 7066 width: 100%; 7067 position: fixed; 7068 top: 0; 7069 z-index: 90 7070 } 7071 7072 .center-container { 7073 margin: 0 auto; 7074 max-width: 1280px; 7075 position: relative; 7076 width: 100%; 7077 height: 100%; 7078 box-sizing: border-box 7079 } 7080 7081 .paragraph-container { 7082 padding: 1em 7083 } 7084 7085 .paragraph-container p:last-of-type { 7086 margin-bottom: .25em 7087 } 7088 7089 .paragraph-container--full-width { 7090 width: 100vw; 7091 position: relative; 7092 left: 50%; 7093 right: 50%; 7094 margin-left: -50vw 7095 } 7096 7097 .paragraph-container--height-xl { 7098 height: 550px 7099 } 7100 7101 .paragraph-container--height-xl > .paragraph-container { 7102 height: 550px 7103 } 7104 7105 .paragraph-container--height-auto { 7106 min-height: 60px 7107 } 7108 7109 .paragraph-container--height-auto > .paragraph-container { 7110 min-height: 60px 7111 } 7112 7113 .paragraph-container__button { 7114 margin-top: 1em 7115 } 7116 7117 .multiple-paragraphs-container { 7118 position: relative 7119 } 7120 7121 .multiple-paragraphs-container h2 { 7122 color: inherit 7123 } 7124 7125 .multiple-paragraphs-container p { 7126 color: inherit 7127 } 7128 7129 .multiple-paragraphs-container--spacing-none { 7130 padding-top: 0; 7131 padding-bottom: 0 7132 } 7133 7134 .multiple-paragraphs-container--spacing-lg { 7135 padding-top: 1em; 7136 padding-bottom: 1em 7137 } 7138 7139 @@media (max-width:768px) { 7140 .top-container__center-container { 7141 padding: 0 .5em 7142 } 7143 7144 .paragraph-container { 7145 padding: 1em .5em 7146 } 7147 } 7148 7149 .logo { 7150 margin: .5em .5em .5em 0 7151 } 7152 7153 .main-navigation { 7154 box-sizing: border-box; 7155 background-color: rgb(228,228,228); 7156 z-index: 10; 7157 position: relative 7158 } 7159 7160 .menu { 7161 list-style: none; 7162 margin: 0; 7163 padding: 0; 7164 white-space: nowrap 7165 } 7166 7167 .menu--dropdown { 7168 background-color: rgb(246,246,246); 7169 box-shadow: rgba(0,0,0,.172549) 0 3px 6px; 7170 z-index: 10000; 7171 position: absolute; 7172 top: 100%; 7173 left: 0; 7174 display: none; 7175 line-height: 1.4; 7176 min-width: 100%; 7177 padding: .5em 0; 7178 margin-top: 3px 7179 } 7180 7181 .menu--dropdown-right { 7182 background-color: rgb(246,246,246); 7183 box-shadow: rgba(0,0,0,.172549) 0 3px 6px; 7184 z-index: 10000; 7185 position: absolute; 7186 top: 100%; 7187 display: none; 7188 line-height: 1.4; 7189 min-width: 100%; 7190 padding: .5em 0; 7191 margin-top: 3px; 7192 left: auto; 7193 right: 0 7194 } 7195 7196 .menu__item { 7197 position: relative; 7198 padding: 0; 7199 margin: 0; 7200 color: rgb(34,34,34); 7201 text-align: left 7202 } 7203 7204 .menu__item--horizontal { 7205 float: left 7206 } 7207 7208 .menu__item--top-level { 7209 float: left; 7210 border-top-width: 3px; 7211 border-top-style: solid; 7212 border-top-color: rgb(228,228,228); 7213 border-bottom-width: 3px; 7214 border-bottom-style: solid; 7215 border-bottom-color: rgb(228,228,228); 7216 text-align: center 7217 } 7218 7219 .menu__link { 7220 display: block; 7221 text-decoration: none; 7222 white-space: nowrap; 7223 padding: 16px .5em; 7224 font-size: 1.6rem; 7225 color: rgb(34,34,34); 7226 float: left; 7227 line-height: 30px 7228 } 7229 7230 .menu__link.menu__link--icon { 7231 margin-bottom: 0; 7232 line-height: 33px; 7233 color: rgb(34,34,34); 7234 position: relative 7235 } 7236 7237 .is-dropdown::after { 7238 font-family: 'Font Awesome 5 Pro','Font Awesome 5 Free'; 7239 font-weight: 900; 7240 content: '\F107'; 7241 display: inline-block; 7242 line-height: 42px; 7243 padding-right: .5em 7244 } 7245 7246 .is-dropdown--no-icon::after { 7247 font-family: ''; 7248 content: ''; 7249 padding: 0 7250 } 7251 7252 .menu-dropdown__item { 7253 display: block; 7254 text-decoration: none; 7255 white-space: nowrap; 7256 color: rgb(34,34,34); 7257 padding: .5em; 7258 line-height: 1.4; 7259 text-align: left 7260 } 7261 7262 .menu__item--mega { 7263 position: static; 7264 text-align: left 7265 } 7266 7267 .mega-menu { 7268 background-color: rgb(246,246,246); 7269 z-index: 10000; 7270 position: absolute; 7271 top: 100%; 7272 left: 1em; 7273 display: none; 7274 box-shadow: rgba(0,0,0,.172549) 0 3px 6px; 7275 width: calc(100% - (2 * 1em)); 7276 max-width: 1280px 7277 } 7278 7279 .mega-menu__list-wrap { 7280 padding: 0 .5em; 7281 margin-bottom: 1em 7282 } 7283 7284 .mega-menu__grid .grid__col-md-3:nth-child(4n) .mega-menu__list-wrap { 7285 border-right-width: 0 7286 } 7287 7288 .mega-menu__header-container { 7289 margin: 0 .5em 7290 } 7291 7292 .mega-menu__header-container__text { 7293 display: block; 7294 text-decoration: none; 7295 font-size: 1.6rem; 7296 color: rgb(34,34,34); 7297 margin-top: 0; 7298 padding: .5em; 7299 line-height: 1.2 7300 } 7301 7302 .is-mega::after { 7303 font-family: 'Font Awesome 5 Pro','Font Awesome 5 Free'; 7304 font-weight: 900; 7305 content: '\F107'; 7306 display: inline-block; 7307 line-height: 42px; 7308 padding-right: .5em; 7309 float: right 7310 } 7311 7312 html, body { 7313 overflow-x: hidden 7314 } 7315 7316 .tools-navigation { 7317 background-color: rgb(255,255,255) 7318 } 7319 7320 .u-full-width { 7321 width: 100%; 7322 max-width: 100% 7323 } 7324 7325 .u-full-max-width { 7326 max-width: 100% 7327 } 7328 7329 .u-flex { 7330 display: -webkit-flex 7331 } 7332 7333 .u-block { 7334 display: block 7335 } 7336 7337 .u-ta-center { 7338 text-align: center 7339 } 7340 7341 .u-color-light { 7342 color: rgb(255,255,255) 7343 } 7344 7345 .u-color-dark { 7346 color: rgb(42,42,42) 7347 } 7348 7349 .u-w380px { 7350 width: 380px 7351 } 7352 7353 .u-min-w220px { 7354 min-width: 220px 7355 } 7356 7357 .u-no-padding { 7358 padding: 0 7359 } 7360 7361 .u-no-margin { 7362 margin: 0 7363 } 7364 7365 .u-margin-top { 7366 margin-top: .5em 7367 } 7368 7369 .u-margin-right { 7370 margin-right: .5em 7371 } 7372 7373 .u-margin-bottom { 7374 margin-bottom: .5em 7375 } 7376 7377 .u-margin-bottom--lg { 7378 margin-bottom: 1em 7379 } 7380 7381 .u-padding { 7382 padding: .5em 7383 } 7384 7385 .u-padding-bottom--lg { 7386 padding-bottom: 1em 7387 } 7388 7389 a { 7390 color: rgb(0,133,202); 7391 text-decoration: none; 7392 word-wrap: break-word 7393 } 7394 7395 h1 { 7396 font-family: Lato,sans-serif; 7397 font-size: 35px; 7398 font-weight: 900; 7399 line-height: 1.2; 7400 color: rgb(0,0,0) 7401 } 7402 7403 h2 { 7404 font-family: Lato,sans-serif; 7405 font-size: 26px; 7406 font-weight: 900; 7407 line-height: 1.2; 7408 color: rgb(51,51,51) 7409 } 7410 7411 body { 7412 font-family: Lato,sans-serif; 7413 font-size: 18px; 7414 line-height: 1.4; 7415 color: rgb(51,51,51) 7416 } 7417 7418 a { 7419 color: rgb(0,168,74) 7420 } 7421 7422 .btn--primary.dw-mod { 7423 color: rgb(255,255,255); 7424 font-size: 15px; 7425 font-weight: 700; 7426 line-height: 36px; 7427 border-width: 1px; 7428 border-color: rgb(0,168,74); 7429 border-top-left-radius: .2rem; 7430 border-top-right-radius: .2rem; 7431 border-bottom-right-radius: .2rem; 7432 border-bottom-left-radius: .2rem; 7433 background-color: rgb(0,168,74) 7434 } 7435 7436 .btn--link.dw-mod { 7437 color: rgb(0,168,74) 7438 } 7439 7440 .center-container.dw-mod { 7441 max-width: 1280px 7442 } 7443 7444 .site.dw-mod { 7445 background-color: rgb(255,255,255) 7446 } 7447 7448 .logo.dw-mod:not(.logo--mobile) { 7449 background-color: transparent 7450 } 7451 7452 .logo__img.dw-mod:not(.logo__img--mobile) { 7453 height: 75px 7454 } 7455 7456 .main-navigation.dw-mod { 7457 background-color: rgb(255,255,255) 7458 } 7459 7460 .menu--dropdown.dw-mod { 7461 background-color: rgb(243,249,245) 7462 } 7463 7464 .is-dropdown.dw-mod::after { 7465 color: rgb(0,0,0); 7466 font-size: 16px; 7467 line-height: 2.4em 7468 } 7469 7470 .menu-dropdown__item.dw-mod { 7471 color: rgb(0,0,0); 7472 font-size: 16px 7473 } 7474 7475 .mega-menu.dw-mod { 7476 background-color: rgb(243,249,245); 7477 max-width: 1280px 7478 } 7479 7480 .mega-menu__header-container__text.dw-mod { 7481 color: rgb(0,166,75); 7482 font-size: 1.6rem; 7483 font-family: Lato,sans-serif; 7484 text-transform: uppercase 7485 } 7486 7487 .is-mega.dw-mod::after { 7488 line-height: 16px; 7489 color: rgb(0,0,0) 7490 } 7491 7492 .menu__link.dw-mod:not(.menu__link--icon) { 7493 font-family: Lato,sans-serif; 7494 font-size: 16px; 7495 font-weight: 700; 7496 line-height: 1.4; 7497 color: rgb(0,0,0); 7498 text-transform: uppercase 7499 } 7500 7501 .menu__link.dw-mod:not(.menu__link--mobile) { 7502 line-height: 75px 7503 } 7504 7505 .menu__link--icon.dw-mod { 7506 color: rgb(0,0,0) 7507 } 7508 7509 .menu__item--top-level { 7510 border-top-width: 3px; 7511 border-top-style: solid; 7512 border-top-color: transparent; 7513 border-bottom-width: 3px; 7514 border-bottom-style: solid; 7515 border-bottom-color: transparent 7516 } 7517 7518 .menu__item--top-level.dw-mod:not(.menu__item--icon) { 7519 padding: 0 7520 } 7521 7522 .menu__item--top-level.dw-mod:first-of-type { 7523 padding-left: 0 7524 } 7525 7526 .tools-navigation.dw-mod { 7527 background-color: rgb(77,96,116); 7528 font-family: Lato,sans-serif; 7529 font-size: 16px; 7530 line-height: 1.4; 7531 color: rgb(255,255,255); 7532 height: 42px; 7533 } 7534 7535 .flag-icon { 7536 background-size: contain; 7537 position: relative; 7538 display: inline-block; 7539 width: 1.33333333em; 7540 line-height: 1.5em; 7541 background-position: 50% 50%; 7542 background-repeat: no-repeat no-repeat 7543 } 7544 7545 .flag-icon::before { 7546 content: '\00a0' 7547 } 7548 7549 /*.flag-icon-de { 7550 background-image: url(../flags/4x3/de.svg) 7551 } 7552 7553 .flag-icon-dk { 7554 background-image: url(../flags/4x3/dk.svg) 7555 }*/ 7556 7557 h1, h2 { 7558 margin-bottom: 12px 7559 } 7560 7561 7562 /*h1, h2 { 7563 font-family: KobenhavnBold,sans-serif 7564 } 7565 7566 body { 7567 font-family: Kobenhavn-Regular,sans-serif 7568 } 7569 7570 a, p, span, input, li, label { 7571 font-family: Kobenhavn-Regular,sans-serif 7572 }*/ 7573 7574 @@font-face { 7575 font-family: font-icons; 7576 font-display: swap; 7577 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') 7578 } 7579 7580 .icon-nz { 7581 position: relative; 7582 top: 1px; 7583 display: inline-block 7584 } 7585 7586 .icon-nz-arrow-long-right, .icon-nz-search { 7587 position: relative; 7588 top: .1em; 7589 display: inline-block 7590 } 7591 7592 .icon-nz-arrow-long-right::before, .icon-nz-search::before { 7593 font-family: font-icons; 7594 font-style: normal; 7595 font-variant: normal; 7596 font-weight: 400; 7597 height: 1em; 7598 line-height: 1em; 7599 speak: none; 7600 text-indent: 0; 7601 text-transform: none; 7602 -webkit-font-smoothing: antialiased 7603 } 7604 7605 .icon-nz-arrow-long-right::before { 7606 content: '\EA06' 7607 } 7608 7609 .icon-nz-search::before { 7610 content: '\EA35' 7611 } 7612 7613 .btn--link.dw-mod { 7614 font-weight: 700; 7615 text-decoration: underline 7616 } 7617 7618 .hero .grid__cell h1 { 7619 font-size: 35px; 7620 color: rgb(255,255,255); 7621 text-transform: uppercase; 7622 font-weight: 700 7623 } 7624 7625 .hero.paragraph-container { 7626 padding: 0; 7627 margin-top: 8rem 7628 } 7629 7630 @@media (min-width:768px) { 7631 .hero.paragraph-container { 7632 margin-top: 10rem 7633 } 7634 } 7635 7636 @@media (min-width:992px) { 7637 .hero.paragraph-container { 7638 margin-top: 12rem 7639 } 7640 } 7641 7642 .hero .paragraph-container--height-xl { 7643 height: 300px 7644 } 7645 7646 @@media (min-width:768px) { 7647 .hero .paragraph-container--height-xl { 7648 height: 470px 7649 } 7650 } 7651 7652 .hero .paragraph-container--height-xl > .paragraph-container { 7653 height: 300px 7654 } 7655 7656 @@media (min-width:768px) { 7657 .hero .paragraph-container--height-xl > .paragraph-container { 7658 height: 470px 7659 } 7660 } 7661 7662 .hero svg { 7663 position: absolute; 7664 left: 0; 7665 bottom: -1px; 7666 width: 100%; 7667 height: auto 7668 } 7669 7670 .footer__content-newsletter input { 7671 border-top-left-radius: 5px; 7672 border-top-right-radius: 5px; 7673 border-bottom-right-radius: 5px; 7674 border-bottom-left-radius: 5px; 7675 border: none; 7676 padding: 7px; 7677 margin-bottom: 0; 7678 line-height: 20px; 7679 background-color: rgb(77,96,116); 7680 color: rgb(255,255,255); 7681 background-position: initial initial; 7682 background-repeat: initial initial 7683 } 7684 7685 .contactform input { 7686 border: none; 7687 border-top-left-radius: 5px; 7688 border-top-right-radius: 5px; 7689 border-bottom-right-radius: 5px; 7690 border-bottom-left-radius: 5px; 7691 resize: none; 7692 padding: 5px 7693 } 7694 7695 .center-container.dw-mod { 7696 max-width: 1440px 7697 } 7698 7699 .multiple-paragraphs-container h1, .multiple-paragraphs-container h2 { 7700 color: inherit 7701 } 7702 7703 @@media (max-width:480px) { 7704 .grid-custom-layout-second { 7705 padding-left: 1rem; 7706 padding-right: 1rem 7707 } 7708 } 7709 7710 @@media (min-width:992px) { 7711 .grid-custom-layout-second { 7712 width: 100%; 7713 margin: 0 auto; 7714 padding-left: 0; 7715 max-width: 1440px 7716 } 7717 } 7718 7719 .grid-custom-layout-second .paragraph-container--full-width.dw-mod { 7720 max-width: 1440px; 7721 width: 100% 7722 } 7723 7724 .menu__link.dw-mod:not(.menu__link--mobile) { 7725 line-height: 0 7726 } 7727 7728 .page { 7729 margin-top: 100px 7730 } 7731 7732 .dropdown { 7733 position: relative; 7734 display: inline-block; 7735 text-align: left 7736 } 7737 7738 .dropdown.dropdown--absolute-position { 7739 list-style: none; 7740 z-index: 70; 7741 background-color: rgb(255,255,255); 7742 position: absolute; 7743 top: 100%; 7744 left: 0; 7745 box-shadow: rgba(0,0,0,.239216) 0 6px 12px; 7746 margin: 0 7747 } 7748 7749 .menu__item--top-level.dw-mod:not(.menu__item--icon) { 7750 margin-right: .8rem 7751 } 7752 7753 .menu__link.dw-mod:not(.menu__link--icon) { 7754 /*font-family: Kobenhavn-Regular,sans-serif;*/ 7755 font-weight: 400 7756 } 7757 7758 .mega-menu.dw-mod { 7759 border-top-width: 1px; 7760 border-top-style: solid; 7761 border-top-color: rgb(191,233,210); 7762 border-bottom-width: 1px; 7763 border-bottom-style: solid; 7764 border-bottom-color: rgb(191,233,210) 7765 } 7766 7767 .mega-menu__header-container.dw-mod { 7768 margin-bottom: 1rem 7769 } 7770 7771 .mega-menu__header-container.dw-mod .mega-menu__header-container__text.dw-mod { 7772 /*font-family: KobenhavnBold,sans-serif;*/ 7773 font-weight: 400; 7774 text-transform: capitalize; 7775 line-height: 30px; 7776 font-size: 22px; 7777 border-bottom-width: 2px; 7778 border-bottom-style: solid; 7779 border-bottom-color: rgb(0,168,74); 7780 padding-left: 0 7781 } 7782 7783 .top-container--sticky.dw-mod { 7784 z-index: 10001 7785 } 7786 7787 @@media (min-width:1200px) { 7788 .top-container--sticky.dw-mod { 7789 z-index: 90 7790 } 7791 } 7792 7793 @@media (min-width:1200px) { 7794 .language-selector-container { 7795 padding-left: 1rem 7796 } 7797 } 7798 7799 .is-mega.dw-mod::after { 7800 content: '' 7801 } 7802 7803 .overlay { 7804 height: 100%; 7805 width: 100%; 7806 display: none; 7807 position: fixed; 7808 z-index: 1; 7809 top: 0; 7810 left: 0; 7811 background-color: rgb(243,249,245); 7812 margin-top: 90px 7813 } 7814 7815 7816 .overlay .menu--dropdown-right { 7817 display: block; 7818 box-shadow: none 7819 } 7820 7821 .overlay .typeahead-search-field.dw-mod { 7822 border: 1px solid rgb(243,249,245) 7823 } 7824 7825 .overlay-content { 7826 position: relative; 7827 top: 5%; 7828 width: 95%; 7829 margin: auto; 7830 text-align: left 7831 } 7832 7833 @@media (min-width:1200px) { 7834 .overlay-content { 7835 width: 70%; 7836 top: 10%; 7837 text-align: center 7838 } 7839 } 7840 7841 .search-field-fullscreen { 7842 max-width: 100% 7843 } 7844 7845 @@media (min-width:1200px) { 7846 .search-field-fullscreen { 7847 padding-right: 20px; 7848 padding-left: 30px 7849 } 7850 } 7851 7852 .fullscreen-input-field.dw-mod { 7853 background-color: rgb(243,249,245); 7854 height: 100px; 7855 color: rgb(0,168,74); 7856 /*font-family: KobenhavnBold,sans-serif;*/ 7857 border: 1px solid rgb(243,249,245); 7858 outline: rgb(0,0,0); 7859 font-size: 2rem; 7860 padding-left: 3rem 7861 } 7862 7863 .fullscreen-input-field.dw-mod::-webkit-input-placeholder { 7864 /*font-family: Kobenhavn-Regular,sans-serif;*/ 7865 color: rgb(163,176,181) 7866 } 7867 7868 @@media (min-width:1200px) { 7869 .fullscreen-input-field.dw-mod { 7870 border-bottom-width: 2px; 7871 border-bottom-style: solid; 7872 border-bottom-color: rgb(116,126,146); 7873 font-size: 3rem; 7874 padding-left: 6rem 7875 } 7876 } 7877 7878 .input-search-icon { 7879 position: absolute; 7880 z-index: 90; 7881 left: -5px; 7882 top: 40% 7883 } 7884 7885 .input-search-icon::before { 7886 font-weight: 700; 7887 font-size: 30px 7888 } 7889 7890 @@media (min-width:1200px) { 7891 .input-search-icon { 7892 left: 10px 7893 } 7894 } 7895 7896 .input-arrow-icon { 7897 position: absolute; 7898 right: 0; 7899 top: 40%; 7900 z-index: 90 7901 } 7902 7903 .input-arrow-icon::before { 7904 font-weight: 700; 7905 font-size: 30px; 7906 color: rgb(0,168,74) 7907 } 7908 7909 .menu__item--icon::before { 7910 content: ''; 7911 height: 100%; 7912 width: 1px; 7913 background-color: rgb(115,125,145); 7914 opacity: .3; 7915 background-position: initial initial; 7916 background-repeat: initial initial 7917 } 7918 7919 .menu__item--icon:last-of-type::after { 7920 content: ''; 7921 height: 100%; 7922 width: 1px; 7923 background-color: rgb(115,125,145); 7924 opacity: .3; 7925 background-position: initial initial; 7926 background-repeat: initial initial 7927 } 7928 7929 .custom-header-menu { 7930 padding-right: 1rem 7931 } 7932 7933 .custom-header-menu .menu__link.menu__link--icon.dw-mod { 7934 padding-top: 1rem 7935 } 7936 7937 .custom-header-menu .menu__link.menu__link--icon.dw-mod .icon-nz { 7938 font-size: 20px 7939 } 7940 7941 @@media (min-width:1200px) { 7942 .custom-header-menu .menu__link.menu__link--icon.dw-mod { 7943 margin-left: 2rem; 7944 margin-right: 2rem 7945 } 7946 } 7947 7948 .u-no-border { 7949 border: none 7950 } 7951 </style> 7952 7953 <!-- Favicon --> 7954 <link href="@favicon" rel="icon" type="image/png"> 7955 7956 <!-- Base (Default, wireframe) styles --> 7957 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css" as="style" media="screen"> 7958 <noscript><link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css"></noscript> 7959 7960 @*<link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css" type="text/css" media="screen">*@ 7961 7962 <!-- Rapido Css from Website Settings --> 7963 <link rel="stylesheet" href="@autoCssLink" as="style" media="screen"> 7964 <noscript><link rel="stylesheet" href="@autoCssLink"></noscript> 7965 7966 @*<link rel="stylesheet" id="rapidoCss" href="@autoCssLink" type="text/css" media="screen">*@ 7967 <link href="~/Files/Templates/Designs/Rapido/css/co3/co3.main.css?v=0.2" rel="stylesheet" /> 7968 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/nz/main.css" as="style" media="screen"> 7969 <noscript><link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/nz/main.css"></noscript> 7970 7971 <!-- Ignite Css (Custom site specific styles) --> 7972 @*<link rel="stylesheet" id="igniteCss" type="text/css" href="/Files/Templates/Designs/Rapido/css/nz/main.css" media="screen">*@ 7973 7974 <!-- Font awesome --> 7975 <link rel="preload" href="@fontAwesomeCssLink" as="style" onload="this.onload=null;this.rel='stylesheet'" media="screen"> 7976 <noscript><link rel="stylesheet" href="@fontAwesomeCssLink"></noscript> 7977 7978 @*<link rel="stylesheet" href="@fontAwesomeCssLink" type="text/css" media="screen">*@ 7979 7980 <!-- Flag icon --> 7981 @*<link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/fonts/flag-icon.min.css" type="text/css" media="screen">*@ 7982 7983 <!-- Google fonts --> 7984 @*@{ 7985 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))); 7986 } 7987 <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet">*@ 7988 @{ 7989 PushPromise(favicon); 7990 PushPromise(fontAwesomeCssLink); 7991 PushPromise("/Files/Templates/Designs/Rapido/css/base/base.min.css"); 7992 PushPromise(autoCssLink); 7993 PushPromise("/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css"); 7994 PushPromise("/Files/Templates/Designs/Rapido/css/nz/main.css"); 7995 PushPromise("/Files/Images/placeholder.gif"); 7996 } 7997 7998 @if (!String.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("AppName"))) 7999 { 8000 <link rel="manifest" href="/Files/Templates/Designs/Rapido/manifest.json"> 8001 PushPromise("/Files/Templates/Designs/Rapido/manifest.json"); 8002 } 8003 @if (!String.IsNullOrEmpty(headerScripts)) 8004 { 8005 @headerScripts 8006 } 8007 @if (!String.IsNullOrEmpty(pageHeaderScripts)) 8008 { 8009 @pageHeaderScripts 8010 } 8011 8012 8013 @*HREF LANG*@ 8014 @{ 8015 List<HypertextReference> References = HypertextReference.GetReferences(Model.Languages, Dynamicweb.Context.Current.Request.Url.ToString()); 8016 } 8017 8018 @if (References.Any()) 8019 { 8020 foreach (HypertextReference reference in References) 8021 { 8022 <link rel="alternate" href='@reference.Url' hreflang='@reference.Culture' /> 8023 } 8024 } 8025 8026 @{ 8027 string businessPhotoPath = Model.Area.Item.GetItem("Settings").GetFile("BusinessPhoto") != null ? Model.Area.Item.GetItem("Settings").GetFile("BusinessPhoto").Path : ""; 8028 var address = Model.Area.Item.GetItem("Settings").GetItem("Address"); 8029 string streetAddress = ""; 8030 string addressLocality = ""; 8031 string addressRegion = ""; 8032 string postalCode = ""; 8033 string addressCountry = ""; 8034 List<string> strings = new List<string>(); 8035 if (address != null) 8036 { 8037 streetAddress = address.GetString("StreetAddress"); 8038 addressLocality = address.GetString("City"); 8039 addressRegion = address.GetString("Region"); 8040 postalCode = address.GetString("PostalCode"); 8041 addressCountry = address.GetString("Country"); 8042 } 8043 string contactEmail = Model.Area.Item.GetItem("Settings").GetString("ContactEmail"); 8044 string contactNumber = Model.Area.Item.GetItem("Settings").GetString("ContactNumber"); 8045 string businessFax = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("BusinessFax"); 8046 string latitude = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("Latitude"); 8047 string longitude = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("Longitude"); 8048 string[] openingHours = Model.Area.Item.GetItem("Settings").GetString("OpeningHours").Split( 8049 new[] { Environment.NewLine }, 8050 StringSplitOptions.None 8051 ); 8052 8053 var currency = Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency(); 8054 string searchParameter = !String.IsNullOrEmpty(HttpContext.Current.Request["Search"]) ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 8055 string areaId = !String.IsNullOrEmpty(HttpContext.Current.Request["Areaid"]) ? HttpContext.Current.Request.QueryString.Get("Areaid") : ""; 8056 int area_id = Model.Area.ID; 8057 string pageType = !String.IsNullOrEmpty(HttpContext.Current.Request["Pagetype"]) ? HttpContext.Current.Request.QueryString.Get("Pagetype") : ""; 8058 string searchFeedId = Converter.ToString(GetPageIdByNavigationTag("ContentSearchFeed")); 8059 string siteUrlWithoutQuery = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 8060 var searchQuery = HttpContext.Current.Request.QueryString.Get("Search"); 8061 } 8062 8063 @if (!string.IsNullOrEmpty(businessName)) 8064 { 8065 <script type="application/ld+json"> 8066 { 8067 "@@context": "http://schema.org", 8068 "@@type": "Store", 8069 "image": [ 8070 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 8071 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 8072 "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath" 8073 ], 8074 "@@id": "@siteURL", 8075 "name": "@businessName", 8076 "address": { 8077 "@@type": "PostalAddress", 8078 "streetAddress": "@streetAddress", 8079 "addressLocality": "@addressLocality", 8080 "addressRegion": "@addressRegion", 8081 "postalCode": "@postalCode", 8082 "addressCountry": "@addressCountry" 8083 } 8084 @if (!string.IsNullOrEmpty(contactEmail)) 8085 { 8086 <text>,"email": "@contactEmail"</text> 8087 } 8088 @if (!string.IsNullOrEmpty(contactNumber)) 8089 { 8090 <text>,"telephone": "@contactNumber"</text> 8091 } 8092 } 8093 </script> 8094 } 8095 8096 @if (area_id == 49) 8097 { 8098 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/danskskovbrug.css" as="style" > 8099 } 8100 8101 @if (siteURL.Contains("hededanmark")) 8102 { 8103 <script type="application/ld+json"> 8104 { 8105 "@@context": "https://schema.org", 8106 "@@type": "Organization", 8107 "name": "@businessName", 8108 "url": "@siteURL", 8109 "aggregateRating": { 8110 "@@type": "AggregateRating", 8111 "ratingValue": "5", 8112 "reviewCount": "2" 8113 }, 8114 8115 @*Social URL link hack from JAA*@ 8116 "sameAs": 8117 [ 8118 @foreach (var socialitem in Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks")) 8119 { 8120 string socialLink = '"' + socialitem.GetString("Link") + '"'; 8121 strings.Add(socialLink); 8122 } 8123 8124 @{ 8125 string joined = string.Join(",", strings); 8126 } 8127 8128 @joined 8129 ] 8130 } 8131 </script> 8132 } 8133 8134 @if (siteURL.Contains("2412")) 8135 { 8136 <script type="application/ld+json"> 8137 { 8138 "@@context": "http://schema.org", 8139 "@@type": "LocalBusiness", 8140 "address": { 8141 "@@type": "PostalAddress", 8142 "streetAddress": "@streetAddress", 8143 "addressLocality": "@addressLocality", 8144 "addressRegion": "@addressRegion", 8145 "postalCode": "@postalCode", 8146 "addressCountry": "@addressCountry" 8147 }, 8148 8149 @if (!string.IsNullOrEmpty(latitude) && !string.IsNullOrEmpty(longitude)) 8150 { 8151 @:"geo": { 8152 @:"@@type": "GeoCoordinates", 8153 @:"latitude": "@latitude", 8154 @:"longitude": "@longitude" 8155 @:}, 8156 } 8157 8158 "sameAs": [ 8159 @{ 8160 IList<ItemViewModel> sameAsUrlsList = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItems("SameAsUrls"); 8161 } 8162 @if (sameAsUrlsList != null && sameAsUrlsList.Any()) 8163 { 8164 foreach (ItemViewModel sameAsUrlListItem in sameAsUrlsList) 8165 { 8166 string sameAsUrl = '"' + sameAsUrlListItem.GetString("Link") + '"'; 8167 strings.Add(sameAsUrl); 8168 } 8169 8170 var joined = string.Join(",", strings); 8171 @joined 8172 } 8173 ], 8174 "description": "@groupMetaDescription", 8175 "name": "@businessName", 8176 "openingHours": [ 8177 @for (int i = 0; i < openingHours.Length; i++) 8178 { 8179 if (i > 0) 8180 {<text> ,</text>} 8181 <text>"@openingHours[i]"</text> 8182 } 8183 ], 8184 @if (!string.IsNullOrEmpty(contactNumber)) 8185 { 8186 <text>"telephone": "@contactNumber",</text> 8187 } 8188 @if (!string.IsNullOrEmpty(businessFax)) 8189 { 8190 <text>"faxNumber": "@businessFax",</text> 8191 } 8192 "image": [ 8193 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 8194 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 8195 "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath" 8196 ], 8197 "priceRange": "$" 8198 } 8199 </script> 8200 } 8201 8202 8203 <script type="application/ld+json"> 8204 @if (String.IsNullOrEmpty(searchParameter)) 8205 { 8206 <text> 8207 { 8208 "@@context": "https://schema.org", 8209 "@@type": "WebSite", 8210 "name": "@businessName", 8211 "url": "@siteUrlWithoutQuery" 8212 } 8213 </text> 8214 } 8215 8216 @if (!String.IsNullOrEmpty(searchParameter)) 8217 { 8218 <text> 8219 { 8220 "@@context": "https://schema.org", 8221 "@@type": "WebSite", 8222 "name": "@businessName", 8223 "url": "@siteUrlWithoutQuery", 8224 "potentialAction": 8225 { 8226 @*Ikke sikker på target valuen er korrekt*@ 8227 "@@type": "SearchAction", 8228 "target": "@siteUrlWithoutQuery/search?search={@searchQuery}", 8229 "query-input": "required name=@searchParameter" 8230 } 8231 } 8232 </text> 8233 } 8234 </script> 8235 8236 <script> 8237 !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); 8238 </script> 8239 8240 @{ 8241 string userAgent = HttpContext.Current.Request.UserAgent; 8242 bool isIe11 = userAgent.Contains("Trident") || HttpContext.Current.Request.QueryString["ie11"] == "true"; 8243 } 8244 8245 @if (isIe11) 8246 { 8247 <div id="ie11-popup"> 8248 <input type="checkbox" id="overlay_8669" class="modal-trigger normal"> 8249 <div class="modal-container animation--fadeIn" id="overlayModalContainer_8669"> 8250 <label for="overlay_8669" class="modal-overlay"></label> 8251 <div class="modal u-brand-color-one--bg u-color-light modal--lg modal-height-full dw-mod fade" id="overlayModal_8669"> 8252 <div class="modal__body modal__body--full u-full-height dw-mod"> 8253 <div class="grid u-full-height"> 8254 <div class="grid__col-12 u-full-height background-image dw-mod" style="background-position: center center; background-size: cover;"> 8255 <div class="u-middle u-padding--lg"> 8256 <h2 class="u-ta-left">@Translate("IE-modal-headline-overlay", "This is Internet Explorer")</h2> 8257 <div class="u-ta-left"> 8258 <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> 8259 </div> 8260 <div class="u-margin-top grid--justify-center u-zindex-1 u-position-relative"></div> 8261 </div> 8262 </div> 8263 </div> 8264 </div> 8265 <label class="modal__close-btn dw-mod" for="overlay_8669"></label> 8266 </div> 8267 </div> 8268 </div> 8269 8270 <div id="ie11-buy-popup"> 8271 <input type="checkbox" id="overlay_ie11_buy" class="modal-trigger normal"> 8272 <div class="modal-container animation--fadeIn" id="overlayModalContainer_ie11-buy"> 8273 <label for="overlay_ie11_buy" class="modal-overlay"></label> 8274 <div class="modal u-brand-color-one--bg u-color-light modal--lg modal-height-full dw-mod fade" id="overlayModal_ie11-buy"> 8275 <div class="modal__body modal__body--full u-full-height dw-mod"> 8276 <div class="grid u-full-height"> 8277 <div class="grid__col-12 u-full-height background-image dw-mod" style="background-position: center center; background-size: cover;"> 8278 <div class="u-middle u-padding--lg"> 8279 <h2 class="u-ta-left">@Translate("IE:Buy.Modal.Title", "This is Internet Explorer")</h2> 8280 <div class="u-ta-left"> 8281 <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> 8282 </div> 8283 <div class="u-margin-top grid--justify-center u-zindex-1 u-position-relative"></div> 8284 </div> 8285 </div> 8286 </div> 8287 </div> 8288 <label class="modal__close-btn dw-mod" for="overlay_ie11_buy"></label> 8289 </div> 8290 </div> 8291 </div> 8292 } 8293 8294 @if (!string.IsNullOrWhiteSpace(FacebookPixelID)) 8295 { 8296 <!-- Facebook Pixel Code --> 8297 <script> 8298 !function(f,b,e,v,n,t,s) 8299 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 8300 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 8301 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 8302 n.queue=[];t=b.createElement(e);t.async=!0; 8303 t.src=v;s=b.getElementsByTagName(e)[0]; 8304 s.parentNode.insertBefore(t,s)}(window, document,'script', 8305 'https://connect.facebook.net/en_US/fbevents.js'); 8306 fbq('init', '@FacebookPixelID'); 8307 fbq('track', 'PageView'); 8308 </script> 8309 <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=@FacebookPixelID&ev=PageView&noscript=1" alt="" /></noscript> 8310 } 8311 @if (area_id == 16) { 8312 <script type="text/javascript"> 8313 _linkedin_partner_id = "602188"; 8314 window._linkedin_data_partner_ids = window._linkedin_data_partner_ids || []; 8315 window._linkedin_data_partner_ids.push(_linkedin_partner_id); 8316 </script> 8317 8318 <script type="text/javascript"> 8319 (function(){var s = document.getElementsByTagName("script")[0]; 8320 var b = document.createElement("script"); 8321 b.type = "text/javascript";b.async = true; 8322 b.src = "https://snap.licdn.com/li.lms-analytics/insight.min.js"; 8323 s.parentNode.insertBefore(b, s);})(); 8324 </script> 8325 } 8326 </head> 8327 8328 <body id="area@(area_id)"> 8329 @if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 8330 { 8331 <!-- Google Tag Manager (noscript) --> 8332 <noscript> 8333 <iframe src="https://www.googletagmanager.com/ns.html?id=@GoogleTagManagerID" 8334 height="0" width="0" style="display:none;visibility:hidden"></iframe> 8335 </noscript> 8336 <!-- End Google Tag Manager (noscript) --> 8337 } 8338 @if ( area_id == 16 ) { 8339 <noscript> 8340 <img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=602188&fmt=gif" /> 8341 </noscript> 8342 } 8343 @if (!String.IsNullOrEmpty(bodyScripts)) 8344 { 8345 @bodyScripts 8346 } 8347 @if (!String.IsNullOrEmpty(pageBodyScripts)) 8348 { 8349 @pageBodyScripts 8350 } 8351 8352 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 8353 @RenderBlockList(masterPage.BlocksRoot.BlocksList) 8354 8355 8356 @RenderSnippet("JavaScript") 8357 8358 @helper RenderMasterHeader() 8359 { 8360 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterHeader").OrderBy(item => item.SortId).ToList(); 8361 bool isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 8362 string stickyTop = "top-container--sticky"; 8363 8364 <header class="header top-container @stickyTop js-header dw-mod" id="Top"> 8365 @RenderBlockList(subBlocks) 8366 </header> 8367 } 8368 8369 @helper RenderMain() 8370 { 8371 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMain").OrderBy(item => item.SortId).ToList(); 8372 8373 <main class="site dw-mod js-content"> 8374 @RenderBlockList(subBlocks) 8375 </main> 8376 } 8377 8378 @helper RenderPageContent() 8379 { 8380 bool isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 8381 string pagePos = isNavigationStickyMenu ? "js-page-pos" : ""; 8382 8383 <div id="Page" class="page @pagePos"> 8384 <section class="center-container content-container dw-mod" id="content"> 8385 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 8386 8387 8388 @{ 8389 string columnClass = "12"; 8390 bool isProductPage = HttpContext.Current.Request.QueryString.Get("ProductID") != null; 8391 string backgroundColorClass = Model.PropertyItem != null && Model.PropertyItem.GetList("BackgroundColor") != null && !isProductPage ? "u-" + Model.PropertyItem.GetList("BackgroundColor").SelectedValue + "--bg" : ""; 8392 } 8393 8394 8395 8396 8397 8398 <div class="grid"> 8399 @if (Model.PropertyItem != null && Model.PropertyItem.GetList("LeftMenu") != null && Model.PropertyItem.GetList("LeftMenu").SelectedValue == "True" && (Pageview.Page.NavigationSettings == null || !Pageview.Page.NavigationSettings.UseEcomGroups)) 8400 { 8401 var navigationMarkup = RenderNavigation(new 8402 { 8403 id = "leftnav", 8404 cssclass = "dwnavigation customer-center-nav", 8405 startLevel = 2, 8406 expandmode = "all", 8407 endlevel = 5, 8408 template = "LeftNavigation.xslt" 8409 }); 8410 8411 if (!string.IsNullOrEmpty(navigationMarkup)) 8412 { 8413 <nav class="grid__col-md-3 customer-center-grid-container"> 8414 <div class="grid__cell"> 8415 @navigationMarkup 8416 </div> 8417 </nav> 8418 columnClass = "9"; 8419 } 8420 } 8421 <div class="grid__col-md-@columnClass grid__col--bleed"> 8422 <div class="grid"> 8423 @Model.Placeholder("dwcontent", "content", "default:true;sort:1") 8424 </div> 8425 </div> 8426 </div> 8427 8428 8429 @* Very small hack to make it cleanly, and easily possible to change the background color on a single page *@ 8430 @if (backgroundColorClass != "") 8431 { 8432 <script> 8433 document.getElementById("Page").classList.add("@backgroundColorClass"); 8434 </script> 8435 } 8436 </section> 8437 </div> 8438 } 8439 <script type="module" src="~/Files/Templates/Designs/Rapido/js/co3/co3.main.js?v=0.2"></script> 8440 @if (isIe11) 8441 { 8442 <script type="text/javascript" src="~/Files/Templates/Designs/Rapido/js/co3/ie11.js"></script> 8443 } 8444 8445 </body> 8446 </html>