Error executing template "Designs/Rapido/_parsed/NZDynamicArticle.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_ac3c44f964ec4b49b0806d496482e510.Execute() in D:\dynamicweb.net\Solutions\S_DW_HD2412\Files\Templates\Designs\Rapido\_parsed\NZDynamicArticle.parsed.cshtml:line 100
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

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