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_ee9316438e3f4f3281f7286d13ed81ee.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 = 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 <div class="icon-nz-nz-facebook links-share" data-sharer="facebook" data-url="@siteURL"></div> 3135 <div class="linkedin icon-nz-nz-linkedin links-share" data-sharer="linkedin" data-url="@siteURL"></div> 3136 <div data-icon-nz="nz-link" class="js-geturl icon-nz-nz-link links-share" aria-label="Copy link"> 3137 <div class="links-input js-show-hide"> 3138 <input class="js-urlCopied"> 3139 </div> 3140 </div> 3141 </div> 3142 </div> 3143 </div> 3144 3145 </section> 3146 } 3147 3148 3149 @* Simple helpers *@ 3150 3151 @*Requires the Gallery ItemType that comes with Rapido*@ 3152 @helper RenderArticleItemGallery(IList<ItemViewModel> gallery) 3153 { 3154 string placeHolderImage = "/Files/Images/placeholder.gif"; 3155 3156 <main class="wrapper grid grid--direction-row"> 3157 <section class="gallery grid__col-lg-9 grid__col-sm-12"> 3158 <div class="swiper-container gallery-top"> 3159 <div class="swiper-wrapper"> 3160 @if (gallery != null && gallery.Count > 0) 3161 { 3162 int count = 1; 3163 3164 foreach (var item in gallery) 3165 { 3166 if (item.GetFile("ImagePath") != null) 3167 { 3168 string focalPointParameters = item.GetFile("ImagePath") != null ? "&" + item.GetFile("ImagePath").GetFocalPointParameters() : ""; 3169 3170 string image = item.GetFile("ImagePath").PathUrlEncoded + focalPointParameters; 3171 int imagesCount = gallery.Count; 3172 string text = item.GetString("Text"); 3173 3174 <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"> 3175 <div class="swiper-text">@text</div> 3176 </div> 3177 3178 count++; 3179 } 3180 } 3181 } 3182 </div> 3183 <div class="swiper-button-next swiper-button-white"></div> 3184 <div class="swiper-button-prev swiper-button-white"></div> 3185 </div> 3186 </section> 3187 @if (gallery != null && gallery.Count > 0) 3188 { 3189 <section class="thumbs grid__col-lg-3 grid__col-sm-12"> 3190 <div class="swiper-container gallery-thumbs"> 3191 <div class="swiper-wrapper"> 3192 @{ 3193 int count = 1; 3194 } 3195 3196 @foreach (var item in gallery) 3197 { 3198 if (item.GetFile("ImagePath") != null) 3199 { 3200 string focalPointParameters = item.GetFile("ImagePath") != null ? "&" + item.GetFile("ImagePath").GetFocalPointParameters() : ""; 3201 3202 string image = item.GetFile("ImagePath").PathUrlEncoded + focalPointParameters; 3203 int imagesCount = gallery.Count; 3204 string text = item.GetString("Text"); 3205 3206 <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" /> 3207 3208 count++; 3209 } 3210 } 3211 </div> 3212 </div> 3213 </section> 3214 } 3215 </main> 3216 3217 } 3218 3219 @helper RenderArticleItemGalleryModal() 3220 { 3221 <!-- Trigger for the gallery modal --> 3222 <input type="checkbox" id="GalleryModalTrigger" class="modal-trigger" /> 3223 3224 <!-- Gallery modal --> 3225 <div class="modal-container"> 3226 <label for="GalleryModalTrigger" id="GalleryModalOverlay" class="modal-overlay"></label> 3227 <div class="modal modal--full" id="GalleryModal"> 3228 <div class="modal__body modal__body--full"> 3229 <div class="gallery-slider"> 3230 <div class="gallery-slider__image"> 3231 <img src="#" alt="" class="modal--full__img" id="FullImage" /> 3232 </div> 3233 <div class="gallery-slider__image-counter" id="FullImage_counter"></div> 3234 <label class="gallery-slider__close-btn" for="GalleryModalTrigger"></label> 3235 <button class="gallery-slider__previous-btn" id="FullImage_prev" onclick="Gallery.prevImage('FullImage')"></button> 3236 <button class="gallery-slider__next-btn" id="FullImage_next" onclick="Gallery.nextImage('FullImage')"></button> 3237 </div> 3238 </div> 3239 </div> 3240 </div> 3241 } 3242 3243 3244 @helper RenderMobileFilters(List<Block> settings) 3245 { 3246 if (settings.Count > 0) 3247 { 3248 <div class="grid__col-12"> 3249 <input type="checkbox" id="CheckFilters" class="js-remember-state u-hidden" data-expand="CheckFilters" /> 3250 <div class="grid u-margin-bottom dw-mod" data-trigger="CheckFilters"> 3251 @RenderBlockList(settings) 3252 </div> 3253 @*<label for="CheckFilters" class="btn btn--primary btn--full dw-mod js-expand-hide" data-trigger="CheckFilters">@Translate("Select filters")</label> 3254 <label for="CheckFilters" class="btn btn--primary btn--full dw-mod expandable--collapsed" data-trigger="CheckFilters">@Translate("Close filters")</label>*@ 3255 </div> 3256 } 3257 } 3258 3259 3260 3261 @if (File.Exists(HttpContext.Current.Server.MapPath("/Components/Custom/Custom__Components.cshtml"))) { 3262 <text>@using Dynamicweb.Rapido.Blocks.Components.General 3263 </text> 3264 } 3265 3266 @* Include the Blocks for the page *@ 3267 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3268 3269 @using System 3270 @using System.Web 3271 @using System.Collections.Generic 3272 @using Dynamicweb.Rapido.Blocks.Extensibility 3273 @using Dynamicweb.Rapido.Blocks 3274 3275 @{ 3276 BlocksPage topSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 3277 3278 Block tagManager = new Block() 3279 { 3280 Id = "TagManager", 3281 SortId = 1, 3282 Template = RenderGoogleTagManager() 3283 }; 3284 3285 Block facebookPixel = new Block() 3286 { 3287 Id = "FacebookPixel", 3288 SortId = 2, 3289 Template = RenderFacebookPixel() 3290 }; 3291 3292 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, tagManager); 3293 topSnippetsBlocksPage.Add(MasterBlockId.MasterTopSnippets, facebookPixel); 3294 } 3295 3296 @helper RenderGoogleTagManager() { 3297 string GoogleTagManagerID = Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID"); 3298 3299 if (!string.IsNullOrWhiteSpace(GoogleTagManagerID)) 3300 { 3301 <script> 3302 (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 3303 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 3304 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 3305 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 3306 })(window,document,'script','dataLayer','@GoogleTagManagerID'); 3307 </script> 3308 <!-- Google Tag Manager (noscript) --> 3309 <noscript> 3310 <iframe src="https://www.googletagmanager.com/ns.html?id=@GoogleTagManagerID" 3311 height="0" width="0" style="display:none;visibility:hidden"></iframe> 3312 </noscript> 3313 <!-- End Google Tag Manager (noscript) --> 3314 } 3315 } 3316 3317 @helper RenderFacebookPixel() { 3318 string FacebookPixelID = Model.Area.Item.GetItem("Settings").GetString("FacebookPixelID"); 3319 3320 if (!string.IsNullOrWhiteSpace(FacebookPixelID)) 3321 { 3322 <!-- Facebook Pixel Code --> 3323 <script> 3324 !function(f,b,e,v,n,t,s) 3325 {if(f.fbq)return;n=f.fbq=function(){n.callMethod? 3326 n.callMethod.apply(n,arguments):n.queue.push(arguments)}; 3327 if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0'; 3328 n.queue=[];t=b.createElement(e);t.async=!0; 3329 t.src=v;s=b.getElementsByTagName(e)[0]; 3330 s.parentNode.insertBefore(t,s)}(window, document,'script', 3331 'https://connect.facebook.net/en_US/fbevents.js'); 3332 fbq('init', '@FacebookPixelID'); 3333 fbq('track', 'PageView'); 3334 </script> 3335 <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=@FacebookPixelID&ev=PageView&noscript=1" alt="" /></noscript> 3336 } 3337 } 3338 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 3339 3340 @using System 3341 @using System.Web 3342 @using System.Collections.Generic 3343 @using Dynamicweb.Rapido.Blocks 3344 @using Dynamicweb.Rapido.Blocks.Extensibility 3345 @using Dynamicweb.Security.UserManagement 3346 @using Dynamicweb.Security.UserManagement.ExternalAuthentication 3347 @{ 3348 BlocksPage loginBlocksPage = BlocksPage.GetBlockPage("Master"); 3349 3350 Block loginModal = new Block() 3351 { 3352 Id = "LoginModal", 3353 SortId = 10, 3354 Template = LoginModal() 3355 }; 3356 3357 loginBlocksPage.Add(MasterBlockId.MasterTopSnippets, loginModal); 3358 } 3359 3360 @helper LoginModal() { 3361 int pageId = Model.TopPage.ID; 3362 string userSignedInError = !Model.LogOnFailed ? "" : "checked"; 3363 string userSignedInErrorText = ""; 3364 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 3365 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 3366 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 3367 3368 if (Model.LogOnFailed) { 3369 switch (Model.LogOnFailedReason) 3370 { 3371 case LogOnFailedReason.PasswordLengthInvalid: 3372 userSignedInErrorText = Translate("Password length is invalid"); 3373 break; 3374 case LogOnFailedReason.IncorrectLogin: 3375 userSignedInErrorText = Translate("Invalid email or password"); 3376 break; 3377 case LogOnFailedReason.ExceededFailedLogOnLimit: 3378 userSignedInErrorText = Translate("You have exceeded the limit of allowed login attempts. The user account is temporarily locked"); 3379 break; 3380 case LogOnFailedReason.LoginLocked: 3381 userSignedInErrorText = Translate("The user account is temporarily locked"); 3382 break; 3383 case LogOnFailedReason.PasswordExpired: 3384 userSignedInErrorText = Translate("The password has expired and needs to be renewed"); 3385 break; 3386 default: 3387 userSignedInErrorText = Translate("An unknown error occured"); 3388 break; 3389 } 3390 } 3391 3392 <!-- Trigger for the login modal --> 3393 <input type="checkbox" id="SignInModalTrigger" class="modal-trigger" @userSignedInError /> 3394 3395 <!-- Login modal --> 3396 <div class="modal-container"> 3397 <label for="SignInModalTrigger" id="SignInModalOverlay" class="modal-overlay"></label> 3398 <div class="modal modal--xs" id="SignInModal"> 3399 <div class="modal__header"> 3400 <div class="heading h2">@Translate("Sign in")</div> 3401 </div> 3402 <div class="modal__body"> 3403 <form method="post" id="LoginForm" class="u-no-margin"> 3404 <input type="hidden" name="ID" value="@pageId" /> 3405 <input type="hidden" name="DWExtranetUsernameRemember" value="True" /> 3406 <input type="hidden" name="DWExtranetPasswordRemember" value="True" /> 3407 <input type="text" class="u-full-width" id="LoginUsername" name="username" placeholder="@Translate("Email")" /> 3408 <input type="password" class="u-full-width" id="LoginPassword" name="password" placeholder="@Translate("Password")" /> 3409 <div class="field-error dw-mod">@userSignedInErrorText</div> 3410 3411 <div class="form__field-group dw-mod"> 3412 <input type="checkbox" id="LoginRememberMe" name="Autologin" checked="checked" value="True" class="form__control"> 3413 <label for="LoginRememberMe"> 3414 @Translate("Remember me", "Remember me") 3415 </label> 3416 </div> 3417 3418 <button type="submit" class="btn btn--primary btn--full dw-mod" name="LoginAction" value="Login" onclick="Buttons.LockButton(event)">@Translate("Sign in")</button> 3419 @{ 3420 ProviderCollection providers = Provider.GetActiveProviders(); 3421 } 3422 3423 @foreach(Provider LoginProvider in providers) 3424 { 3425 var ProviderName = LoginProvider.Name.ToLower(); 3426 <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> 3427 } 3428 3429 <a class="btn btn--link-clean dw-mod" href="@forgotPasswordPageLink">@Translate("Forgot your password?", "Forgot your password?")</a> 3430 3431 <a class="btn btn--link-clean dw-mod" href="/default.aspx?ID=@createAccountPageId">@Translate("Create account")?</a> 3432 </form> 3433 </div> 3434 </div> 3435 </div> 3436 } 3437 3438 @if (Pageview.Device.ToString() == "Mobile" || Pageview.Device.ToString() == "Tablet") { 3439 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3440 3441 @using System 3442 @using System.Web 3443 @using System.Collections.Generic 3444 @using Dynamicweb.Rapido.Blocks.Extensibility 3445 @using Dynamicweb.Rapido.Blocks 3446 3447 3448 @functions { 3449 BlocksPage mobileHeaderBlocksPage = BlocksPage.GetBlockPage("Master"); 3450 } 3451 3452 @{ 3453 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"; 3454 bool hideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 3455 bool hideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 3456 bool hideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 3457 3458 3459 Block mobileHeader = new Block() 3460 { 3461 Id = "MobileTop", 3462 SortId = 10, 3463 Template = RenderMobileTop(), 3464 SkipRenderBlocksList = true 3465 }; 3466 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeader); 3467 3468 Block mobileHeaderNavigation = new Block() 3469 { 3470 Id = "MobileHeaderNavigation", 3471 SortId = 10, 3472 Template = RenderMobileHeaderNavigation(), 3473 SkipRenderBlocksList = true, 3474 BlocksList = new List<Block> { 3475 new Block { 3476 Id = "MobileHeaderNavigationTrigger", 3477 SortId = 10, 3478 Template = RenderMobileHeaderNavigationTrigger() 3479 } 3480 } 3481 }; 3482 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderNavigation); 3483 3484 3485 Block mobileHeaderLogo = new Block() 3486 { 3487 Id = "MobileHeaderLogo", 3488 SortId = 20, 3489 Template = RenderMobileHeaderLogo(), 3490 SkipRenderBlocksList = true 3491 }; 3492 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderLogo); 3493 3494 Block mobileHeaderActions = new Block() 3495 { 3496 Id = "MobileHeaderActions", 3497 SortId = 30, 3498 Template = RenderMobileTopActions(), 3499 SkipRenderBlocksList = true 3500 }; 3501 mobileHeaderBlocksPage.Add("MobileTop", mobileHeaderActions); 3502 3503 if (hideSearch == false) 3504 { 3505 Block mobileHeaderSearch = new Block 3506 { 3507 Id = "MobileHeaderSearch", 3508 SortId = 10, 3509 Template = RenderMobileTopSearch() 3510 }; 3511 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderSearch); 3512 } 3513 3514 Block mobileHeaderMiniCart; 3515 3516 if (!hideCart) 3517 { 3518 mobileHeaderMiniCart = new Block 3519 { 3520 Id = "MobileHeaderMiniCart", 3521 SortId = 20, 3522 Template = RenderMobileTopMiniCart() 3523 }; 3524 3525 Block miniCartCounterScriptTemplate = new Block 3526 { 3527 Id = "MiniCartCounterScriptTemplate", 3528 Template = RenderMobileMiniCartCounterContent() 3529 }; 3530 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", miniCartCounterScriptTemplate); 3531 } else { 3532 mobileHeaderMiniCart = new Block 3533 { 3534 Id = "MobileHeaderMiniCart", 3535 SortId = 20 3536 }; 3537 } 3538 3539 if (!hideSearch) { 3540 Block mobileHeaderSearchBar = new Block() 3541 { 3542 Id = "MobileHeaderSearchBar", 3543 SortId = 30, 3544 Template = RenderMobileTopSearchBar() 3545 }; 3546 mobileHeaderBlocksPage.Add(MasterBlockId.MasterHeader, mobileHeaderSearchBar); 3547 } 3548 3549 switch (mobileTopLayout) 3550 { 3551 case "nav-left": 3552 mobileHeaderNavigation.SortId = 10; 3553 mobileHeaderLogo.SortId = 20; 3554 mobileHeaderActions.SortId = 30; 3555 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 3556 break; 3557 case "nav-right": 3558 mobileHeaderLogo.SortId = 10; 3559 mobileHeaderActions.SortId = 20; 3560 mobileHeaderNavigation.SortId = 30; 3561 mobileHeaderBlocksPage.Add("MobileHeaderActions", mobileHeaderMiniCart); 3562 break; 3563 case "nav-search-left": 3564 mobileHeaderNavigation.SortId = 10; 3565 mobileHeaderLogo.SortId = 20; 3566 mobileHeaderActions.SortId = 30; 3567 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 3568 break; 3569 case "search-left": 3570 mobileHeaderActions.SortId = 10; 3571 mobileHeaderLogo.SortId = 20; 3572 mobileHeaderNavigation.SortId = 30; 3573 mobileHeaderMiniCart.SortId = 0; 3574 mobileHeaderBlocksPage.Add("MobileHeaderNavigation", mobileHeaderMiniCart); 3575 break; 3576 } 3577 } 3578 3579 3580 @helper RenderMobileTop() { 3581 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileTop").OrderBy(item => item.SortId).ToList(); 3582 3583 <nav class="main-navigation-mobile dw-mod"> 3584 <div class="center-container top-container__center-container dw-mod"> 3585 <div class="grid grid--align-center"> 3586 @RenderBlockList(subBlocks) 3587 </div> 3588 </div> 3589 </nav> 3590 } 3591 3592 @helper RenderMobileHeaderNavigation() { 3593 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderNavigation").OrderBy(item => item.SortId).ToList(); 3594 3595 <div class="grid__col-auto-width no-padding-right"> 3596 <ul class="menu dw-mod"> 3597 @RenderBlockList(subBlocks) 3598 </ul> 3599 </div> 3600 } 3601 3602 @helper RenderMobileHeaderNavigationTrigger() { 3603 <li class="menu__item menu__item--horizontal menu__item--top-level menu__item--icon dw-mod"> 3604 <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> 3605 </li> 3606 } 3607 3608 @helper RenderMobileHeaderLogo() { 3609 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderLogo").OrderBy(item => item.SortId).ToList(); 3610 3611 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"; 3612 string centeredLogo = mobileTopLayout != "nav-right" ? "u-ta-center" : ""; 3613 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 3614 string businessName = Model.Area.Item.GetItem("Settings").GetString("BusinessName"); 3615 3616 string mobileLogo = "/Files/Images/logo-dynamicweb.png"; 3617 if (Model.Area.Item.GetItem("Layout").GetItem("MobileTop") != null && Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo") != null) 3618 { 3619 mobileLogo = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetFile("Logo").PathUrlEncoded; 3620 } 3621 3622 if (Path.GetExtension(mobileLogo).ToLower() != ".svg") 3623 { 3624 mobileLogo = "/Admin/Public/GetImage.ashx?height=40&amp;crop=5&amp;Compression=75&amp;image=" + mobileLogo; 3625 } 3626 else 3627 { 3628 mobileLogo = HttpUtility.UrlDecode(mobileLogo); 3629 } 3630 3631 <div class="grid__col-auto grid__col--bleed"> 3632 <div class="grid__cell @centeredLogo"> 3633 <a href="/Default.aspx?ID=@firstPageId" class="logo logo--mobile u-inline-block dw-mod"> 3634 <img class="grid__cell-img logo__img logo__img--mobile dw-mod" src="@mobileLogo" alt="@businessName" /> 3635 </a> 3636 </div> 3637 3638 @RenderBlockList(subBlocks) 3639 </div> 3640 } 3641 3642 @helper RenderMobileTopActions() { 3643 List<Block> subBlocks = this.mobileHeaderBlocksPage.GetBlockListById("MobileHeaderActions").OrderBy(item => item.SortId).ToList(); 3644 3645 <div class="grid__col-auto-width"> 3646 <ul class="menu dw-mod"> 3647 @RenderBlockList(subBlocks) 3648 </ul> 3649 </div> 3650 } 3651 3652 @helper RenderMobileTopSearch() { 3653 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 3654 3655 <li class="menu__item menu__item--horizontal menu__item--top-level dw-mod"> 3656 <div class="menu__link menu__link--icon dw-mod openBtn @(siteURL.Contains("hd2412") ? "hd2412-search-icon" : "hededanmark-search-icon")"> 3657 @* To switch from orange icon and search text - HD2412 *@ 3658 @if (siteURL.Contains("hd2412")) 3659 { 3660 <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> 3661 } 3662 3663 else 3664 { 3665 <span class="closebtn icon-nz icon-nz-search" id="closebtn" title="Close Overlay"></span> 3666 } 3667 </div> 3668 </li> 3669 3670 <script defer> 3671 var clickState = 0; 3672 var btn = document.querySelector('.openBtn'); 3673 3674 btn.addEventListener('click', function () { 3675 3676 if (clickState == 0) { 3677 // code snippet 1 3678 document.getElementById("myOverlay").style.display = "block"; 3679 3680 document.getElementById("closebtn").classList.remove('icon-nz-search'); 3681 document.getElementById("closebtn").classList.add('icon-nz-close'); 3682 document.body.classList.add('no-scroll'); 3683 clickState = 1; 3684 } else { 3685 // code snippet 2 3686 document.getElementById("myOverlay").style.display = "none"; 3687 document.getElementById("closebtn").classList.remove('icon-nz-close'); 3688 document.getElementById("closebtn").classList.add('icon-nz-search'); 3689 document.body.classList.remove('no-scroll'); 3690 3691 clickState = 0; 3692 } 3693 3694 }); 3695 3696 </script> 3697 } 3698 3699 @helper RenderMobileTopMiniCart() { 3700 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 3701 int cartPageId = GetPageIdByNavigationTag("CartPage"); 3702 double cartProductsCount = Model.Cart.TotalProductsCount; 3703 3704 <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')"> 3705 <div class="mini-cart dw-mod"> 3706 <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"> 3707 <div class="u-inline u-position-relative"> 3708 <span class="icon-nz icon-nz-cart dw-mod"></span> 3709 <div class="mini-cart__counter dw-mod"> 3710 <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"> 3711 <div class="js-mini-cart-counter-content"> 3712 @cartProductsCount 3713 </div> 3714 </div> 3715 </div> 3716 </div> 3717 </a> 3718 @if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 3719 { 3720 <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> 3721 } 3722 </div> 3723 </li> 3724 } 3725 3726 @helper RenderMobileTopSearchBar() 3727 { 3728 string searchFeedId = ""; 3729 string searchSecondFeedId = ""; 3730 int groupsFeedId; 3731 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 3732 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 3733 string resultPageLink; 3734 string searchPlaceholder; 3735 string searchType = "product-search"; 3736 string searchTemplate; 3737 string searchContentTemplate = ""; 3738 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 3739 bool showGroups = true; 3740 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 3741 3742 if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "contentSearch") 3743 { 3744 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 3745 resultPageLink = contentSearchPageLink; 3746 searchPlaceholder = Translate("FullscreenSearchText"); 3747 groupsFeedId = 0; 3748 searchType = "content-search"; 3749 searchTemplate = "SearchPagesTemplate"; 3750 showGroups = false; 3751 } 3752 else if (Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue == "combinedSearch") 3753 { 3754 searchFeedId = productsPageId + "&feed=true"; 3755 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true"; 3756 resultPageLink = Converter.ToString(productsPageId); 3757 searchPlaceholder = Translate("Search products or pages"); 3758 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 3759 searchType = "combined-search"; 3760 searchTemplate = "SearchProductsTemplateWrap"; 3761 searchContentTemplate = "SearchPagesTemplateWrap"; 3762 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 3763 } 3764 else 3765 { 3766 resultPageLink = Converter.ToString(productsPageId); 3767 searchFeedId = productsPageId + "&feed=true"; 3768 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"); 3769 searchPlaceholder = Translate("Search products"); 3770 searchTemplate = "SearchProductsTemplate"; 3771 searchType = "product-search"; 3772 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector"); 3773 } 3774 3775 3776 <input type="checkbox" id="MobileSearchTrigger" class="mobile-search-trigger" /> 3777 <div id="myOverlay" class="overlay"> 3778 <div class="overlay-content"> 3779 @if (siteURL.Contains("hededanmark")) 3780 { 3781 3782 3783 <div class="main-navigation-mobile typeahead-mobile dw-mod"> 3784 <div> 3785 <div class="grid"> 3786 <div class="grid__col-auto"> 3787 <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"> 3788 <div id="typeahead-search-field" class="typeahead-search-container-mobile"> 3789 <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"> 3790 <a class="mobile-search-underline-hover"> 3791 <span class="mobile-search-underline"></span> 3792 </a> 3793 <a onclick="window.location.href = '/Default.aspx?ID=@resultPageLink&Search=' + $('input.typeahead.tt-input').val()" class="js-typeahead-link u-color-dark"> 3794 <span class="icon-nz icon-nz-search input-search-icon @(siteURL.Contains("hd2412") ? "orange-text dw-mod" : "")"></span> 3795 </a> 3796 3797 <a onclick="window.location.href = '/Default.aspx?ID=@resultPageLink&Search=' + $('input.typeahead.tt-input').val()" class="js-typeahead-link"> 3798 <span class="icon-nz icon-nz-arrow-long-right input-arrow-icon"></span> 3799 </a> 3800 3801 @if (string.IsNullOrEmpty(searchSecondFeedId)) 3802 { 3803 <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> 3804 } 3805 else 3806 { 3807 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--combined-mobile grid"> 3808 <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> 3809 <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> 3810 </div> 3811 } 3812 </div> 3813 </div> 3814 </div> 3815 3816 </div> 3817 </div> 3818 </div> 3819 } 3820 3821 else 3822 { 3823 <div class="main-navigation-mobile typeahead-mobile dw-mod"> 3824 <div> 3825 <div class="grid"> 3826 <div class="grid__col-auto"> 3827 <div class="typeahead-search-field dw-mod" id="typeahead-search-field"> 3828 <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"> 3829 3830 <a class="mobile-search-underline-hover"> 3831 <span class="mobile-search-underline"></span> 3832 </a> 3833 <a onclick="window.location.href = '/Default.aspx?ID=@resultPageLink&Search=' + $('input.typeahead.tt-input').val()" class="js-typeahead-link u-color-dark"> 3834 <span class="icon-nz icon-nz-search input-search-icon @(siteURL.Contains("hd2412") ? "orange-text dw-mod" : "")"></span> 3835 </a> 3836 3837 <a onclick="window.location.href = '/Default.aspx?ID=@resultPageLink&Search=' + $('input.typeahead.tt-input').val()" class="js-typeahead-link"> 3838 <span class="icon-nz icon-nz-arrow-long-right input-arrow-icon"></span> 3839 </a> 3840 3841 <span class="clerk" 3842 data-template="@("@live-search-mobile")" 3843 data-bind-live-search="#headerSearch" 3844 data-live-search-categories="false" 3845 ></span> 3846 3847 @if (string.IsNullOrEmpty(searchSecondFeedId)) 3848 { 3849 <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> 3850 } 3851 else 3852 { 3853 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--right-aligned"> 3854 <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> 3855 <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> 3856 </div> 3857 } 3858 </div> 3859 </div> 3860 3861 </div> 3862 </div> 3863 </div> 3864 } 3865 </div> 3866 </div> 3867 3868 <script defer> 3869 document.addEventListener("DOMContentLoaded", function (event) { 3870 3871 3872 3873 var bestPictures = new Bloodhound({ 3874 datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), 3875 3876 queryTokenizer: Bloodhound.tokenizers.whitespace, 3877 3878 prefetch: { 3879 url:'/Default.aspx?ID=@searchFeedId', 3880 transform: function (data) { // we modify the prefetch response 3881 var newData = []; // here to match the response format 3882 data.forEach(function (item) { // of the remote endpoint 3883 newData.push({'name': item}); 3884 }); 3885 return newData; 3886 } 3887 }, 3888 3889 remote: { 3890 url: '/Default.aspx?ID=@searchFeedId&Search=%QUERY', 3891 wildcard: '%QUERY' 3892 } 3893 }); 3894 3895 3896 $('#typeahead-search-field .typeahead').typeahead({ 3897 minLength: 1, 3898 highlight: true 3899 }, 3900 { 3901 name: 'name', 3902 display: 'name', 3903 source: bestPictures, 3904 limit: 3, 3905 async: true, 3906 templates: { 3907 empty: [ 3908 '<div class="empty-message">', 3909 '@Translate("Your search gave 0 results")', 3910 '</div>' 3911 ].join('\n'), 3912 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>') 3913 } 3914 3915 }).on('keypress', function(e) { 3916 if (e.which == 13) { 3917 var q = $('input.typeahead.tt-input').val(); 3918 window.location.href = "/Default.aspx?ID=@resultPageLink&Search="+q; 3919 } 3920 }); 3921 }); 3922 3923 </script> 3924 } 3925 3926 @helper RenderMobileMiniCartCounterContent() 3927 { 3928 bool showPrice = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 3929 string counterPosition = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue : "right"; 3930 bool showPriceInMiniCartCounter = Pageview.Device.ToString() != "Mobile" && counterPosition == "right" && showPrice; 3931 3932 <script id="MiniCartCounterContent" type="text/x-template"> 3933 {{#.}} 3934 <div class="js-mini-cart-counter-content dw-mod"> 3935 @if (showPriceInMiniCartCounter) 3936 { 3937 @Translate("Cart")<text>({{numberofproducts}}) {{totalprice}}</text> 3938 } 3939 else 3940 { 3941 <text>{{numberofproducts}}</text> 3942 } 3943 </div> 3944 {{/.}} 3945 </script> 3946 } 3947 3948 3949 3950 3951 </text> 3952 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3953 3954 @using System 3955 @using System.Web 3956 @using System.Collections.Generic 3957 @using Dynamicweb.Rapido.Blocks.Extensibility 3958 @using Dynamicweb.Rapido.Blocks 3959 3960 @functions { 3961 BlocksPage mobileNavigationBlocksPage = BlocksPage.GetBlockPage("Master"); 3962 } 3963 3964 @{ 3965 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 3966 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 3967 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 3968 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 3969 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 3970 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 3971 3972 Block mobileNavigation = new Block() 3973 { 3974 Id = "MobileNavigation", 3975 SortId = 10, 3976 Template = MobileNavigation(), 3977 SkipRenderBlocksList = true 3978 }; 3979 mobileNavigationBlocksPage.Add(MasterBlockId.MasterTopSnippets, mobileNavigation); 3980 3981 if (Model.CurrentUser.ID > 0 && !hideMyProfileLink) 3982 { 3983 Block mobileNavigationSignIn = new Block 3984 { 3985 Id = "MobileNavigationSignIn", 3986 SortId = 10, 3987 Template = RenderMobileNavigationSignIn() 3988 }; 3989 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationSignIn); 3990 } 3991 3992 Block mobileNavigationMenu = new Block 3993 { 3994 Id = "MobileNavigationMenu", 3995 SortId = 20, 3996 Template = RenderMobileNavigationMenu() 3997 }; 3998 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationMenu); 3999 4000 Block mobileNavigationActions = new Block 4001 { 4002 Id = "MobileNavigationActions", 4003 SortId = 30, 4004 Template = RenderMobileNavigationActions(), 4005 SkipRenderBlocksList = true 4006 }; 4007 mobileNavigationBlocksPage.Add("MobileNavigation", mobileNavigationActions); 4008 4009 if (!navigationItemsHideSignIn) 4010 { 4011 if (Model.CurrentUser.ID <= 0) 4012 { 4013 Block mobileNavigationSignInAction = new Block 4014 { 4015 Id = "MobileNavigationSignInAction", 4016 SortId = 10, 4017 Template = RenderMobileNavigationSignInAction() 4018 }; 4019 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignInAction); 4020 4021 if (!hideCreateAccountLink) 4022 { 4023 Block mobileNavigationCreateAccountAction = new Block 4024 { 4025 Id = "MobileNavigationCreateAccountAction", 4026 SortId = 20, 4027 Template = RenderMobileNavigationCreateAccountAction() 4028 }; 4029 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationCreateAccountAction); 4030 } 4031 } 4032 else 4033 { 4034 if (!hideMyOrdersLink) 4035 { 4036 Block mobileNavigationOrdersAction = new Block 4037 { 4038 Id = "MobileNavigationOrdersAction", 4039 SortId = 20, 4040 Template = RenderMobileNavigationOrdersAction() 4041 }; 4042 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationOrdersAction); 4043 } 4044 if (!hideMyFavoritesLink) 4045 { 4046 Block mobileNavigationFavoritesAction = new Block 4047 { 4048 Id = "MobileNavigationFavoritesAction", 4049 SortId = 30, 4050 Template = RenderMobileNavigationFavoritesAction() 4051 }; 4052 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationFavoritesAction); 4053 } 4054 if (!hideMySavedCardsLink) 4055 { 4056 Block mobileNavigationSavedCardsAction = new Block 4057 { 4058 Id = "MobileNavigationFavoritesAction", 4059 SortId = 30, 4060 Template = RenderMobileNavigationSavedCardsAction() 4061 }; 4062 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSavedCardsAction); 4063 } 4064 4065 Block mobileNavigationSignOutAction = new Block 4066 { 4067 Id = "MobileNavigationSignOutAction", 4068 SortId = 40, 4069 Template = RenderMobileNavigationSignOutAction() 4070 }; 4071 mobileNavigationBlocksPage.Add("MobileNavigationActions", mobileNavigationSignOutAction); 4072 } 4073 } 4074 } 4075 4076 4077 @helper MobileNavigation() 4078 { 4079 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigation").OrderBy(item => item.SortId).ToList(); 4080 4081 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 4082 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 4083 int cartFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 4084 string mobileTopDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design") != null ? Model.Area.Item.GetItem("Layout").GetItem("MobileTop").GetList("Design").SelectedValue : "nav-left"; 4085 string position = mobileTopDesign == "nav-left" || mobileTopDesign == "nav-search-left" ? "left" : "right"; 4086 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 4087 string firstUSPLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FirstLink"); 4088 string secondUSPLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("SecondLink"); 4089 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4090 string liClasses = topLayout != "normal" ? "menu__item--top-level" : "menu--clean"; 4091 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4092 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() : ""; 4093 4094 4095 4096 <!-- Trigger for mobile navigation --> 4097 <input type="checkbox" id="MobileNavTrigger" class="mobile-nav-trigger mobile-nav-trigger--@position" autocomplete="off" /> 4098 4099 <!-- Mobile navigation --> 4100 <nav class="mobile-navigation mobile-navigation--@position dw-mod"> 4101 <div class="mobile-navigation__wrapper" id="mobileNavigationWrapper"> 4102 @RenderBlockList(subBlocks) 4103 <ul class="menu menu-mobile dwnavigation"> 4104 @foreach (var link in Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItems("UspLink")) 4105 { 4106 string linkUrl = link.GetString("Link"); 4107 string linkText = link.GetString("LinkText"); 4108 4109 4110 <li class="menu-mobile__item dw-mod"> 4111 <a class="menu-mobile__link dw-mod menu-mobile__link--level-0" href="@linkUrl">@linkText</a> 4112 </li> 4113 4114 } 4115 </ul> 4116 <div class="grid grid--justify-start u-margin-top mobile-usp-bar"> 4117 <div class="grid__col-12"> 4118 <div class="usp-first-link-container-mobile dw-mod"> 4119 4120 <span class="u-color-light">@firstUSPLink</span> 4121 </div> 4122 </div> 4123 <div class="grid__col-8"> 4124 4125 <div class="usp-second-link-container-mobile dw-mod"> 4126 4127 <span class="u-color-light">@secondUSPLink</span> 4128 </div> 4129 </div> 4130 4131 @{ 4132 4133 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 4134 4135 string selectedLanguage = ""; 4136 string langName = ""; 4137 foreach (var lang in Model.Languages) 4138 { 4139 if (lang.IsCurrent) 4140 { 4141 selectedLanguage = lang.Name; 4142 langName = Dynamicweb.Services.Areas.GetArea(lang.ID).DisplayName; 4143 } 4144 } 4145 } 4146 <ul class="menu menu-mobile language-switcher-mobile"> 4147 <li class="menu-mobile__item dw-mod"> 4148 @if (isSlidesDesign) 4149 { 4150 <input id="MobileMenuCheck_Language" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(1);"> 4151 } 4152 else 4153 { 4154 <input id="MobileMenuCheck_Language" type="checkbox" class="expand-trigger"> 4155 } 4156 @foreach (var langnav in Model.Languages) 4157 { 4158 4159 if (langnav.IsCurrent) 4160 { 4161 4162 4163 string langInfonav = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(langnav.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>"; 4164 4165 4166 <div class="menu-mobile__link__wrap"> 4167 <label for="MobileMenuCheck_Language" class="menu-mobile__link menu-mobile__link--highlighted dw-mod"> @langInfonav @Translate("Language")</label> 4168 <label for="MobileMenuCheck_Language" class="menu-mobile__trigger dw-mod"></label> 4169 </div> 4170 4171 } 4172 4173 } 4174 4175 <ul class="menu-mobile menu-mobile__submenu expand-menu"> 4176 @if (isSlidesDesign) 4177 { 4178 <li class="menu-mobile__item dw-mod"> 4179 <div class="menu-mobile__link__wrap"> 4180 <input id="MobileMenuCheck_Language_back" type="radio" class="expand-trigger" name="mobile-menu-level-1" onclick="goToLevel(0);" /> 4181 <label for="MobileMenuCheck_Language_back" class="menu-mobile__trigger menu-mobile__trigger--back"></label> 4182 <label for="MobileMenuCheck_Language_back" class="menu-mobile__link dw-mod ">@Translate("Back")</label> 4183 </div> 4184 </li> 4185 } 4186 @foreach (var lang in Model.Languages) 4187 { 4188 var langNameDropdown = Dynamicweb.Services.Areas.GetArea(lang.ID).DisplayName; 4189 4190 string langInfonav = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>"; 4191 4192 <li class="menu-mobile__item dw-mod"> 4193 <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> 4194 </li> 4195 } 4196 </ul> 4197 </li> 4198 </ul> 4199 </div> 4200 </div> 4201 </nav> 4202 4203 <label class="mobile-nav-trigger-off" for="MobileNavTrigger"></label> 4204 4205 if (!onlyPreview) 4206 { 4207 <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> 4208 } 4209 } 4210 4211 @helper RenderMobileNavigationSignIn() 4212 { 4213 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4214 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4215 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4216 string myProfilePageLink = linkStart + myProfilePageId; 4217 string userName = Model.CurrentUser.FirstName ?? ""; 4218 userName += " " + (Model.CurrentUser.LastName ?? ""); 4219 userName += userName == "" && Model.CurrentUser.UserName != null ? Model.CurrentUser.UserName : ""; 4220 4221 <ul class="menu menu-mobile"> 4222 <li class="menu-mobile__item"> 4223 <a href="@myProfilePageLink" class="menu-mobile__link dw-mod"><span class="icon-nz icon-nz-user dw-mod"></span> @userName</a> 4224 </li> 4225 </ul> 4226 } 4227 4228 @helper RenderMobileNavigationMenu() 4229 { 4230 var isHD2412 = Dynamicweb.Context.Current.Request.QueryString; 4231 bool isSlidesDesign = Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetList("Design").SelectedValue == "Slides"; 4232 string menuTemplate = isSlidesDesign ? "BaseMenuForMobileSlides.xslt" : "BaseMenuForMobileExpandable.xslt"; 4233 string levels = !String.IsNullOrEmpty(Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels")) ? Model.Area.Item.GetItem("Layout").GetItem("MobileNavigation").GetString("Levels") : "3"; 4234 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 4235 int startLevel = renderPagesInToolBar ? 1 : 0; 4236 4237 if (isHD2412.Equals("hd2412")) 4238 { 4239 4240 @RenderNavigation(new 4241 { 4242 id = "mobilenavigation", 4243 cssclass = "menu menu-mobile dwnavigation ecom-mobile-menu", 4244 startLevel = @startLevel, 4245 ecomStartLevel = @startLevel + 1, 4246 endlevel = @levels, 4247 expandmode = "all", 4248 template = @menuTemplate 4249 }) 4250 } 4251 4252 else 4253 { 4254 @RenderNavigation(new 4255 { 4256 id = "mobilenavigation", 4257 cssclass = "menu menu-mobile dwnavigation", 4258 startLevel = @startLevel, 4259 ecomStartLevel = @startLevel + 1, 4260 endlevel = @levels, 4261 expandmode = "all", 4262 template = @menuTemplate 4263 }) 4264 } 4265 4266 if (isSlidesDesign) 4267 { 4268 <script> 4269 function goToLevel(level) { 4270 document.getElementById('mobileNavigationWrapper').style.left = -(level * 100) + "%"; 4271 } 4272 4273 document.addEventListener('DOMContentLoaded', function () { 4274 goToLevel(document.getElementById('mobileNavigationWrapper').querySelectorAll('input[type=radio]:checked').length); 4275 }); 4276 </script> 4277 } 4278 4279 if (renderPagesInToolBar) 4280 { 4281 @RenderNavigation(new 4282 { 4283 id = "topToolsMobileNavigation", 4284 cssclass = "menu menu-mobile dwnavigation", 4285 template = "ToolsMenuForMobile.xslt" 4286 }) 4287 } 4288 } 4289 4290 @helper RenderMobileNavigationActions() 4291 { 4292 List<Block> subBlocks = this.mobileNavigationBlocksPage.GetBlockListById("MobileNavigationActions").OrderBy(item => item.SortId).ToList(); ; 4293 4294 <ul class="menu menu-mobile"> 4295 @RenderBlockList(subBlocks) 4296 </ul> 4297 } 4298 4299 @helper RenderMobileNavigationSignInAction() 4300 { 4301 <li class="menu-mobile__item"> 4302 <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> 4303 </li> 4304 } 4305 4306 @helper RenderMobileNavigationCreateAccountAction() 4307 { 4308 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 4309 4310 <li class="menu-mobile__item"> 4311 <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> 4312 </li> 4313 } 4314 4315 @helper RenderMobileNavigationProfileAction() 4316 { 4317 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4318 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4319 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4320 string myProfilePageLink = linkStart + myProfilePageId; 4321 4322 <li class="menu-mobile__item"> 4323 <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> 4324 </li> 4325 } 4326 4327 @helper RenderMobileNavigationOrdersAction() 4328 { 4329 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4330 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4331 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 4332 string myOrdersPageLink = linkStart + myOrdersPageId; 4333 string ordersIcon = "fas fa-list"; 4334 4335 <li class="menu-mobile__item"> 4336 <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> 4337 </li> 4338 } 4339 4340 @helper RenderMobileNavigationFavoritesAction() 4341 { 4342 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4343 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4344 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 4345 string myFavoritesPageLink = linkStart + myFavoritesPageId; 4346 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"; 4347 4348 4349 <li class="menu-mobile__item"> 4350 <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> 4351 </li> 4352 } 4353 4354 @helper RenderMobileNavigationSavedCardsAction() 4355 { 4356 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4357 string linkStart = Model.CurrentUser.ID <= 0 ? "/Default.aspx?ID=" + signInProfilePageId + "&RedirectPageId=" : "/Default.aspx?ID="; 4358 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 4359 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 4360 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"; 4361 4362 <li class="menu-mobile__item"> 4363 <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> 4364 </li> 4365 } 4366 4367 @helper RenderMobileNavigationSignOutAction() 4368 { 4369 int pageId = Model.TopPage.ID; 4370 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"; 4371 4372 <li class="menu-mobile__item"> 4373 <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> 4374 </li> 4375 } 4376 </text> 4377 } 4378 else { 4379 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4380 4381 @using System 4382 @using System.Web 4383 @using System.Collections.Generic 4384 @using Dynamicweb.Rapido.Blocks.Extensibility 4385 @using Dynamicweb.Rapido.Blocks 4386 4387 @functions { 4388 BlocksPage headerBlocksPage = BlocksPage.GetBlockPage("Master"); 4389 } 4390 4391 @{ 4392 4393 Block masterTools = new Block() 4394 { 4395 Id = "MasterDesktopTools", 4396 SortId = 10, 4397 Template = RenderDesktopTools(), 4398 SkipRenderBlocksList = true, 4399 BlocksList = new List<Block> 4400 { 4401 new Block { 4402 Id = "MasterDesktopToolsText", 4403 SortId = 10, 4404 Template = RenderDesktopToolsText(), 4405 Design = new Design 4406 { 4407 Size = "6", 4408 HidePadding = true, 4409 RenderType = RenderType.Column 4410 } 4411 }, 4412 new Block { 4413 Id = "MasterDesktopToolsNavigation", 4414 SortId = 20, 4415 Template = RenderDesktopToolsNavigation(), 4416 Design = new Design 4417 { 4418 Size = "6", 4419 HidePadding = true, 4420 RenderType = RenderType.Column 4421 } 4422 } 4423 } 4424 }; 4425 headerBlocksPage.Add("MasterHeader", masterTools); 4426 4427 4428 Block masterDesktopExtra = new Block() 4429 { 4430 Id = "MasterDesktopExtra", 4431 SortId = 10, 4432 Template = RenderDesktopExtra(), 4433 SkipRenderBlocksList = true 4434 }; 4435 headerBlocksPage.Add("MasterHeader", masterDesktopExtra); 4436 4437 Block masterDesktopNavigation = new Block() 4438 { 4439 Id = "MasterDesktopNavigation", 4440 SortId = 20, 4441 Template = RenderDesktopNavigation(), 4442 SkipRenderBlocksList = true 4443 }; 4444 headerBlocksPage.Add("MasterHeader", masterDesktopNavigation); 4445 4446 } 4447 4448 @* Include the Blocks for the page *@ 4449 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4450 4451 @using System 4452 @using System.Web 4453 @using Dynamicweb.Rapido.Blocks.Extensibility 4454 @using Dynamicweb.Rapido.Blocks 4455 4456 @{ 4457 Block masterDesktopLogo = new Block 4458 { 4459 Id = "MasterDesktopLogo", 4460 SortId = 10, 4461 Template = RenderDesktopLogo(), 4462 Design = new Design 4463 { 4464 Size = "auto-width", 4465 HidePadding = true, 4466 RenderType = RenderType.Column, 4467 CssClass = "grid--align-self-center" 4468 } 4469 }; 4470 4471 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterDesktopLogo); 4472 } 4473 4474 4475 @helper RenderDesktopLogo() 4476 { 4477 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 4478 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4479 string alignClass = topLayout == "two-lines-centered" || topLayout == "two-lines" ? "grid--align-self-center" : ""; 4480 string logo = Model.Area.Item.GetItem("Layout").GetFile("LogoImage") != null ? Model.Area.Item.GetItem("Layout").GetFile("LogoImage").PathUrlEncoded : "/Files/Images/logo-dynamicweb.png"; 4481 if (Path.GetExtension(logo).ToLower() != ".svg") 4482 { 4483 int logoHeight = Model.Area.Item.GetItem("Layout").GetInt32("LogoHeight"); 4484 logoHeight = logoHeight > 0 && Pageview.Device.ToString() != "Mobile" ? logoHeight : 40; 4485 logo = "/Admin/Public/GetImage.ashx?height=" + Converter.ToString(logoHeight) + "&amp;crop=5&amp;Compression=75&amp;image=" + logo; 4486 } 4487 else 4488 { 4489 logo = HttpUtility.UrlDecode(logo); 4490 } 4491 4492 <div class="logo @alignClass dw-mod"> 4493 <a href="/Default.aspx?ID=@firstPageId" class="logo__img dw-mod u-block"> 4494 <img class="grid__cell-img logo__img dw-mod" src="@logo" alt="@Translate("Logo")" /> 4495 </a> 4496 </div> 4497 } 4498 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4499 4500 @using System 4501 @using System.Web 4502 @using Dynamicweb.Rapido.Blocks.Extensibility 4503 @using Dynamicweb.Rapido.Blocks 4504 4505 @functions { 4506 bool isMegaMenu; 4507 } 4508 4509 @{ 4510 isMegaMenu = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("NavigationMegaMenu") != null ? Converter.ToBoolean(Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("NavigationMegaMenu").SelectedValue) : false; 4511 Block masterDesktopMenu = new Block 4512 { 4513 Id = "MasterDesktopMenu", 4514 SortId = 10, 4515 Template = RenderDesktopMenu(), 4516 Design = new Design 4517 { 4518 Size = "auto", 4519 HidePadding = true, 4520 RenderType = RenderType.Column 4521 } 4522 }; 4523 4524 if (isMegaMenu) 4525 { 4526 masterDesktopMenu.Design.CssClass = "u-reset-position"; 4527 } 4528 4529 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterDesktopMenu); 4530 } 4531 4532 @helper RenderDesktopMenu() 4533 { 4534 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4535 string menuAlignment = topLayout == "minimal-right" ? "grid--align-self-end" : ""; 4536 string megamenuPromotionImage = Model.Area.Item.GetItem("Layout").GetItem("Header").GetFile("MegamenuPromotionImage") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetFile("MegamenuPromotionImage").PathUrlEncoded : ""; 4537 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 4538 bool showOnlyHeaders = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowOnlyHeaders"); 4539 int startLevel = renderPagesInToolBar ? 1 : 0; 4540 4541 string promotionLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("MegamenuPromotionLink"); 4542 4543 <div class="grid__cell u-flex @(isMegaMenu ? "u-reset-position" : "") @menuAlignment"> 4544 @if (!isMegaMenu) 4545 { 4546 @RenderNavigation(new 4547 { 4548 id = "topnavigation", 4549 cssclass = "menu dw-mod dwnavigation u-full-max-width u-flex grid--wrap", 4550 startLevel = startLevel, 4551 ecomStartLevel = startLevel + 1, 4552 endlevel = 5, 4553 expandmode = "all", 4554 template = "BaseMenuWithDropdown.xslt" 4555 }); 4556 } 4557 else 4558 { 4559 @RenderNavigation(new 4560 { 4561 id = "topnavigation", 4562 cssclass = "menu dw-mod dwnavigation u-full-max-width u-flex grid--wrap", 4563 startLevel = startLevel, 4564 ecomStartLevel = startLevel + 1, 4565 endlevel = 5, 4566 promotionImage = megamenuPromotionImage, 4567 promotionLink = promotionLink, 4568 expandmode = "all", 4569 showOnlyHeaders = showOnlyHeaders.ToString().ToLower(), 4570 template = "BaseMegaMenu.xslt" 4571 }); 4572 } 4573 </div> 4574 } 4575 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4576 4577 @using System 4578 @using System.Web 4579 @using Dynamicweb.Rapido.Blocks.Extensibility 4580 @using Dynamicweb.Rapido.Blocks 4581 4582 @{ 4583 Block masterDesktopActionsMenu = new Block 4584 { 4585 Id = "MasterDesktopActionsMenu", 4586 SortId = 10, 4587 Template = RenderDesktopActionsMenu(), 4588 Design = new Design 4589 { 4590 CssClass = "u-flex custom-header-menu" 4591 }, 4592 SkipRenderBlocksList = true 4593 4594 }; 4595 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterDesktopActionsMenu); 4596 4597 if (!string.IsNullOrWhiteSpace(Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonLink"))) 4598 { 4599 Block masterDesktopActionsHeaderButton = new Block 4600 { 4601 Id = "MasterDesktopActionsHeaderButton", 4602 SortId = 60, 4603 Template = RenderHeaderButton() 4604 }; 4605 masterDesktopActionsMenu.Add(masterDesktopActionsHeaderButton); 4606 } 4607 } 4608 4609 @helper RenderDesktopActionsMenu() 4610 { 4611 List<Block> subBlocks = this.headerBlocksPage.GetBlockListById("MasterDesktopActionsMenu").OrderBy(item => item.SortId).ToList(); 4612 4613 <ul class="menu u-flex dw-mod"> 4614 @RenderBlockList(subBlocks) 4615 </ul> 4616 } 4617 4618 @helper RenderHeaderButton() 4619 { 4620 string headerButtonText = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonText"); 4621 string headerButtonLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetString("HeaderButtonLink"); 4622 string headerButtonType = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("HeaderButtonType") != null ? "btn--" + Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("HeaderButtonType").SelectedName.ToLower() : ""; 4623 4624 <li class="menu__item menu__item--horizontal menu--clean dw-mod"> 4625 <a class="btn @headerButtonType dw-mod u-no-margin u-margin-top u-margin-left" href="@headerButtonLink">@headerButtonText</a> 4626 </li> 4627 } 4628 @*@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4629 4630 @using System 4631 @using System.Web 4632 @using Dynamicweb.Core; 4633 @using System.Text.RegularExpressions 4634 @using Dynamicweb.Rapido.Blocks.Extensibility 4635 @using Dynamicweb.Rapido.Blocks 4636 4637 @{ 4638 Block masterDesktopActionsMenuLanguageSelector = new Block 4639 { 4640 Id = "MasterDesktopActionsMenuLanguageSelector", 4641 SortId = 40, 4642 Template = RenderLanguageSelector() 4643 }; 4644 4645 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuLanguageSelector); 4646 } 4647 4648 @helper RenderLanguageSelector() 4649 { 4650 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4651 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu--clean"; 4652 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4653 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() : ""; 4654 4655 if (Model.Languages.Count > 1) 4656 { 4657 <li class="menu__item menu__item--horizontal @liClasses menu__item--icon is-dropdown is-dropdown--no-icon dw-mod"> 4658 <div class="@menuLinkClass dw-mod"> 4659 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("LanguageIcon").SelectedValue fa-1_5x"></i> 4660 </div> 4661 <div class="menu menu--dropdown menu--dropdown-right languages-dropdown dw-mod grid__cell"> 4662 @foreach (var lang in Model.Languages) 4663 { 4664 string langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>" + lang.Name; 4665 string cultureName = Regex.Replace(Dynamicweb.Services.Areas.GetArea(lang.ID).CultureInfo.NativeName, @" ?\(.*?\)", string.Empty); 4666 cultureName = char.ToUpper(cultureName[0]) + cultureName.Substring(1); 4667 4668 if (languageViewType == "flag-culture") 4669 { 4670 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span> " + cultureName; 4671 } 4672 4673 if (languageViewType == "flag") 4674 { 4675 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span>"; 4676 } 4677 4678 if (languageViewType == "name") 4679 { 4680 langInfo = lang.Name; 4681 } 4682 4683 if (languageViewType == "culture") 4684 { 4685 langInfo = cultureName; 4686 } 4687 4688 <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> 4689 } 4690 </div> 4691 </li> 4692 } 4693 }*@ 4694 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4695 4696 @using System 4697 @using System.Web 4698 @using Dynamicweb.Rapido.Blocks.Extensibility 4699 @using Dynamicweb.Rapido.Blocks 4700 4701 @{ 4702 Block masterDesktopActionsMenuSignIn = new Block 4703 { 4704 Id = "MasterDesktopActionsMenuSignIn", 4705 SortId = 20, 4706 Template = RenderSignIn() 4707 }; 4708 4709 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuSignIn); 4710 } 4711 4712 @helper RenderSignIn() 4713 { 4714 bool navigationItemsHideSignIn = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSignIn"); 4715 string userInitials = ""; 4716 int pageId = Model.TopPage.ID; 4717 int createAccountPageId = GetPageIdByNavigationTag("CreateAccount"); 4718 int myDashboardPageId = GetPageIdByNavigationTag("CustomerDashboard"); 4719 int myProfilePageId = GetPageIdByNavigationTag("CustomerProfile"); 4720 int myOrdersPageId = GetPageIdByNavigationTag("CustomerOrders"); 4721 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 4722 int mySavedCardsPageId = GetPageIdByNavigationTag("SavedCards"); 4723 int signInProfilePageId = GetPageIdByNavigationTag("SignInPage"); 4724 bool hideCreateAccountLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideCreateAccount"); 4725 bool hideMyProfileLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideProfile"); 4726 bool hideMyOrdersLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideOrders"); 4727 bool hideMySavedCardsLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideSavedCards"); 4728 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideFavorites"); 4729 bool hideForgotPasswordLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("SignInHideForgotPasswordLink"); 4730 4731 string linkStart = "/Default.aspx?ID="; 4732 if (Model.CurrentUser.ID <= 0) 4733 { 4734 linkStart += signInProfilePageId + "&RedirectPageId="; 4735 } 4736 4737 string forgotPasswordPageLink = "/Default.aspx?ID=" + signInProfilePageId + "&LoginAction=Recovery"; 4738 string myProfilePageLink = linkStart + myProfilePageId; 4739 string myOrdersPageLink = linkStart + myOrdersPageId; 4740 string myFavoritesPageLink = linkStart + myFavoritesPageId; 4741 string mySavedCardsPageLink = linkStart + mySavedCardsPageId; 4742 4743 string profileIcon = "<span class='icon-nz icon-nz-user dw-mod'></span>"; 4744 string favoritesIcon = "<span class='icon-nz icon-nz-star dw-mod'></span>"; 4745 string orderIcon = "<span class='icon-nz icon-nz-cart dw-mod'></span>"; 4746 string cardIcon = "<span class='icon-nz icon-nz-payment dw-mod'></span>"; 4747 4748 if (Model.CurrentUser.ID != 0) 4749 { 4750 if (!String.IsNullOrEmpty(Model.CurrentUser.Name)) 4751 { 4752 string[] names = Model.CurrentUser.Name.Split(' '); 4753 userInitials += Model.CurrentUser.Name.Substring(0, 1); 4754 4755 if (names.Length > 1) 4756 { 4757 userInitials += names[names.Length - 1].Substring(0, 1); 4758 } 4759 } 4760 else 4761 { 4762 userInitials += Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName != "" ? Model.CurrentUser.FirstName.Substring(0, 1) : ""; 4763 userInitials += Model.CurrentUser.LastName != null && Model.CurrentUser.LastName != "" ? Model.CurrentUser.LastName.Substring(0, 1) : ""; 4764 userInitials += userInitials.Length == 1 && Model.CurrentUser.FirstName != null && Model.CurrentUser.FirstName.Length > 1 ? Model.CurrentUser.FirstName.Substring(1, 2) : ""; 4765 userInitials += userInitials == "" && Model.CurrentUser.Email != null && Model.CurrentUser.Email.Length > 1 ? Model.CurrentUser.Email.Substring(0, 2) : ""; 4766 userInitials += userInitials == "" ? Model.CurrentUser.UserName.Substring(0, 2) : ""; 4767 } 4768 } 4769 4770 if (!navigationItemsHideSignIn) 4771 { 4772 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4773 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu__item--clean"; 4774 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4775 4776 <li class="menu__item menu__item--horizontal menu__item menu__item--icon @liClasses is-dropdown is-dropdown--no-icon dw-mod"> 4777 <div class="@menuLinkClass dw-mod"> 4778 @if (Model.CurrentUser.ID <= 0) 4779 { 4780 <span class="icon-nz icon-nz-user dw-mod"></span> 4781 } 4782 else 4783 { 4784 <a href="/default.aspx?ID=@myDashboardPageId" class="u-color-inherit" aria-label="Sign in page"> 4785 <span class="icon-nz icon-nz-user dw-mod"></span> 4786 </a> 4787 4788 } 4789 </div> 4790 <div class="menu menu--dropdown menu--dropdown-right menu--sign-in grid__cell dw-mod"> 4791 <ul class="list list--clean dw-mod"> 4792 @if (Model.CurrentUser.ID <= 0) 4793 { 4794 <li> 4795 <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> 4796 </li> 4797 4798 if (!hideCreateAccountLink) 4799 { 4800 @RenderListItem("/default.aspx?ID=" + createAccountPageId, Translate("Create account")); 4801 } 4802 if (!hideForgotPasswordLink) 4803 { 4804 @RenderListItem(forgotPasswordPageLink, Translate("Forgot your password?")) 4805 } 4806 } 4807 @if (Model.CurrentUser.ID > 0) 4808 { 4809 if (!hideMyProfileLink || !hideMyOrdersLink || !hideMyFavoritesLink || !hideMySavedCardsLink) 4810 { 4811 @RenderSeparator() 4812 } 4813 if (!hideMyProfileLink) 4814 { 4815 @RenderListItem(myProfilePageLink, Translate("My Profile"), profileIcon) 4816 } 4817 if (!hideMyOrdersLink) 4818 { 4819 @RenderListItem(myOrdersPageLink, Translate("My Orders"), orderIcon) 4820 } 4821 if (!hideMyFavoritesLink) 4822 { 4823 @RenderListItem(myFavoritesPageLink, Translate("My Favorites"), favoritesIcon) 4824 } 4825 if (!hideMySavedCardsLink) 4826 { 4827 @RenderListItem(mySavedCardsPageLink, Translate("My Saved cards"), cardIcon) 4828 } 4829 if (Model.CurrentUser.ID > 0) 4830 { 4831 if (!hideMyProfileLink || !hideMyOrdersLink || !hideMyFavoritesLink || !hideMySavedCardsLink) 4832 { 4833 @RenderSeparator() 4834 } 4835 4836 @RenderListItem("/Admin/Public/ExtranetLogoff.aspx?ID=" + pageId, Translate("Sign out")) 4837 } 4838 } 4839 </ul> 4840 </div> 4841 </li> 4842 } 4843 } 4844 4845 @helper RenderListItem(string link, string text, string icon = null) 4846 { 4847 <li> 4848 <a href="@link" class="list__link dw-mod"> 4849 @if (!string.IsNullOrEmpty(icon)) 4850 { 4851 <i class="@icon u-margin-right"></i> 4852 } 4853 @text 4854 </a> 4855 </li> 4856 } 4857 4858 @helper RenderSeparator() 4859 { 4860 <li class="list__seperator dw-mod"></li> 4861 } 4862 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4863 4864 @using System 4865 @using System.Web 4866 @using Dynamicweb.Rapido.Blocks.Extensibility 4867 @using Dynamicweb.Rapido.Blocks 4868 4869 @{ 4870 bool hideMyFavoritesLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideFavorites"); 4871 4872 Block masterDesktopActionsMenuFavorites = new Block 4873 { 4874 Id = "MasterDesktopActionsMenuFavorites", 4875 SortId = 30, 4876 Template = RenderFavorites() 4877 }; 4878 4879 if (!hideMyFavoritesLink && Model.CurrentUser.ID > 0) 4880 { 4881 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuFavorites); 4882 } 4883 } 4884 4885 @helper RenderFavorites() 4886 { 4887 int myFavoritesPageId = GetPageIdByNavigationTag("CustomerFavorites"); 4888 string myFavoritesPageLink = "/Default.aspx?ID=" + myFavoritesPageId; 4889 4890 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4891 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu--clean"; 4892 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4893 4894 @*<li class="menu__item menu__item--horizontal @liClasses menu__item--icon dw-mod"> 4895 <a href="@myFavoritesPageLink" class="@menuLinkClass dw-mod"> 4896 <i class="fas fa-@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("FavoriteIcon").SelectedValue fa-1_5x"></i> 4897 </a> 4898 </li>*@ 4899 } 4900 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 4901 4902 @using System 4903 @using System.Web 4904 @using Dynamicweb.Rapido.Blocks.Extensibility 4905 @using Dynamicweb.Rapido.Blocks 4906 4907 @{ 4908 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 4909 bool hideCart = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideCart"); 4910 string miniCartLayout = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("Layout") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("Layout").SelectedValue : "dropdown"; 4911 4912 if (!onlyPreview && !hideCart) 4913 { 4914 Block masterDesktopActionsMenuMiniCart = new Block 4915 { 4916 Id = "MasterDesktopActionsMenuMiniCart", 4917 SortId = 50, 4918 Template = RenderMiniCart(miniCartLayout == "dropdown"), 4919 SkipRenderBlocksList = true, 4920 BlocksList = new List<Block>() 4921 }; 4922 4923 Block miniCartCounterScriptTemplate = new Block 4924 { 4925 Id = "MiniCartCounterScriptTemplate", 4926 Template = RenderMiniCartCounterContent() 4927 }; 4928 4929 //dropdown layout is default 4930 RazorEngine.Templating.TemplateWriter layoutTemplate = RenderMiniCartDropdownLayout(); 4931 RazorEngine.Templating.TemplateWriter miniCartTriggerTemplate = RenderMiniCartTriggerLink(); 4932 4933 switch (miniCartLayout) 4934 { 4935 case "panel": 4936 layoutTemplate = RenderMiniCartPanelLayout(); 4937 miniCartTriggerTemplate = RenderMiniCartTriggerLabel(); 4938 break; 4939 case "modal": 4940 layoutTemplate = RenderMiniCartModalLayout(); 4941 miniCartTriggerTemplate = RenderMiniCartTriggerLabel(); 4942 break; 4943 } 4944 4945 masterDesktopActionsMenuMiniCart.BlocksList.Add(new Block 4946 { 4947 Id = "MiniCartTrigger", 4948 Template = miniCartTriggerTemplate 4949 }); 4950 4951 if (Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet") 4952 { 4953 masterDesktopActionsMenuMiniCart.BlocksList.Add(new Block 4954 { 4955 Id = "MiniCartLayout", 4956 Template = layoutTemplate 4957 }); 4958 } 4959 4960 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuMiniCart); 4961 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", miniCartCounterScriptTemplate); 4962 } 4963 } 4964 4965 @helper RenderMiniCart(bool hasMouseEnterEvent) 4966 { 4967 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterDesktopActionsMenuMiniCart").OrderBy(item => item.SortId).ToList(); 4968 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4969 string liClasses = topLayout != "normal" ? "menu__item--top-level" : "menu--clean"; 4970 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 4971 string mouseEvent = ""; 4972 string id = "MiniCart"; 4973 if (hasMouseEnterEvent) { 4974 mouseEvent = "onmouseenter=\"Cart.UpdateMiniCart('miniCartTrigger', 'miniCart', 'cartCounter', '/Default.aspx?ID=" + miniCartFeedPageId + "&feedType=MiniCart')\""; 4975 id = "miniCartTrigger"; 4976 } 4977 <li class="menu__item menu__item--horizontal menu__item--icon @liClasses dw-mod" id="@id" @mouseEvent> 4978 @RenderBlockList(subBlocks) 4979 </li> 4980 } 4981 4982 @helper RenderMiniCartTriggerLabel() 4983 { 4984 int cartPageId = GetPageIdByNavigationTag("CartPage"); 4985 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fa fa-cart"; 4986 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 4987 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 4988 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 4989 4990 <div class="@menuLinkClass dw-mod js-mini-cart-button" onclick="Cart.UpdateMiniCart('miniCartTrigger', 'miniCart', 'cartCounter', '/Default.aspx?ID=@miniCartFeedPageId&feedType=MiniCart');"> 4991 <div class="u-inline u-position-relative"> 4992 @*<i class="@cartIcon fa-1_5x"></i>*@ 4993 <span class="icon-nz icon-nz-cart dw-mod"></span> 4994 @RenderMiniCartCounter() 4995 </div> 4996 </div> 4997 } 4998 4999 @helper RenderMiniCartTriggerLink() 5000 { 5001 int cartPageId = GetPageIdByNavigationTag("CartPage"); 5002 string cartIcon = Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon") != null ? Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue : "fa fa-cart"; 5003 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 5004 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 5005 5006 <a href="/Default.aspx?ID=@cartPageId&Purge=True" class="@menuLinkClass menu__item--icon dw-mod js-mini-cart-button"> 5007 <div class="u-inline u-position-relative"> 5008 @*<i class="@cartIcon fa-1_5x"></i>*@ 5009 <span class="icon-nz icon-nz-cart dw-mod"></span> 5010 @RenderMiniCartCounter() 5011 </div> 5012 </a> 5013 } 5014 5015 @helper RenderMiniCartCounter() 5016 { 5017 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 5018 string cartProductsCount = Model.Cart.TotalProductsCount.ToString(); 5019 string counterPosition = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue : "right"; 5020 bool showPrice = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 5021 string cartProductsTotalPrice = showPrice && Model.Cart.TotalPrice != null ? Model.Cart.TotalPrice.Price.Formatted : ""; 5022 cartProductsTotalPrice = counterPosition == "right" ? cartProductsTotalPrice : ""; 5023 5024 if (showPrice && counterPosition == "right") 5025 { 5026 cartProductsCount = Translate("Cart") + "(" + cartProductsCount + ")"; 5027 } 5028 5029 <div class="mini-cart__counter dw-mod"> 5030 <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"> 5031 <div class="js-mini-cart-counter-content" data-count="@Model.Cart.TotalProductsCount.ToString()"> 5032 @cartProductsCount 5033 @cartProductsTotalPrice 5034 </div> 5035 </div> 5036 </div> 5037 } 5038 5039 @helper RenderMiniCartCounterContent() 5040 { 5041 bool showPrice = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetBoolean("ShowPrice"); 5042 string counterPosition = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("CounterPosition").SelectedValue : "right"; 5043 bool showPriceInMiniCartCounter = Pageview.Device.ToString() != "Mobile" && counterPosition == "right" && showPrice; 5044 5045 <script id="MiniCartCounterContent" type="text/x-template"> 5046 {{#.}} 5047 <div class="js-mini-cart-counter-content dw-mod" data-count="{{numberofproducts}}"> 5048 @if (showPriceInMiniCartCounter) 5049 { 5050 @Translate("Cart")<text>({{numberofproducts}}) {{totalprice}} @Translate("{{currency}}")</text> 5051 } 5052 else 5053 { 5054 <text>{{numberofproducts}}</text> 5055 } 5056 </div> 5057 {{/.}} 5058 </script> 5059 } 5060 5061 @helper RenderMiniCartDropdownLayout() 5062 { 5063 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 5064 5065 <div class="mini-cart mini-cart-dropdown js-mini-cart grid__cell dw-mod" id="miniCart" data-cart-id="@miniCartFeedPageId" data-show-type="dropdown"> 5066 <div class="mini-cart-dropdown__inner dw-mod"> 5067 <h3 class="u-ta-center dw-mod">@Translate("Shopping cart")</h3> 5068 <div class="mini-cart-dropdown__body u-flex dw-mod"> 5069 <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> 5070 </div> 5071 </div> 5072 </div> 5073 } 5074 5075 @helper RenderMiniCartPanelLayout() 5076 { 5077 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 5078 5079 <div class="mini-cart grid__cell dw-mod"> 5080 <input type="checkbox" id="miniCartTrigger" class="panel-trigger" /> 5081 <div class="panel panel--right panel--with-close-btn dw-mod js-mini-cart" id="miniCart" data-cart-id="@miniCartFeedPageId" data-show-type="block"> 5082 <label for="miniCartTrigger" class="panel__close-btn" title="@Translate("Close panel")"><i class="fas fa-times"></i></label> 5083 <div class="panel__content u-full-width dw-mod"> 5084 <div class="heading h4 panel__header dw-mod u-margin-bottom">@Translate("Shopping cart")</div> 5085 <div class="panel__content-body panel__content-body--cart dw-mod"> 5086 <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> 5087 </div> 5088 </div> 5089 </div> 5090 </div> 5091 } 5092 5093 @helper RenderMiniCartModalLayout() 5094 { 5095 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 5096 <div class="mini-cart grid__cell dw-mod"> 5097 <input type="checkbox" id="miniCartTrigger" class="modal-trigger" autocomplete="off" /> 5098 <div class="modal-container dw-mod js-mini-cart" id="miniCart" data-cart-id="@miniCartFeedPageId" data-show-type="block"> 5099 <label for="miniCartTrigger" class="modal-overlay"></label> 5100 <div class="modal modal--top-right dw-mod"> 5101 <div class="modal__body u-flex grid--direction-column dw-mod"> 5102 <h3 class="dw-mod u-ta-center">@Translate("Shopping cart")</h3> 5103 <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> 5104 </div> 5105 <label class="modal__close-btn modal__close-btn--clean dw-mod" for="miniCartTrigger" title="@Translate("Close modal")"></label> 5106 </div> 5107 </div> 5108 </div> 5109 } 5110 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5111 5112 @using System 5113 @using System.Web 5114 @using Dynamicweb.Rapido.Blocks.Extensibility 5115 @using Dynamicweb.Rapido.Blocks 5116 5117 @{ 5118 bool showDownloadCartLink = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowDownloadCart"); 5119 5120 Block masterDesktopActionsMenuDownloadCart = new Block 5121 { 5122 Id = "MasterDesktopActionsMenuDownloadCart", 5123 SortId = 35, 5124 Template = RenderDownloadCart() 5125 }; 5126 5127 if (showDownloadCartLink && Model.CurrentUser.ID > 0) 5128 { 5129 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterDesktopActionsMenuDownloadCart); 5130 } 5131 } 5132 5133 @helper RenderDownloadCart() 5134 { 5135 int downloadCartPageId = GetPageIdByNavigationTag("DownloadCart"); 5136 string downloadCartPageLink = "/Default.aspx?ID=" + downloadCartPageId; 5137 5138 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 5139 string liClasses = topLayout != "normal" ? "menu__item--top-level u-hidden-xxs" : "menu--clean"; 5140 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 5141 5142 <li class="menu__item menu__item--horizontal @liClasses menu__item--icon dw-mod"> 5143 <a href="@downloadCartPageLink" class="@menuLinkClass dw-mod"> 5144 <i class="fas fa-cart-arrow-down fa-1_5x"></i> 5145 </a> 5146 </li> 5147 } 5148 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5149 5150 @using Dynamicweb.Rapido.Blocks.Extensibility 5151 @using Dynamicweb.Frontend.Devices 5152 @using Dynamicweb.Extensibility 5153 @using Dynamicweb.Content 5154 @using Dynamicweb.Core 5155 @using System 5156 @using System.IO 5157 @using System.Web 5158 @using System.Collections.Generic; 5159 @using System.Linq 5160 @using System.Text.RegularExpressions 5161 @using Dynamicweb.Admin.dk.dynamicweb.templates 5162 @using Dynamicweb.Ecommerce.Frontend 5163 @using Dynamicweb.Rapido.Blocks 5164 @using Dynamicweb.Rendering 5165 5166 @functions { 5167 public class SearchConfiguration 5168 { 5169 public string searchFeedId { get; set; } 5170 public string searchSecondFeedId { get; set; } 5171 public int groupsFeedId { get; set; } 5172 public string resultPageLink { get; set; } 5173 public string searchPlaceholder { get; set; } 5174 public string searchType { get; set; } 5175 public string searchTemplate { get; set; } 5176 public string searchContentTemplate { get; set; } 5177 public string searchValue { get; set; } 5178 public bool showGroups { get; set; } 5179 5180 public SearchConfiguration() 5181 { 5182 searchFeedId = ""; 5183 searchSecondFeedId = ""; 5184 searchType = "product-search"; 5185 searchContentTemplate = ""; 5186 showGroups = true; 5187 } 5188 } 5189 } 5190 @{ 5191 Block masterSearchBar = new Block 5192 { 5193 Id = "MasterSearchBar", 5194 SortId = 40, 5195 Template = RenderSearch("bar"), 5196 Design = new Design 5197 { 5198 Size = "auto", 5199 HidePadding = true, 5200 RenderType = RenderType.Column 5201 } 5202 }; 5203 5204 Block masterSearchAction = new Block 5205 { 5206 Id = "MasterDesktopActionsMenuSearch", 5207 SortId = 10, 5208 Template = RenderSearch() 5209 }; 5210 5211 BlocksPage.GetBlockPage("Master").Add("MasterHeader", masterSearchBar); 5212 BlocksPage.GetBlockPage("Master").Add("MasterDesktopActionsMenu", masterSearchAction); 5213 5214 } 5215 5216 @helper RenderSearch(string type = "mini-search") 5217 { 5218 string productsPageId = Converter.ToString(GetPageIdByNavigationTag("ProductsPage")); 5219 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 5220 string searchType = Model.Area.Item.GetItem("Layout").GetList("TopSearch") != null ? Model.Area.Item.GetItem("Layout").GetList("TopSearch").SelectedValue : "productSearch"; 5221 5222 SearchConfiguration searchConfiguration = null; 5223 5224 switch (searchType) 5225 { 5226 case "contentSearch": 5227 searchConfiguration = new SearchConfiguration() 5228 { 5229 searchFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true", 5230 resultPageLink = contentSearchPageLink, 5231 searchPlaceholder = Translate("FullscreenSearchText"), 5232 groupsFeedId = 0, 5233 searchType = "content-search", 5234 searchTemplate = "SearchPagesTemplate", 5235 showGroups = false 5236 }; 5237 break; 5238 case "combinedSearch": 5239 searchConfiguration = new SearchConfiguration() 5240 { 5241 searchFeedId = productsPageId + "&feed=true", 5242 searchSecondFeedId = GetPageIdByNavigationTag("ContentSearchFeed") + "&Areaid=" + Model.Area.ID + "&pagesOnly=true", 5243 resultPageLink = Converter.ToString(productsPageId), 5244 searchPlaceholder = Translate("Search products or pages"), 5245 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"), 5246 searchType = "combined-search", 5247 searchTemplate = "SearchProductsTemplateWrap", 5248 searchContentTemplate = "SearchPagesTemplateWrap", 5249 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector") 5250 }; 5251 break; 5252 default: //productSearch 5253 searchConfiguration = new SearchConfiguration() 5254 { 5255 resultPageLink = Converter.ToString(productsPageId), 5256 searchFeedId = productsPageId + "&feed=true", 5257 groupsFeedId = GetPageIdByNavigationTag("ProductGroupsFeed"), 5258 searchPlaceholder = Translate("Search products"), 5259 searchTemplate = "SearchProductsTemplate", 5260 searchType = "product-search", 5261 showGroups = Model.Area.Item.GetItem("Layout").GetBoolean("ShowGroupsSelector") 5262 }; 5263 break; 5264 } 5265 searchConfiguration.searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 5266 5267 if (type == "mini-search") 5268 { 5269 @RenderMiniSearch(searchConfiguration) 5270 } 5271 else 5272 { 5273 @RenderSearchBar(searchConfiguration) 5274 } 5275 } 5276 5277 @helper RenderSearchBar(SearchConfiguration options) 5278 { 5279 var currentUrl = HttpContext.Current.Request.Url.ToString(); 5280 if (!currentUrl.Contains("hd2412")) 5281 { 5282 <div class="typeahead typeahead--centered u-color-inherit js-typeahead dw-mod" id="ProductSearchBar" 5283 data-page-size="7" 5284 data-search-feed-id="@options.searchFeedId" 5285 data-search-second-feed-id="@options.searchSecondFeedId" 5286 data-result-page-id="@options.resultPageLink" 5287 data-groups-page-id="@options.groupsFeedId" 5288 data-search-type="@options.searchType"> 5289 @if (options.showGroups) 5290 { 5291 <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> 5292 <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> 5293 } 5294 <div class="typeahead-search-field"> 5295 <input type="text" class="u-no-margin u-full-width u-full-height js-typeahead-search-field" placeholder="@options.searchPlaceholder" value="@options.searchValue"> 5296 @if (string.IsNullOrEmpty(options.searchSecondFeedId)) 5297 { 5298 <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> 5299 } 5300 else 5301 { 5302 <div class="dropdown dropdown--absolute-position dropdown--combined grid"> 5303 <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> 5304 <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> 5305 </div> 5306 } 5307 </div> 5308 <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> 5309 </div> 5310 } 5311 } 5312 5313 @helper RenderMiniSearch(SearchConfiguration options) 5314 { 5315 5316 string searchValue = HttpContext.Current.Request.QueryString.Get("Search") ?? ""; 5317 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 5318 5319 5320 <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()"> 5321 <a class="openBtn @(siteURL.Contains("hd2412") ? "hd2412-search-icon" : "")"> 5322 <div class="menu__link menu__link--icon dw-mod"> 5323 @* To switch from orange icon and search text - HD2412 *@ 5324 @if (siteURL.Contains("hd2412")) 5325 { 5326 <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> 5327 } 5328 5329 else 5330 { 5331 <span class="closebtn icon-nz icon-nz-search" id="closebtn" title="Close Overlay"></span> 5332 } 5333 5334 </div> 5335 </a> 5336 <div id="myOverlay" class="overlay"> 5337 <div class="overlay-content"> 5338 @if (!siteURL.Contains("hd2412")) 5339 { 5340 <div class="menu menu--dropdown menu--dropdown-right u-no-padding u-w380px grid__cell dw-mod"> 5341 <div class="typeahead js-typeahead search-field-fullscreen" id="ProductSearchBar" 5342 data-page-size="7" 5343 data-search-feed-id="@options.searchFeedId" 5344 data-search-second-feed-id="@options.searchSecondFeedId" 5345 data-result-page-id="@options.resultPageLink" 5346 data-search-type="@options.searchType"> 5347 <div class="typeahead-search-field dw-mod" id="typeahead-search-field"> 5348 5349 <input type="text" class="u-no-margin u-full-width js-search-input js-typeahead-search-field typeahead fullscreen-input-field @(siteURL.Contains("hd2412") ? "orange-text" : "") dw-mod" id="headerSearch" placeholder="@options.searchPlaceholder" value="@options.searchValue"> 5350 5351 <a id="btnSearch" onclick="window.location.href='/Default.aspx?ID=@options.resultPageLink&Search=' + $('input.typeahead.tt-input').val()" class="js-typeahead-link js-search-link u-color-dark"> 5352 <span class="icon-nz icon-nz-search input-search-icon @(siteURL.Contains("hd2412") ? "orange-text dw-mod" : "")"></span> 5353 </a> 5354 5355 <a id="btnSearch" onclick="window.location.href='/Default.aspx?ID=@options.resultPageLink&Search=' + $('input.typeahead.tt-input').val()" class="js-typeahead-link js-search-link"> 5356 <span class="icon-nz icon-nz-arrow-long-right input-arrow-icon"></span> 5357 </a> 5358 5359 5360 @if (string.IsNullOrEmpty(options.searchSecondFeedId)) 5361 { 5362 <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> 5363 } 5364 else 5365 { 5366 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--right-aligned"> 5367 <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> 5368 <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> 5369 </div> 5370 } 5371 </div> 5372 </div> 5373 </div> 5374 } 5375 5376 //CLERK SEARCH BAR - HD2412 5377 else 5378 { 5379 5380 <div class="menu menu--dropdown menu--dropdown-right u-no-padding u-w380px grid__cell dw-mod"> 5381 5382 <div class="typeahead-search-field dw-mod" id="typeahead-search-field"> 5383 5384 <input type="text" class="u-no-margin u-full-width js-search-input fullscreen-input-field dw-mod" id="headerSearch" placeholder="@options.searchPlaceholder" value="@options.searchValue"> 5385 5386 <a id="btnSearch" onclick="window.location.href = '/Default.aspx?ID=@options.resultPageLink&Search=' + $('#headerSearch').val()" class="js-typeahead-link js-search-link u-color-dark"> 5387 <span class="icon-nz icon-nz-search input-search-icon"></span> 5388 </a> 5389 <a id="btnSearch" onclick="window.location.href = '/Default.aspx?ID=@options.resultPageLink&Search=' + $('#headerSearch').val()" class="js-typeahead-link js-search-link"> 5390 <span class="icon-nz icon-nz-arrow-long-right input-arrow-icon"></span> 5391 </a> 5392 5393 <span class="clerk" 5394 data-template="@( "@live-search")" 5395 data-bind-live-search="#headerSearch" 5396 data-live-search-categories="false" 5397 data-after-render="_clerk_after_load_event"></span> 5398 5399 @if (string.IsNullOrEmpty(options.searchSecondFeedId)) 5400 { 5401 <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> 5402 } 5403 else 5404 { 5405 <div class="dropdown dropdown--absolute-position dropdown--combined grid dropdown--right-aligned"> 5406 <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> 5407 <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> 5408 </div> 5409 } 5410 </div> 5411 </div> 5412 5413 <script type="text/javascript"> 5414 function _clerk_after_load_event(data) { 5415 jQuery(".js-search-more-products").html("@Translate("View all")"); 5416 jQuery(".js-search-more-products").off('click'); 5417 jQuery(".js-search-more-products").on("click", function() { 5418 window.location.href = '/Default.aspx?ID=@options.resultPageLink&Search=' + 5419 $('#headerSearch').val(); 5420 return false; 5421 }); 5422 5423 5424 } 5425 5426 </script> 5427 } 5428 </div> 5429 </div> 5430 </li> 5431 5432 5433 <script defer> 5434 var clickState = 0; 5435 var btn = document.querySelector('.openBtn'); 5436 5437 btn.addEventListener('click', function () { 5438 5439 if (clickState == 0) { 5440 // code snippet 1 5441 document.getElementById("myOverlay").style.display = "block"; 5442 document.getElementById("closebtn").classList.remove('icon-nz-search'); 5443 document.getElementById("closebtn").classList.add('icon-nz-close'); 5444 document.body.classList.add('no-scroll'); 5445 clickState = 1; 5446 } else { 5447 // code snippet 2 5448 document.getElementById("myOverlay").style.display = "none"; 5449 document.getElementById("closebtn").classList.remove('icon-nz-close'); 5450 document.getElementById("closebtn").classList.add('icon-nz-search'); 5451 document.body.classList.remove('no-scroll'); 5452 5453 clickState = 0; 5454 } 5455 5456 }); 5457 5458 </script> 5459 5460 if (!siteURL.Contains("hd2412")) 5461 { 5462 5463 <script defer> 5464 document.addEventListener("DOMContentLoaded", function (event) { 5465 5466 var bestPictures = new Bloodhound({ 5467 datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), 5468 5469 queryTokenizer: Bloodhound.tokenizers.whitespace, 5470 5471 prefetch: { 5472 url:'/Default.aspx?ID=@options.searchFeedId', 5473 transform: function (data) { // we modify the prefetch response 5474 var newData = []; // here to match the response format 5475 data.forEach(function (item) { // of the remote endpoint 5476 newData.push({'name': item}); 5477 }); 5478 return newData; 5479 } 5480 }, 5481 5482 remote: { 5483 url: '/Default.aspx?ID=@options.searchFeedId&Search=%QUERY', 5484 wildcard: '%QUERY' 5485 } 5486 }); 5487 5488 5489 $('#typeahead-search-field .typeahead').typeahead({ 5490 minLength: 1, 5491 highlight: true 5492 }, 5493 { 5494 name: 'name', 5495 display: 'name', 5496 source: bestPictures, 5497 async: true, 5498 templates: { 5499 empty: [ 5500 '<div class="empty-message">', 5501 '@Translate("Your search gave 0 results")', 5502 '</div>' 5503 ].join('\n'), 5504 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>') 5505 } 5506 5507 }).on('keypress', function(e) { 5508 if (e.which == 13) { 5509 var q = $('input.typeahead.tt-input').val(); 5510 window.location.href = "/Default.aspx?ID=@options.resultPageLink&Search="+q; 5511 } 5512 }); 5513 }); 5514 5515 </script> 5516 } 5517 } 5518 5519 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5520 5521 @using System 5522 @using System.Web 5523 @using Dynamicweb.Rapido.Blocks.Extensibility 5524 @using Dynamicweb.Rapido.Blocks 5525 5526 @{ 5527 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 5528 bool hideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 5529 5530 BlocksPage headerConfigurationPage = BlocksPage.GetBlockPage("Master"); 5531 5532 Block configDesktopLogo = headerConfigurationPage.GetBlockById("MasterDesktopLogo"); 5533 headerConfigurationPage.RemoveBlock(configDesktopLogo); 5534 5535 Block configDesktopMenu = headerConfigurationPage.GetBlockById("MasterDesktopMenu"); 5536 headerConfigurationPage.RemoveBlock(configDesktopMenu); 5537 5538 Block configSearchBar = headerConfigurationPage.GetBlockById("MasterSearchBar"); 5539 headerConfigurationPage.RemoveBlock(configSearchBar); 5540 5541 Block configSearchAction = headerConfigurationPage.GetBlockById("MasterDesktopActionsMenuSearch"); 5542 headerConfigurationPage.RemoveBlock(configSearchAction); 5543 5544 Block configDesktopActionsMenu = headerConfigurationPage.GetBlockById("MasterDesktopActionsMenu"); 5545 headerConfigurationPage.RemoveBlock(configDesktopActionsMenu); 5546 5547 Block configDesktopExtra = headerConfigurationPage.GetBlockById("MasterDesktopExtra"); 5548 5549 switch (topLayout) 5550 { 5551 case "condensed": //2 5552 configDesktopLogo.Design.Size = "auto-width"; 5553 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopLogo); 5554 5555 configDesktopMenu.SortId = 20; 5556 configDesktopMenu.Design.Size = "auto"; 5557 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5558 5559 configDesktopActionsMenu.SortId = 30; 5560 configDesktopActionsMenu.Design.Size = "auto-width"; 5561 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 5562 5563 if (!hideSearch) 5564 { 5565 configSearchBar.SortId = 40; 5566 configSearchBar.Design.Size = "12"; 5567 configDesktopExtra.SortId = 50; 5568 headerConfigurationPage.Add("MasterDesktopExtra", configSearchBar); 5569 } 5570 break; 5571 case "splitted": //3 5572 configDesktopLogo.Design.Size = "auto"; 5573 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 5574 5575 if (!hideSearch) 5576 { 5577 configSearchBar.SortId = 20; 5578 configSearchBar.Design.Size = "auto"; 5579 headerConfigurationPage.Add("MasterDesktopExtra", configSearchBar); 5580 } 5581 5582 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5583 5584 configDesktopActionsMenu.SortId = 20; 5585 configDesktopActionsMenu.Design.Size = "auto-width"; 5586 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 5587 break; 5588 case "minimal": //4 5589 configDesktopLogo.Design.Size = "auto-width"; 5590 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopLogo); 5591 5592 configDesktopMenu.Design.Size = "auto"; 5593 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5594 5595 configDesktopActionsMenu.SortId = 20; 5596 configDesktopActionsMenu.Design.Size = "auto-width"; 5597 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 5598 5599 if (!hideSearch) 5600 { 5601 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 5602 } 5603 break; 5604 case "minimal-right": //5 5605 configDesktopLogo.Design.Size = "auto-width"; 5606 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopLogo); 5607 5608 configDesktopMenu.Design.Size = "auto"; 5609 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5610 5611 configDesktopActionsMenu.SortId = 20; 5612 configDesktopActionsMenu.Design.Size = "auto-width"; 5613 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 5614 5615 if (!hideSearch) 5616 { 5617 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 5618 } 5619 break; 5620 case "two-lines": //6 5621 configDesktopLogo.Design.Size = "auto"; 5622 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 5623 5624 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5625 5626 configDesktopActionsMenu.SortId = 20; 5627 configDesktopActionsMenu.Design.Size = "auto-width"; 5628 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 5629 5630 if (!hideSearch) 5631 { 5632 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 5633 } 5634 break; 5635 case "two-lines-centered": //7 5636 configDesktopLogo.Design.Size = "auto"; 5637 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 5638 5639 configDesktopMenu.Design.Size = "auto-width"; 5640 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5641 5642 configDesktopActionsMenu.SortId = 20; 5643 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopActionsMenu); 5644 5645 if (!hideSearch) 5646 { 5647 headerConfigurationPage.Add("MasterDesktopActionsMenu", configSearchAction); 5648 } 5649 break; 5650 case "normal": //1 5651 default: 5652 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopLogo); 5653 5654 if (!hideSearch) 5655 { 5656 configSearchBar.SortId = 20; 5657 headerConfigurationPage.Add("MasterDesktopExtra", configSearchBar); 5658 } 5659 5660 configDesktopActionsMenu.SortId = 30; 5661 headerConfigurationPage.Add("MasterDesktopExtra", configDesktopActionsMenu); 5662 5663 configDesktopActionsMenu.Design.Size = "auto-width"; 5664 headerConfigurationPage.Add("MasterDesktopNavigation", configDesktopMenu); 5665 break; 5666 } 5667 } 5668 5669 @if (File.Exists(HttpContext.Current.Server.MapPath("/Files/Templates/Designs/Rapido/MasterBlocks/HeaderBlocks/Custom__Blocks.cshtml"))) 5670 { 5671 <text>@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5672 5673 @using System 5674 @using System.Web 5675 @using Dynamicweb.Rapido.Blocks.Extensibility 5676 @using Dynamicweb.Rapido.Blocks 5677 5678 @{ 5679 5680 }</text> 5681 } 5682 5683 5684 @helper RenderDesktopTools() 5685 { 5686 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopTools").OrderBy(item => item.SortId).ToList(); 5687 5688 <div class="tools-navigation u-block dw-mod"> 5689 <div class="center-container grid top-container__center-container dw-mod"> 5690 @RenderBlockList(subBlocks) 5691 </div> 5692 </div> 5693 } 5694 5695 @helper RenderDesktopToolsText() 5696 { 5697 if (Model.PropertyItem != null && Model.PropertyItem.GetList("ShowBreadcrumb").SelectedValue == "True") 5698 { 5699 <div class="grid grid--align-center grid--justify-space-between u-no-margin"> 5700 <div class="grid__cell--align-middle-left dw-mod"> 5701 @RenderNavigation(new 5702 { 5703 id = "breadcrumb", 5704 template = "Breadcrumb.xslt" 5705 }) 5706 </div> 5707 </div> 5708 } 5709 } 5710 5711 @helper RenderDesktopToolsNavigation() 5712 { 5713 bool renderPagesInToolBar = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("RenderPagesInToolBar"); 5714 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 5715 string liClasses = topLayout != "normal" ? "menu__item menu__item--horizontal menu__item--top-level" : "menu--clean"; 5716 string menuLinkClass = topLayout != "normal" ? "menu__link menu__link--icon" : "header-menu__link header-menu__link--icon"; 5717 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() : ""; 5718 5719 if (renderPagesInToolBar) 5720 { 5721 @RenderNavigation(new 5722 { 5723 id = "topToolsNavigation", 5724 cssclass = "menu menu-tools dw-mod dwnavigation", 5725 template = "TopMenu.xslt" 5726 }) 5727 } 5728 5729 <div class="grid grid--justify-end u-no-margin"> 5730 @foreach (var link in Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetItems("UspLink")) 5731 { 5732 string linkUrl = link.GetString("Link"); 5733 string linkText = link.GetString("LinkText"); 5734 5735 <div class="grid__cell--align-middle-right u-no-padding"> 5736 <div class="usp-first-link-container u-padding-right dw-mod"> 5737 <span class="u-color-light"><a href="@linkUrl">@linkText</a></span> 5738 </div> 5739 </div> 5740 } 5741 5742 <div class="grid__col-1 grid--justify-center language-selector-container"> 5743 <ul class="@liClasses"> 5744 <li class="@liClasses is-dropdown is-dropdown--no-icon u-no-margin u-no-border"> 5745 <div class="@menuLinkClass menu__link--icon dw-mod u-no-padding u-no-margin"> 5746 5747 @foreach (var langnav in Model.Languages) 5748 { 5749 if (langnav.IsCurrent) 5750 { 5751 string langInfonav = "<span class=\"flag-icon custom-flag flag-icon-" + Dynamicweb.Services.Areas.GetArea(langnav.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>"; 5752 @langInfonav 5753 } 5754 } 5755 5756 </div> 5757 <div class="menu menu--dropdown menu--dropdown-right languages-dropdown dw-mod grid__cell "> 5758 @foreach (var lang in Model.Languages) 5759 { 5760 string langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " u-margin-right\"></span>" + lang.Name; 5761 string cultureName = Regex.Replace(Dynamicweb.Services.Areas.GetArea(lang.ID).CultureInfo.NativeName, @" ?\(.*?\)", string.Empty); 5762 cultureName = char.ToUpper(cultureName[0]) + cultureName.Substring(1); 5763 5764 if (languageViewType == "flag-culture") 5765 { 5766 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span> " + cultureName; 5767 } 5768 5769 if (languageViewType == "flag") 5770 { 5771 langInfo = "<span class=\"flag-icon flag-icon-" + Dynamicweb.Services.Areas.GetArea(lang.ID).EcomCountryCode.ToLower() + " \"></span>"; 5772 } 5773 5774 if (languageViewType == "name") 5775 { 5776 langInfo = lang.Name; 5777 } 5778 5779 if (languageViewType == "culture") 5780 { 5781 langInfo = cultureName; 5782 } 5783 5784 <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> 5785 } 5786 </div> 5787 </li> 5788 </ul> 5789 </div> 5790 </div> 5791 } 5792 5793 @helper RenderDesktopNavigation() 5794 { 5795 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopNavigation").OrderBy(item => item.SortId).ToList(); 5796 string topLayout = Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout") != null ? Model.Area.Item.GetItem("Layout").GetItem("Header").GetList("TopLayout").SelectedValue : "normal"; 5797 string alignClass = topLayout == "two-lines-centered" ? "grid--justify-center" : ""; 5798 <nav class="main-navigation dw-mod"> 5799 <div class="center-container top-container__center-container grid @alignClass dw-mod"> 5800 @RenderBlockList(subBlocks) 5801 </div> 5802 </nav> 5803 } 5804 5805 @helper RenderDesktopExtra() 5806 { 5807 List<Block> subBlocks = headerBlocksPage.GetBlockListById("MasterDesktopExtra").OrderBy(item => item.SortId).ToList(); 5808 5809 if (subBlocks.Count > 0) 5810 { 5811 <div class="header header-top dw-mod"> 5812 <div class="center-container top-container__center-container grid--justify-space-between grid grid--align-center dw-mod"> 5813 @RenderBlockList(subBlocks) 5814 </div> 5815 </div> 5816 } 5817 } 5818 </text> 5819 } 5820 5821 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5822 5823 @using System 5824 @using System.Web 5825 @using Dynamicweb.Rapido.Blocks.Extensibility 5826 @using Dynamicweb.Rapido.Blocks 5827 5828 @{ 5829 Block impersonationBar = new Block 5830 { 5831 Id = "ImpersonationBar", 5832 SortId = 50, 5833 Template = RenderImpersonationBar(), 5834 Design = new Design 5835 { 5836 Size = "auto-width", 5837 HidePadding = true, 5838 RenderType = RenderType.Column 5839 } 5840 }; 5841 5842 if (Model.CurrentUser.ID > 0 && Model.SecondaryUsers.Count > 0) 5843 { 5844 BlocksPage.GetBlockPage("Master").Add("MasterHeader", impersonationBar); 5845 } 5846 } 5847 5848 @helper RenderImpersonationBar() 5849 { 5850 int impersonationPageId = GetPageIdByNavigationTag("Impersonation"); 5851 5852 <div class="u-color-warning--bg"> 5853 <div class="center-container top-container__center-container dw-mod"> 5854 @*Impersonation*@ 5855 <div class="grid"> 5856 <div class="grid--align-self-center grid__col-x"> 5857 @if (Model.CurrentSecondaryUser != null && Model.CurrentSecondaryUser.ID > 0) 5858 { 5859 string stopImpersonateTranslation = Translate("Stop impersonation"); 5860 string username = ""; 5861 if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.FirstName) && !string.IsNullOrEmpty(Model.CurrentSecondaryUser.LastName)) 5862 { 5863 username = Model.CurrentSecondaryUser.FirstName + " " + Model.CurrentSecondaryUser.LastName; 5864 } 5865 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Name)) 5866 { 5867 username = Model.CurrentSecondaryUser.Name; 5868 } 5869 else if (!string.IsNullOrEmpty(Model.CurrentSecondaryUser.Email)) 5870 { 5871 username = Model.CurrentSecondaryUser.Email; 5872 } 5873 else 5874 { 5875 username = Model.CurrentSecondaryUser.UserName; 5876 } 5877 <div class="grid-cell"> 5878 <div class="u-pull--left u-bold u-margin-top"> 5879 <i class="fas fa-user-secret"></i> 5880 @Pageview.User.UserName<text>&nbsp;</text>@Translate("is impersonating")<text>&nbsp;</text>@username 5881 </div> 5882 <form method="post" class="u-pull--right u-no-margin"> 5883 <input type="submit" class="btn btn--secondary dw-mod u-no-margin" name="DwExtranetRemoveSecondaryUser" value="@stopImpersonateTranslation"> 5884 </form> 5885 </div> 5886 } 5887 else 5888 { 5889 string viewListTranslation = Translate("View the list of users you can impersonate"); 5890 <div class="grid-cell u-bold"> 5891 <i class="fas fa-user-secret"></i> 5892 <a href="/Default.aspx?ID=@impersonationPageId" title="@viewListTranslation" class="u-color-font-black">@viewListTranslation</a> 5893 </div> 5894 } 5895 </div> 5896 </div> 5897 </div> 5898 </div> 5899 } 5900 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 5901 5902 @using System 5903 @using System.Web 5904 @using System.Collections.Generic 5905 @using Dynamicweb.Rapido.Blocks.Extensibility 5906 @using Dynamicweb.Rapido.Blocks 5907 5908 @{ 5909 BlocksPage miniCartBlocksPage = BlocksPage.GetBlockPage("Master"); 5910 string orderlinesView = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("OrderlinesView") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("OrderlinesView").SelectedValue : "table"; 5911 5912 Block orderLines = new Block 5913 { 5914 Id = "MiniCartOrderLines", 5915 SkipRenderBlocksList = true, 5916 BlocksList = new List<Block> 5917 { 5918 new Block { 5919 Id = "MiniCartOrderLinesList", 5920 SortId = 20, 5921 Template = RenderMiniCartOrderLinesList() 5922 } 5923 } 5924 }; 5925 5926 Block orderlinesScriptTemplates = new Block 5927 { 5928 Id = "OrderlinesScriptTemplates" 5929 }; 5930 5931 if (orderlinesView == "table") 5932 { 5933 orderLines.Template = RenderMiniCartOrderLinesTable(); 5934 orderLines.BlocksList.Add( 5935 new Block { 5936 Id = "MiniCartOrderlinesTableHeader", 5937 SortId = 10, 5938 Template = RenderMiniCartOrderLinesHeader() 5939 } 5940 ); 5941 5942 orderlinesScriptTemplates.Template = RenderMiniCartScriptsTableTemplates(); 5943 } 5944 else 5945 { 5946 orderLines.Template = RenderMiniCartOrderLinesBlocks(); 5947 orderlinesScriptTemplates.Template = RenderMiniCartScriptsListTemplates(); 5948 } 5949 5950 miniCartBlocksPage.Add("MasterBottomSnippets", orderlinesScriptTemplates); 5951 5952 Block miniCartScriptTemplates = new Block() 5953 { 5954 Id = "MasterMiniCartTemplates", 5955 SortId = 1, 5956 Template = RenderMiniCartScriptTemplates(), 5957 SkipRenderBlocksList = true, 5958 BlocksList = new List<Block> 5959 { 5960 orderLines, 5961 new Block { 5962 Id = "MiniCartFooter", 5963 Template = RenderMiniCartFooter(), 5964 SortId = 50, 5965 SkipRenderBlocksList = true, 5966 BlocksList = new List<Block> 5967 { 5968 new Block { 5969 Id = "MiniCartFees", 5970 Template = RenderMiniCartFees(), 5971 SortId = 30 5972 }, 5973 new Block { 5974 Id = "MiniCartPoints", 5975 Template = RenderMiniCartPoints(), 5976 SortId = 40 5977 }, 5978 new Block { 5979 Id = "MiniCartTotal", 5980 Template = RenderMiniCartTotal(), 5981 SortId = 50 5982 }, 5983 new Block { 5984 Id = "MiniCartActions", 5985 Template = RenderMiniCartActions(), 5986 SortId = 60 5987 } 5988 } 5989 } 5990 } 5991 }; 5992 5993 miniCartBlocksPage.Add("MasterBottomSnippets", miniCartScriptTemplates); 5994 } 5995 5996 @helper RenderMiniCartScriptsTableTemplates() 5997 { 5998 <script id="MiniCartOrderline" type="text/x-template"> 5999 {{#unless isEmpty}} 6000 <tr> 6001 <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> 6002 <td class="u-va-middle"> 6003 <a href="{{link}}" class="mini-cart-orderline__name" title="{{name}}">{{name}}</a> 6004 {{#if variantname}} 6005 <a href="{{link}}" class="mini-cart-orderline__name mini-cart-orderline__name--sm">{{variantname}}</a> 6006 {{/if}} 6007 {{#if unitname}} 6008 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm">{{unitname}}</div> 6009 {{/if}} 6010 </td> 6011 <td class="u-ta-right u-va-middle">{{quantity}}</td> 6012 <td class="u-ta-right u-va-middle"> 6013 {{#if pointsTotal}} 6014 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 6015 {{else}} 6016 {{totalprice}} @Translate("{{currency}}") 6017 {{/if}} 6018 </td> 6019 </tr> 6020 {{/unless}} 6021 </script> 6022 6023 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 6024 {{#unless isEmpty}} 6025 <tr class="table__row--no-border"> 6026 <td class="u-w60px">&nbsp;</td> 6027 <td><div class="mini-cart-orderline__name dw-mod">{{name}}</div></td> 6028 <td class="u-ta-right">&nbsp;</td> 6029 <td class="u-ta-right">{{totalprice}} @Translate("{{currency}}")</td> 6030 </tr> 6031 {{/unless}} 6032 </script> 6033 } 6034 6035 @helper RenderMiniCartScriptsListTemplates() 6036 { 6037 int cartOrderlinesFeedPageId = GetPageIdByNavigationTag("CartOrderlinesFeed"); 6038 <script id="MiniCartOrderline" type="text/x-template"> 6039 {{#unless isEmpty}} 6040 <div class="mini-cart-orderline grid dw-mod"> 6041 <div class="grid__col-4"> 6042 <a href="{{link}}" class="{{hideimage}}"> 6043 <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}}"> 6044 </a> 6045 </div> 6046 <div class="grid__col-8"> 6047 <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> 6048 {{#if variantname}} 6049 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("Variant"): {{variantname}}</div> 6050 {{/if}} 6051 {{#if unitname}} 6052 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod">@Translate("Unit"): {{unitname}}</div> 6053 {{/if}} 6054 <div class="mini-cart-orderline__name mini-cart-orderline__name--sm dw-mod"> 6055 @Translate("Qty"): 6056 <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}}"> 6057 </div> 6058 6059 <div class="grid__cell-footer"> 6060 <div class="grid__cell"> 6061 <div class="u-pull--left mini-cart-orderline__price dw-mod"> 6062 {{#if pointsTotal}} 6063 <span class="u-color--loyalty-points">{{pointsTotal}}</span> @Translate("points") 6064 {{else}} 6065 @Translate("{{currency}}") {{priceWithDiscount}} 6066 {{/if}} 6067 </div> 6068 <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> 6069 </div> 6070 </div> 6071 </div> 6072 </div> 6073 {{/unless}} 6074 </script> 6075 6076 <script id="MiniCartOrderlineDiscount" type="text/x-template"> 6077 {{#unless isEmpty}} 6078 <div class="mini-cart-orderline mini-cart-orderline--discount grid dw-mod"> 6079 <div class="grid__col-4"> 6080 <div class="mini-cart-orderline__name mini-cart-orderline__name dw-mod">{{name}}</div> 6081 </div> 6082 <div class="grid__col-8">{{totalprice}} @Translate("{{currency}}")</div> 6083 </div> 6084 {{/unless}} 6085 </script> 6086 } 6087 6088 @helper RenderMiniCartScriptTemplates() 6089 { 6090 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMiniCartTemplates").OrderBy(item => item.SortId).ToList(); 6091 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 6092 string cartPageLink = string.Concat("/Default.aspx?ID=", GetPageIdByNavigationTag("CartPage")); 6093 6094 <script id="MiniCartContent" type="text/x-template"> 6095 {{#.}} 6096 {{#unless isEmpty}} 6097 @if (useGoogleTagManager) 6098 { 6099 <text>{{{googleEnchantImpressionEmptyCart OrderLines}}}</text> 6100 } 6101 @RenderBlockList(subBlocks) 6102 {{/unless}} 6103 {{#if isEmpty}} 6104 {{{locationReload '@cartPageLink'}}} 6105 {{/if}} 6106 {{/.}} 6107 </script> 6108 } 6109 6110 @helper RenderMiniCartOrderLinesTable() 6111 { 6112 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 6113 6114 <div class="u-overflow-auto"> 6115 <table class="table mini-cart-table dw-mod"> 6116 @RenderBlockList(subBlocks) 6117 </table> 6118 </div> 6119 } 6120 6121 @helper RenderMiniCartOrderLinesBlocks() 6122 { 6123 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartOrderLines").OrderBy(item => item.SortId).ToList(); 6124 6125 <div class="u-overflow-auto"> 6126 @RenderBlockList(subBlocks) 6127 </div> 6128 } 6129 6130 @helper RenderMiniCartOrderLinesHeader() 6131 { 6132 <thead> 6133 <tr> 6134 <td>&nbsp;</td> 6135 <td>@Translate("Product")</td> 6136 <td class="u-ta-right">@Translate("Qty")</td> 6137 <td class="u-ta-right" width="120">@Translate("Price")</td> 6138 </tr> 6139 </thead> 6140 } 6141 6142 @helper RenderMiniCartOrderLinesList() 6143 { 6144 <text> 6145 {{#OrderLines}} 6146 {{#ifCond template "===" "CartOrderline"}} 6147 {{>MiniCartOrderline}} 6148 {{/ifCond}} 6149 {{#ifCond template "===" "CartOrderlineMobile"}} 6150 {{>MiniCartOrderline}} 6151 {{/ifCond}} 6152 {{/OrderLines}} 6153 </text> 6154 } 6155 6156 @helper RenderMiniCartFees() 6157 { 6158 <div class="grid u-border-top grid--external-bleed-bottom"> 6159 <div class="grid__col-6 u-bold u-no-padding-bottom no-padding-left no-padding-right"> 6160 @Translate("Subtotal") 6161 </div> 6162 <div class="grid__col-6 grid--align-end u-bold u-no-padding-bottom no-padding-left no-padding-right">@Translate("{{currency}}") {{subtotalprice}}</div> 6163 <div class="grid__col-6 u-no-padding-top u-no-padding"> 6164 @Translate("VAT") 6165 </div> 6166 <div class="grid__col-6 grid--align-end u-no-padding-top u-no-padding-bottom no-padding-left no-padding-right">@Translate("{{currency}}") {{totalvat}}</div> 6167 </div> 6168 <div class="grid grid--external-bleed-bottom u-no-padding-bottom "> 6169 <div class="grid__col-6 no-padding-left no-padding-right"> 6170 {{shippingmethod}} 6171 </div> 6172 <div class="grid__col-6 grid--align-end u-no-padding-bottom no-padding-left no-padding-right">{{shippingfee}}</div> 6173 </div> 6174 } 6175 6176 @helper RenderMiniCartFooter() 6177 { 6178 List<Block> subBlocks = this.masterPage.GetBlockListById("MiniCartFooter").OrderBy(item => item.SortId).ToList(); 6179 6180 <div class="mini-cart__footer dw-mod"> 6181 @RenderBlockList(subBlocks) 6182 </div> 6183 } 6184 6185 @helper RenderMiniCartActions() 6186 { 6187 int cartPageId = GetPageIdByNavigationTag("CartPage"); 6188 6189 <button type="button" title="@Translate("Empty cart")" class="btn btn-clear-cart no-padding-left" onclick="googleEnchantImpressionEmptyCart(); Cart.EmptyCart(event);">@Translate("Empty cart")</button> 6190 <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> 6191 } 6192 6193 @helper RenderMiniCartPoints() 6194 { 6195 <text> 6196 {{#if earnings}} 6197 <div class="grid grid--external-bleed-bottom"> 6198 <div class="grid__col-6">@Translate("Earnings")</div> 6199 <div class="grid__col-6 grid--align-end"> 6200 <div> 6201 <span class="u-color--loyalty-points">{{earnings}}</span> @Translate("points") 6202 </div> 6203 </div> 6204 </div> 6205 {{/if}} 6206 </text> 6207 } 6208 6209 @helper RenderMiniCartTotal() 6210 { 6211 <div class="mini-cart-totals grid u-margin-bottom dw-mod "> 6212 <div class="grid__col-6 no-padding-left no-padding-right">@Translate("Total")</div> 6213 <div class="grid__col-6 grid--align-end no-padding-left no-padding-right">@Translate("{{currency}}") {{totalprice}}</div> 6214 </div> 6215 } 6216 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6217 6218 @using Dynamicweb.Rapido.Blocks.Extensibility 6219 @using Dynamicweb.Rapido.Blocks 6220 6221 @{ 6222 bool addToCartNotificationOnlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 6223 string addToCartNotificationType = Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType") != null ? Model.Area.Item.GetItem("Ecommerce").GetItem("MiniCart").GetList("AddToCartNotificationType").SelectedValue : ""; 6224 6225 if (!addToCartNotificationOnlyPreview && !string.IsNullOrEmpty(addToCartNotificationType)) { 6226 if (addToCartNotificationType == "modal") 6227 { 6228 Block addToCartNotificationModal = new Block 6229 { 6230 Id = "AddToCartNotificationModal", 6231 Template = RenderAddToCartNotificationModal() 6232 }; 6233 6234 Block addToCartNotificationScript = new Block 6235 { 6236 Id = "AddToCartNotificationScript", 6237 Template = RenderAddToCartNotificationModalScript() 6238 }; 6239 BlocksPage.GetBlockPage("Master").Add("MasterTopSnippets", addToCartNotificationModal); 6240 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 6241 } 6242 else if (addToCartNotificationType == "toggle") 6243 { 6244 Block addToCartNotificationScript = new Block 6245 { 6246 Id = "AddToCartNotificationScript", 6247 Template = RenderAddToCartNotificationToggleScript() 6248 }; 6249 BlocksPage.GetBlockPage("Master").Add("MasterBottomSnippets", addToCartNotificationScript); 6250 } 6251 } 6252 } 6253 6254 @helper RenderAddToCartNotificationModal() 6255 { 6256 <div id="LastAddedProductModal" data-template="LastAddedProductTemplate"></div> 6257 } 6258 6259 @helper RenderAddToCartNotificationModalScript() 6260 { 6261 int cartPageId = GetPageIdByNavigationTag("CartPage"); 6262 6263 <script id="LastAddedProductTemplate" type="text/x-template"> 6264 <!-- Trigger for the login modal --> 6265 <input type="checkbox" id="LastAddedProductModalTrigger" class="modal-trigger" /> 6266 6267 <!-- Login modal --> 6268 <div class="modal-container"> 6269 <label for="LastAddedProductModalTrigger" class="modal-overlay"></label> 6270 <div class="modal modal--md"> 6271 <div class="modal__header"> 6272 <h2>@Translate("Product is added to the cart")</h2> 6273 </div> 6274 <div class="modal__body"> 6275 <div class="grid"> 6276 <div class="grid__col-2"> 6277 <a href="{{productInfo.link}}"> 6278 <img src="{{productInfo.image}}" alt="{{productInfo.name}}" class="dw-mod" /> 6279 </a> 6280 </div> 6281 <div class="u-padding grid--align-self-center"> 6282 <span>{{quantity}}</span> x 6283 </div> 6284 <div class="grid__col-auto grid--align-self-center"> 6285 <div>{{productInfo.name}}</div> 6286 {{#if productInfo.variantName}} 6287 <small class="u-margin-bottom-5px">{{productInfo.variantName}}</small> 6288 {{/if}} 6289 {{#if productInfo.unitName}} 6290 <small class="u-margin-bottom-5px">{{productInfo.unitName}}</small> 6291 {{/if}} 6292 </div> 6293 </div> 6294 <div class="modal__footer u-margin-top--lg"> 6295 <label class="btn btn--secondary u-pull--left u-no-margin dw-mod btn--sm" for="LastAddedProductModalTrigger">@Translate("Continue shopping")</label> 6296 <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> 6297 </div> 6298 </div> 6299 <label class="modal__close-btn" for="LastAddedProductModalTrigger"></label> 6300 </div> 6301 </div> 6302 </script> 6303 <script> 6304 document.addEventListener('addToCart', function (event) { 6305 Cart.ShowLastAddedProductModal(event.detail); 6306 }); 6307 </script> 6308 } 6309 6310 @helper RenderAddToCartNotificationToggleScript() 6311 { 6312 int miniCartFeedPageId = GetPageIdByNavigationTag("MiniCartFeed"); 6313 6314 <script> 6315 document.addEventListener('addToCart', function () { 6316 Cart.ToggleMiniCart('miniCartTrigger', 'miniCart', 'cartCounter', '@miniCartFeedPageId'); 6317 }); 6318 </script> 6319 } 6320 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 6321 6322 @using System 6323 @using System.Web 6324 @using System.Collections.Generic 6325 @using Dynamicweb.Rapido.Blocks.Extensibility 6326 @using Dynamicweb.Rapido.Blocks 6327 6328 @functions { 6329 BlocksPage footerBlocksPage = BlocksPage.GetBlockPage("Master"); 6330 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 6331 } 6332 6333 @{ 6334 string footerColumnOneContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne").GetString("Content"); 6335 string footerColumnTwoContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo").GetString("Content"); 6336 string footerColumnThreeContent = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree").GetString("Content"); 6337 string footerColumnOneHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnOne").GetString("Header"); 6338 string footerColumnTwoHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnTwo").GetString("Header"); 6339 string footerColumnThreeHeader = Model.Area.Item.GetItem("Layout").GetItem("FooterColumnThree").GetString("Header"); 6340 6341 Block masterFooterContent = new Block() 6342 { 6343 Id = "MasterFooterContent", 6344 SortId = 10, 6345 Template = RenderFooter(), 6346 SkipRenderBlocksList = true 6347 }; 6348 footerBlocksPage.Add(MasterBlockId.MasterFooter, masterFooterContent); 6349 6350 if (!string.IsNullOrEmpty(footerColumnOneContent) || !string.IsNullOrEmpty(footerColumnOneHeader)) 6351 { 6352 Block masterFooterColumnOne = new Block 6353 { 6354 Id = "MasterFooterColumnOne", 6355 SortId = 20, 6356 Template = RenderFooterColumn(footerColumnOneHeader, footerColumnOneContent), 6357 Design = new Design 6358 { 6359 Size = "auto", 6360 RenderType = RenderType.Column 6361 } 6362 }; 6363 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnOne); 6364 } 6365 6366 if (!string.IsNullOrEmpty(footerColumnTwoContent) || !string.IsNullOrEmpty(footerColumnTwoHeader)) 6367 { 6368 Block masterFooterColumnTwo = new Block 6369 { 6370 Id = "MasterFooterColumnTwo", 6371 SortId = 30, 6372 Template = RenderFooterColumnTwo(footerColumnTwoHeader, footerColumnTwoContent), 6373 Design = new Design 6374 { 6375 Size = "auto", 6376 RenderType = RenderType.Column 6377 } 6378 }; 6379 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnTwo); 6380 } 6381 6382 if (!string.IsNullOrEmpty(footerColumnThreeContent) || !string.IsNullOrEmpty(footerColumnThreeHeader)) 6383 { 6384 Block masterFooterColumnThree = new Block 6385 { 6386 Id = "MasterFooterColumnThree", 6387 SortId = 40, 6388 Template = RenderFooterColumnThree(footerColumnThreeHeader, footerColumnThreeContent), 6389 Design = new Design 6390 { 6391 Size = "auto", 6392 RenderType = RenderType.Column 6393 } 6394 }; 6395 footerBlocksPage.Add("MasterFooterContent", masterFooterColumnThree); 6396 } 6397 6398 if (Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks") != null && Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks").Count > 0 && siteURL.Contains("hededanmark")) 6399 { 6400 Block masterFooterSocialLinks = new Block 6401 { 6402 Id = "MasterFooterSocialLinks", 6403 SortId = 50, 6404 Template = RenderFooterSocialLinks(), 6405 Design = new Design 6406 { 6407 Size = "auto", 6408 RenderType = RenderType.Column 6409 } 6410 }; 6411 footerBlocksPage.Add("MasterFooterContent", masterFooterSocialLinks); 6412 } 6413 6414 if (Model.Area.Item.GetItem("Layout").GetItems("FooterPayments") != null && Model.Area.Item.GetItem("Layout").GetItems("FooterPayments").Count > 0) 6415 { 6416 Block masterFooterPayments = new Block 6417 { 6418 Id = "MasterFooterPayments", 6419 SortId = 60, 6420 Template = RenderFooterPayments(), 6421 Design = new Design 6422 { 6423 Size = "12", 6424 RenderType = RenderType.Column 6425 } 6426 }; 6427 footerBlocksPage.Add("MasterFooterContent", masterFooterPayments); 6428 } 6429 6430 if (Model.Area.Item.GetItem("Layout").GetString("FooterCopyrightText") != "") 6431 { 6432 Block masterFooterCopyright = new Block 6433 { 6434 Id = "MasterFooterCopyright", 6435 SortId = 70, 6436 Template = RenderFooterCopyright(), 6437 Design = new Design 6438 { 6439 Size = "12", 6440 RenderType = RenderType.Column 6441 } 6442 }; 6443 footerBlocksPage.Add("MasterFooterContent", masterFooterCopyright); 6444 6445 } 6446 6447 //If sentence to check if the FooterLogo has content or not 6448 6449 if (Model.Area.Item.GetItem("Layout").GetValue("FooterLogo") != null) 6450 { 6451 Block masterFooterLogo = new Block 6452 { 6453 Id = "MasterFooterLogo", 6454 SortId = 1, 6455 Template = RenderFooterLogo(), 6456 Design = new Design 6457 { 6458 Size = "auto", 6459 RenderType = RenderType.Column 6460 } 6461 }; 6462 footerBlocksPage.Add("MasterFooterContent", masterFooterLogo); 6463 } 6464 } 6465 6466 @helper RenderFooter() 6467 { 6468 List<Block> subBlocks = this.footerBlocksPage.GetBlockListById("MasterFooterContent").OrderBy(item => item.SortId).ToList(); 6469 6470 <footer class="footer dw-mod"> 6471 @RenderFooterLinks() 6472 @RenderFooterNewsletterSignUp() 6473 <div class="center-container top-container__center-container dw-mod"> 6474 <div class="grid grid--external-bleed-x u-padding-top--lg"> 6475 @RenderBlockList(subBlocks) 6476 </div> 6477 </div> 6478 </footer> 6479 } 6480 6481 @helper RenderFooterLinks() 6482 { 6483 <div class="footer__content u-padding u-brand-color-one--bg bottom-navigation-container dw-mod u-flex"> 6484 @{ 6485 string firstPageLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FirstPage"); 6486 string firstPageText = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FirstLinkText"); 6487 6488 string secondPageLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("SecondPage"); 6489 string secondPageText = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("SecondLinkText"); 6490 6491 string thirdPageLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("ThirdPage"); 6492 string thirdPageText = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("ThirdLinkText"); 6493 6494 string fourthPageLink = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FourthPage"); 6495 string fourthPageText = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FourthLinkText"); 6496 6497 } 6498 6499 @if (!string.IsNullOrEmpty(firstPageText)) 6500 { 6501 <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"> 6502 <div class="grid__col-md-2 grid__col-12 grid--align-center u-no-padding-bottom-xs"> 6503 @if (!string.IsNullOrEmpty(firstPageLink)) 6504 { 6505 <a href="@firstPageLink" class="u-color-light" target="_self" rel="nofollow"> 6506 @firstPageText 6507 </a> 6508 } 6509 6510 else 6511 { 6512 <span class="u-color-light"> 6513 @firstPageText 6514 </span> 6515 } 6516 6517 </div> 6518 <div class="grid__col-md-1 grid__col-12 grid--direction-row grid--align-center grid--justify-center u-no-padding-bottom-xs"> 6519 <span>-</span> 6520 6521 </div> 6522 <div class="grid__col-md-2 grid__col-12 grid--align-center u-no-padding-bottom-xs"> 6523 @if (!string.IsNullOrEmpty(secondPageLink)) 6524 { 6525 <a href="@secondPageLink" class="u-color-light" target="_self" rel="nofollow"> 6526 @secondPageText 6527 </a> 6528 } 6529 6530 else 6531 { 6532 <span class="u-color-light"> 6533 @secondPageText 6534 </span> 6535 } 6536 6537 </div> 6538 <div class="grid__col-md-1 grid__col-12 grid--direction-row grid--align-center grid--justify-center u-no-padding-bottom-xs"> 6539 <span>-</span> 6540 6541 </div> 6542 <div class="grid__col-md-2 grid__col-12 grid--align-center u-no-padding-bottom-xs"> 6543 @if (!string.IsNullOrEmpty(thirdPageLink)) 6544 { 6545 <a href="@thirdPageLink" class="u-color-light" target="_self" rel="nofollow"> 6546 @thirdPageText 6547 </a> 6548 } 6549 else 6550 { 6551 <span class="u-color-light"> 6552 @thirdPageText 6553 </span> 6554 } 6555 </div> 6556 6557 <div class="grid__col-md-1 grid__col-12 grid--direction-row grid--align-center grid--justify-center u-no-padding-bottom-xs"> 6558 <span>-</span> 6559 6560 </div> 6561 6562 6563 <div class="grid__col-md-2 grid__col-12 grid--align-center"> 6564 @if (!string.IsNullOrEmpty(fourthPageLink)) 6565 { 6566 <a href="@fourthPageLink" class="u-color-light" target="_self" rel="nofollow"> 6567 @fourthPageText 6568 </a> 6569 } 6570 else 6571 { 6572 <span class="u-color-light"> 6573 @fourthPageText 6574 </span> 6575 } 6576 </div> 6577 </div> 6578 } 6579 </div> 6580 } 6581 6582 6583 @helper RenderFooterColumn(string header, string content) 6584 { 6585 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 6586 6587 //Check to see if site is hd2412 or not 6588 6589 if (siteURL.Contains("hd2412")) 6590 { 6591 <div class="footer__content dw-mod u-flex grid--justify-start"> 6592 <div class="u-flex grid__col-12 grid--align-start"> 6593 <strong class="footer__heading dw-mod">@header</strong> 6594 <div class="footer-content-rte"> 6595 @content 6596 6597 </div> 6598 6599 </div> 6600 </div> 6601 } 6602 6603 else 6604 { 6605 <div class="footer__content dw-mod u-flex grid--justify-center u-margin-auto"> 6606 <div class="u-flex grid__col-12 grid--align-center"> 6607 @header 6608 @content 6609 6610 </div> 6611 </div> 6612 } 6613 } 6614 6615 @helper RenderFooterColumnTwo(string header, string content) 6616 { 6617 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 6618 6619 if (siteURL.Contains("hd2412")) 6620 { 6621 <div class="footer__content dw-mod u-flex grid--justify-start"> 6622 <div class="u-flex grid__col-12 grid--align-start"> 6623 <strong class="footer__heading dw-mod">@header</strong> 6624 <div class="footer-content-rte"> 6625 @content 6626 6627 </div> 6628 6629 </div> 6630 </div> 6631 } 6632 6633 else 6634 { 6635 <div class="footer__content dw-mod u-flex grid--justify-center u-margin-auto"> 6636 <div class="u-flex grid__col-12 grid--align-center"> 6637 @header 6638 @content 6639 6640 </div> 6641 </div> 6642 } 6643 } 6644 6645 @helper RenderFooterColumnThree(string header, string content) 6646 { 6647 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 6648 6649 if (siteURL.Contains("hd2412")) 6650 { 6651 <div class="footer__content dw-mod u-flex grid--justify-start"> 6652 <div class="u-flex grid__col-12 grid--align-start"> 6653 <strong class="footer__heading dw-mod">@header</strong> 6654 <div class="footer-content-rte"> 6655 6656 @content 6657 6658 </div> 6659 6660 </div> 6661 </div> 6662 } 6663 6664 else 6665 { 6666 <div class="footer__content dw-mod u-flex grid--justify-center u-margin-auto"> 6667 <div class="u-flex grid__col-12 grid--align-center"> 6668 @header 6669 @content 6670 6671 </div> 6672 </div> 6673 } 6674 } 6675 6676 @helper RenderFooterNewsletterSignUp() 6677 { 6678 bool newsletterCheckBox = Model.Area.Item.GetItem("Layout").GetBoolean("FooterNewsletterSignUp"); 6679 6680 string newsletterSignUpPageId = GetPageIdByNavigationTag("NewsletterSignUp").ToString(); 6681 string formId = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FormId"); 6682 string formAction = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("FormAction"); 6683 string newsletterId = $"_form_{formId}_"; 6684 string submitForm = $"_form_{formId}_submit"; 6685 string hiddenFields = Model.Area.Item.GetItem("Custom").GetItem("CustomSettings").GetString("HiddenFields"); 6686 6687 if (newsletterCheckBox != false) 6688 { 6689 6690 <div class="footer__content footer__content-newsletter dw-mod"> 6691 <form class="form center-container dw-mod" name="NewsletterRedirect" action="@formAction" id="@newsletterId" method="get" enctype="multipart/form-data"> 6692 @hiddenFields 6693 <div class="grid__col-12 grid__col--bleed grid--direction-row"> 6694 <div class="grid__col-lg-3 grid__col-12 mailing-list-container"> 6695 <h3>@Translate("Mailing list")</h3> 6696 </div> 6697 <div class="grid__col-lg-3 grid__col-12"> 6698 <input name="fullname" id="NewsletterName" type="text" placeholder='@Translate("Your name", "Your name")' class="newsletter-input" aria-label="newsletter fullname" /> 6699 </div> 6700 <div class="grid__col-lg-3 grid__col-12"> 6701 <input name="email" id="NewsletterEmail" type="text" placeholder='@Translate("Your email address", "Your email address")' class="newsletter-input" aria-label="newsletter email" /> 6702 </div> 6703 <div class="grid__col-lg-3 grid__col-12 submit"> 6704 <input class="btn btn--secondary btn--condensed newsletter-submit u-bold" type="submit" id="@submitForm" value='@Translate("Go", "Go")' aria-label="submit newsletter form" /> 6705 </div> 6706 </div> 6707 </form> 6708 </div> 6709 6710 <script defer type="text/javascript"> 6711 window.cfields = []; 6712 window._show_thank_you = function(id, message, trackcmp_url) { 6713 var form = document.getElementById('_form_' + id + '_'), thank_you = form.querySelector('._form-thank-you'); 6714 form.querySelector('._form-content').style.display = 'none'; 6715 thank_you.innerHTML = message; 6716 thank_you.style.display = 'block'; 6717 if (typeof(trackcmp_url) != 'undefined' && trackcmp_url) { 6718 // Site tracking URL to use after inline form submission. 6719 _load_script(trackcmp_url); 6720 } 6721 if (typeof window._form_callback !== 'undefined') window._form_callback(id); 6722 }; 6723 window._show_error = function(id, message, html) { 6724 var form = document.getElementById('_form_' + id + '_'), err = document.createElement('div'), button = form.querySelector('button'), old_error = form.querySelector('._form_error'); 6725 if (old_error) old_error.parentNode.removeChild(old_error); 6726 err.innerHTML = message; 6727 err.className = '_error-inner _form_error _no_arrow'; 6728 var wrapper = document.createElement('div'); 6729 wrapper.className = '_form-inner'; 6730 wrapper.appendChild(err); 6731 button.parentNode.insertBefore(wrapper, button); 6732 document.querySelector('[id^="_form"][id$="_submit"]').disabled = false; 6733 if (html) { 6734 var div = document.createElement('div'); 6735 div.className = '_error-html'; 6736 div.innerHTML = html; 6737 err.appendChild(div); 6738 } 6739 }; 6740 window._load_script = function(url, callback) { 6741 var head = document.querySelector('head'), script = document.createElement('script'), r = false; 6742 script.type = 'text/javascript'; 6743 script.charset = 'utf-8'; 6744 script.src = url; 6745 if (callback) { 6746 script.onload = script.onreadystatechange = function() { 6747 if (!r && (!this.readyState || this.readyState == 'complete')) { 6748 r = true; 6749 callback(); 6750 } 6751 }; 6752 } 6753 head.appendChild(script); 6754 }; 6755 (function() { 6756 if (window.location.search.search("excludeform") !== -1) return false; 6757 var getCookie = function(name) { 6758 var match = document.cookie.match(new RegExp('(^|; )' + name + '=([^;]+)')); 6759 return match ? match[2] : null; 6760 } 6761 var setCookie = function(name, value) { 6762 var now = new Date(); 6763 var time = now.getTime(); 6764 var expireTime = time + 1000 * 60 * 60 * 24 * 365; 6765 now.setTime(expireTime); 6766 document.cookie = name + '=' + value + '; expires=' + now + ';path=/'; 6767 } 6768 var addEvent = function(element, event, func) { 6769 if (element.addEventListener) { 6770 element.addEventListener(event, func); 6771 } else { 6772 var oldFunc = element['on' + event]; 6773 element['on' + event] = function() { 6774 oldFunc.apply(this, arguments); 6775 func.apply(this, arguments); 6776 }; 6777 } 6778 } 6779 var _removed = false; 6780 var form_to_submit = document.getElementById('@newsletterId'); 6781 var allInputs = form_to_submit.querySelectorAll('input, select, textarea'), tooltips = [], submitted = false; 6782 6783 var getUrlParam = function(name) { 6784 var regexStr = '[\?&]' + name + '=([^&#]*)'; 6785 var results = new RegExp(regexStr, 'i').exec(window.location.href); 6786 return results != undefined ? decodeURIComponent(results[1]) : false; 6787 }; 6788 6789 for (var i = 0; i < allInputs.length; i++) { 6790 var regexStr = "field\\[(\\d+)\\]"; 6791 var results = new RegExp(regexStr).exec(allInputs[i].name); 6792 if (results != undefined) { 6793 allInputs[i].dataset.name = window.cfields[results[1]]; 6794 } else { 6795 allInputs[i].dataset.name = allInputs[i].name; 6796 } 6797 var fieldVal = getUrlParam(allInputs[i].dataset.name); 6798 6799 if (fieldVal) { 6800 if (allInputs[i].type == "radio" || allInputs[i].type == "checkbox") { 6801 if (allInputs[i].value == fieldVal) { 6802 allInputs[i].checked = true; 6803 } 6804 } else { 6805 allInputs[i].value = fieldVal; 6806 } 6807 } 6808 } 6809 6810 var remove_tooltips = function() { 6811 for (var i = 0; i < tooltips.length; i++) { 6812 tooltips[i].tip.parentNode.removeChild(tooltips[i].tip); 6813 } 6814 tooltips = []; 6815 }; 6816 var remove_tooltip = function(elem) { 6817 for (var i = 0; i < tooltips.length; i++) { 6818 if (tooltips[i].elem === elem) { 6819 tooltips[i].tip.parentNode.removeChild(tooltips[i].tip); 6820 tooltips.splice(i, 1); 6821 return; 6822 } 6823 } 6824 }; 6825 var create_tooltip = function(elem, text) { 6826 var tooltip = document.createElement('div'), arrow = document.createElement('div'), inner = document.createElement('div'), new_tooltip = {}; 6827 if (elem.type != 'radio' && elem.type != 'checkbox') { 6828 tooltip.className = '_error'; 6829 arrow.className = '_error-arrow'; 6830 inner.className = '_error-inner'; 6831 inner.innerHTML = text; 6832 tooltip.appendChild(arrow); 6833 tooltip.appendChild(inner); 6834 elem.parentNode.appendChild(tooltip); 6835 } else { 6836 tooltip.className = '_error-inner _no_arrow'; 6837 tooltip.innerHTML = text; 6838 elem.parentNode.insertBefore(tooltip, elem); 6839 new_tooltip.no_arrow = true; 6840 } 6841 new_tooltip.tip = tooltip; 6842 new_tooltip.elem = elem; 6843 tooltips.push(new_tooltip); 6844 return new_tooltip; 6845 }; 6846 var resize_tooltip = function(tooltip) { 6847 var rect = tooltip.elem.getBoundingClientRect(); 6848 var doc = document.documentElement, scrollPosition = rect.top - ((window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0)); 6849 if (scrollPosition < 40) { 6850 tooltip.tip.className = tooltip.tip.className.replace(/ ?(_above|_below) ?/g, '') + ' _below'; 6851 } else { 6852 tooltip.tip.className = tooltip.tip.className.replace(/ ?(_above|_below) ?/g, '') + ' _above'; 6853 } 6854 }; 6855 var resize_tooltips = function() { 6856 if (_removed) return; 6857 for (var i = 0; i < tooltips.length; i++) { 6858 if (!tooltips[i].no_arrow) resize_tooltip(tooltips[i]); 6859 } 6860 }; 6861 var validate_field = function(elem, remove) { 6862 var tooltip = null, value = elem.value, no_error = true; 6863 remove ? remove_tooltip(elem) : false; 6864 if (elem.type != 'checkbox') elem.className = elem.className.replace(/ ?_has_error ?/g, ''); 6865 if (elem.getAttribute('required') !== null) { 6866 if (elem.type == 'radio' || (elem.type == 'checkbox' && /any/.test(elem.className))) { 6867 var elems = form_to_submit.elements[elem.name]; 6868 if (!(elems instanceof NodeList || elems instanceof HTMLCollection) || elems.length <= 1) { 6869 no_error = elem.checked; 6870 } 6871 else { 6872 no_error = false; 6873 for (var i = 0; i < elems.length; i++) { 6874 if (elems[i].checked) no_error = true; 6875 } 6876 } 6877 if (!no_error) { 6878 tooltip = create_tooltip(elem, "Please select an option."); 6879 } 6880 } else if (elem.type =='checkbox') { 6881 var elems = form_to_submit.elements[elem.name], found = false, err = []; 6882 no_error = true; 6883 for (var i = 0; i < elems.length; i++) { 6884 if (elems[i].getAttribute('required') === null) continue; 6885 if (!found && elems[i] !== elem) return true; 6886 found = true; 6887 elems[i].className = elems[i].className.replace(/ ?_has_error ?/g, ''); 6888 if (!elems[i].checked) { 6889 no_error = false; 6890 elems[i].className = elems[i].className + ' _has_error'; 6891 err.push("Checking %s is required".replace("%s", elems[i].value)); 6892 } 6893 } 6894 if (!no_error) { 6895 tooltip = create_tooltip(elem, err.join('<br/>')); 6896 } 6897 } else if (elem.tagName == 'SELECT') { 6898 var selected = true; 6899 if (elem.multiple) { 6900 selected = false; 6901 for (var i = 0; i < elem.options.length; i++) { 6902 if (elem.options[i].selected) { 6903 selected = true; 6904 break; 6905 } 6906 } 6907 } else { 6908 for (var i = 0; i < elem.options.length; i++) { 6909 if (elem.options[i].selected && !elem.options[i].value) { 6910 selected = false; 6911 } 6912 } 6913 } 6914 if (!selected) { 6915 elem.className = elem.className + ' _has_error'; 6916 no_error = false; 6917 tooltip = create_tooltip(elem, "Please select an option."); 6918 } 6919 } else if (value === undefined || value === null || value === '') { 6920 elem.className = elem.className + ' _has_error'; 6921 no_error = false; 6922 tooltip = create_tooltip(elem, "This field is required."); 6923 } 6924 } 6925 if (no_error && elem.name == 'email') { 6926 if (!value.match(/^[\+_a-z0-9-'&=]+(\.[\+_a-z0-9-']+)*@@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,})$/i)) { 6927 elem.className = elem.className + ' _has_error'; 6928 no_error = false; 6929 tooltip = create_tooltip(elem, "Enter a valid email address."); 6930 } 6931 } 6932 if (no_error && /date_field/.test(elem.className)) { 6933 if (!value.match(/^\d\d\d\d-\d\d-\d\d$/)) { 6934 elem.className = elem.className + ' _has_error'; 6935 no_error = false; 6936 tooltip = create_tooltip(elem, "Enter a valid date."); 6937 } 6938 } 6939 tooltip ? resize_tooltip(tooltip) : false; 6940 return no_error; 6941 }; 6942 var needs_validate = function(el) { 6943 return el.name == 'email' || el.getAttribute('required') !== null; 6944 }; 6945 var validate_form = function(e) { 6946 var err = form_to_submit.querySelector('._form_error'), no_error = true; 6947 if (!submitted) { 6948 submitted = true; 6949 for (var i = 0, len = allInputs.length; i < len; i++) { 6950 var input = allInputs[i]; 6951 if (needs_validate(input)) { 6952 if (input.type == 'text') { 6953 addEvent(input, 'blur', function() { 6954 this.value = this.value.trim(); 6955 validate_field(this, true); 6956 }); 6957 addEvent(input, 'input', function() { 6958 validate_field(this, true); 6959 }); 6960 } else if (input.type == 'radio' || input.type == 'checkbox') { 6961 (function(el) { 6962 var radios = form_to_submit.elements[el.name]; 6963 for (var i = 0; i < radios.length; i++) { 6964 addEvent(radios[i], 'click', function() { 6965 validate_field(el, true); 6966 }); 6967 } 6968 })(input); 6969 } else if (input.tagName == 'SELECT') { 6970 addEvent(input, 'change', function() { 6971 validate_field(this, true); 6972 }); 6973 } else if (input.type == 'textarea'){ 6974 addEvent(input, 'input', function() { 6975 validate_field(this, true); 6976 }); 6977 } 6978 } 6979 } 6980 } 6981 remove_tooltips(); 6982 for (var i = 0, len = allInputs.length; i < len; i++) { 6983 var elem = allInputs[i]; 6984 if (needs_validate(elem)) { 6985 if (elem.tagName.toLowerCase() !== "select") { 6986 elem.value = elem.value.trim(); 6987 } 6988 validate_field(elem) ? true : no_error = false; 6989 } 6990 } 6991 if (!no_error && e) { 6992 e.preventDefault(); 6993 } 6994 resize_tooltips(); 6995 return no_error; 6996 }; 6997 addEvent(window, 'resize', resize_tooltips); 6998 addEvent(window, 'scroll', resize_tooltips); 6999 window._old_serialize = null; 7000 if (typeof serialize !== 'undefined') window._old_serialize = window.serialize; 7001 _load_script("//d3rxaij56vjege.cloudfront.net/form-serialize/0.3/serialize.min.js", function() { 7002 window._form_serialize = window.serialize; 7003 if (window._old_serialize) window.serialize = window._old_serialize; 7004 }); 7005 var form_submit = function(e) { 7006 e.preventDefault(); 7007 if (validate_form()) { 7008 // use this trick to get the submit button & disable it using plain javascript 7009 document.querySelector('#@submitForm').disabled = true; 7010 var serialized = _form_serialize(document.getElementById('@newsletterId')); 7011 var err = form_to_submit.querySelector('._form_error'); 7012 err ? err.parentNode.removeChild(err) : false; 7013 _load_script('@formAction' + '?' + serialized + '&jsonp=true'); 7014 } 7015 return false; 7016 }; 7017 addEvent(form_to_submit, 'submit', form_submit); 7018 })(); 7019 7020 </script> 7021 } 7022 } 7023 7024 @helper RenderFooterSocialLinks() 7025 { 7026 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 7027 7028 if (Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks") != null) 7029 { 7030 if (siteURL.Contains("hededanmark")) 7031 { 7032 <div class="footer__content dw-mod"> 7033 <div class="collection dw-mod"> 7034 @foreach (var socialitem in Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks")) 7035 { 7036 var socialIcon = socialitem.GetValue("Icon") as Dynamicweb.Frontend.ListViewModel; 7037 string socialIconClass = socialIcon.SelectedValue; 7038 string socialIconTitle = socialIcon.SelectedName; 7039 string socialLink = socialitem.GetString("Link"); 7040 7041 <a href="@socialLink" target="_blank" title="@socialIconTitle" class="u-margin-bottom-5px u-padding" rel="noopener"><i class="@socialIconClass fa-2x"></i></a> 7042 } 7043 </div> 7044 </div> 7045 } 7046 } 7047 } 7048 7049 @helper RenderFooterPayments() 7050 { 7051 7052 } 7053 7054 @helper RenderFooterCopyright() 7055 { 7056 7057 } 7058 7059 @* FOOTER LOGO HELPER *@ 7060 @helper RenderFooterLogo() 7061 { 7062 string firstPageId = Model.Area.FirstActivePage.ID.ToString(); 7063 7064 var footerLogo = Model.Area.Item.GetItem("Layout").GetValue("FooterLogo"); 7065 var businessName = Model.Area.Item.GetItem("Settings").GetValue("BusinessName"); 7066 string placeHolderImage = "/Files/Images/placeholder.gif"; 7067 7068 7069 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 7070 7071 7072 if (siteURL.Contains("hededanmark")) 7073 { 7074 <div class="footer__content dw-mod"> 7075 <div class="grid footer-logo-container grid--justify-center dw-mod"> 7076 <div class="dw-mod"> 7077 <a href="/Default.aspx?ID=@firstPageId"> 7078 @* FOOTER LOGO *@ 7079 @if (footerLogo != null || businessName != null) 7080 { 7081 <img class="grid__cell-img logo__img footer-logo dw-mod b-lazy" src="@placeHolderImage" data-src="@footerLogo" alt="@businessName" /> 7082 } 7083 </a> 7084 </div> 7085 </div> 7086 </div> 7087 } 7088 7089 else 7090 { 7091 <div class="footer__content dw-mod"> 7092 <div class="grid footer-logo-container grid--justify-start dw-mod"> 7093 <div class="footer-logo-hd2412 dw-mod"> 7094 <a href="/Default.aspx?ID=@firstPageId"> 7095 @* FOOTER LOGO *@ 7096 @if (footerLogo != null || businessName != null) 7097 { 7098 <img class="grid__cell-img logo__img footer-logo dw-mod b-lazy" src="@placeHolderImage" data-src="@footerLogo" alt="@businessName" /> 7099 } 7100 </a> 7101 </div> 7102 </div> 7103 </div> 7104 } 7105 } 7106 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 7107 @using System 7108 @using System.Web 7109 @using System.Collections.Generic 7110 @using Dynamicweb.Rapido.Blocks.Extensibility 7111 @using Dynamicweb.Rapido.Blocks 7112 @using Dynamicweb.Ecommerce.Common 7113 7114 @{ 7115 BlocksPage referencesBlocksPage = BlocksPage.GetBlockPage("Master"); 7116 7117 Block masterScriptReferences = new Block() 7118 { 7119 Id = "MasterScriptReferences", 7120 SortId = 1, 7121 Template = RenderMasterScriptReferences() 7122 }; 7123 referencesBlocksPage.Add(MasterBlockId.MasterReferences, masterScriptReferences); 7124 } 7125 @helper RenderMasterScriptReferences() 7126 { 7127 7128 <script src="/Files/Templates/Designs/Rapido/js/jquery-3.4.1.min.js" defer></script> 7129 7130 <script src="/Files/Templates/Designs/Rapido/js/urlsearchparamspolyfill.js" defer></script> 7131 7132 <script src="/Files/Templates/Designs/Rapido/js/mark.min.js" defer></script> 7133 7134 <script src="/Files/Templates/Designs/Rapido/js/typeahead.js" defer></script> 7135 7136 <script src="/Files/Templates/Designs/Rapido/js/handlebars-v4.0.12.min.js" defer></script> 7137 <script src="/Files/Templates/Designs/Rapido/js/master.min.js" defer></script> 7138 <script src="/Files/Templates/Designs/Rapido/js/swiper.js" defer></script> 7139 <script src="/Files/Templates/Designs/Rapido/js/jquery.prettySocial.min.js" defer></script> 7140 <script src="https://cdn.jsdelivr.net/npm/sharer.js@latest/sharer.min.js"></script> 7141 <script src="/Files/Templates/Designs/Rapido/js/jquery.toc.js" defer></script> 7142 <!-- Start of Clerk.io E-commerce Personalisation tool - www.clerk.io --> 7143 <script type="text/javascript" defer> 7144 window.__clerk_ignore_requirejs = true; 7145 window.clerkAsyncInit = function () { 7146 Clerk.config({ 7147 key: '0DWJjLtGeRI3JiUp4bAqVmmhMnUxipdN' 7148 }); 7149 }; 7150 7151 (function () { 7152 var e = document.createElement('script'); e.type = 'text/javascript'; e.async = true; 7153 e.src = document.location.protocol + '//api.clerk.io/static/clerk.js'; 7154 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(e, s); 7155 })(); 7156 </script> 7157 7158 7159 7160 7161 <!-- End of Clerk.io E-commerce Personalisation tool - www.clerk.io --> 7162 <script src="/Files/Templates/Designs/Rapido/js/jquery.combostars.min.js" defer></script> 7163 <script> 7164 // Picture element HTML5 shiv 7165 document.createElement("picture"); 7166 </script> 7167 <script src="/Files/Templates/Designs/Rapido/js/picturefill.min.js" defer></script> 7168 7169 <script src="/Files/Templates/Designs/Rapido/js/nz/main.js" defer></script> 7170 7171 if (Model.Area.Item.GetItem("Custom").GetBoolean("UseCustomJavascript")) 7172 { 7173 <script src="/Files/Templates/Designs/Rapido/js/custom.min.js" defer></script> 7174 PushPromise("/Files/Templates/Designs/Rapido/js/custom.min.js"); 7175 } 7176 7177 PushPromise("/Files/Templates/Designs/Rapido/js/nz/jquery-3.4.1.min.js"); 7178 PushPromise("/Files/Templates/Designs/Rapido/js/typeahead.js"); 7179 PushPromise("/Files/Templates/Designs/Rapido/js/mark.min.js"); 7180 PushPromise("/Files/Templates/Designs/Rapido/js/urlsearchparamspolyfill.js"); 7181 PushPromise("/Files/Templates/Designs/Rapido/js/handlebars-v4.0.12.min.js"); 7182 PushPromise("/Files/Templates/Designs/Rapido/js/master.min.js"); 7183 PushPromise("/Files/Templates/Designs/Rapido/js/swiper.js"); 7184 PushPromise("/Files/Templates/Designs/Rapido/js/jssocials.min.js"); 7185 PushPromise("/Files/Templates/Designs/Rapido/js/jquery.combostars.min.js"); 7186 PushPromise("/Files/Templates/Designs/Rapido/js/picturefill.min.js"); 7187 PushPromise("/Files/Templates/Designs/Rapido/js/jquery.toc.js"); 7188 PushPromise("/Files/Templates/Designs/Rapido/js/nz/main.js"); 7189 } 7190 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 7191 7192 @using System 7193 @using System.Web 7194 @using System.Collections.Generic 7195 @using Dynamicweb.Rapido.Blocks.Extensibility 7196 @using Dynamicweb.Rapido.Blocks 7197 7198 @{ 7199 BlocksPage searchBlocksPage = BlocksPage.GetBlockPage("Master"); 7200 bool navigationItemsHideSearch = Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("HideSearch"); 7201 7202 if (!navigationItemsHideSearch) 7203 { 7204 Block masterSearchScriptTemplates = new Block() 7205 { 7206 Id = "MasterSearchScriptTemplates", 7207 SortId = 1, 7208 Template = RenderSearchScriptTemplates() 7209 }; 7210 7211 searchBlocksPage.Add(MasterBlockId.MasterBottomSnippets, masterSearchScriptTemplates); 7212 } 7213 } 7214 7215 @helper RenderSearchScriptTemplates() 7216 { 7217 int productsPageId = GetPageIdByNavigationTag("ProductsPage"); 7218 string contentSearchPageLink = GetPageIdByNavigationTag("ContentSearchResults") + "&Areaid=" + Model.Area.ID; 7219 bool useFacebookPixel = !string.IsNullOrWhiteSpace(Pageview.AreaSettings.GetItem("Settings").GetString("FacebookPixelID")); 7220 bool onlyPreview = Model.Area.Item.GetItem("Ecommerce").GetBoolean("OnlyPreviewForAnonymous") && Model.CurrentUser.ID == 0; 7221 bool useGoogleTagManager = !string.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("GoogleTagManagerID")); 7222 bool showPrice = !Pageview.AreaSettings.GetItem("Layout").GetBoolean("HidePriceInSearchResults"); 7223 bool showAddToCartButton = !Pageview.AreaSettings.GetItem("Layout").GetBoolean("HideAddToCartButton"); 7224 bool showViewButton = !Pageview.AreaSettings.GetItem("Layout").GetBoolean("HideViewButton"); 7225 bool showAddToDownloadButton = Pageview.AreaSettings.GetItem("Layout").GetBoolean("ShowAddToDownloadButton"); 7226 bool pointShopOnly = Pageview.AreaSettings.GetItem("Ecommerce").GetBoolean("PointShopOnly"); 7227 7228 <script id="SearchGroupsTemplate" type="text/x-template"> 7229 {{#.}} 7230 <li class="dropdown__item dw-mod" onclick="Search.UpdateGroupSelection(this)" data-group-id="{{id}}">{{name}}</li> 7231 {{/.}} 7232 </script> 7233 7234 <script id="SearchProductsTemplate" type="text/x-template"> 7235 {{#each .}} 7236 {{#Product}} 7237 {{#ifCond template "!==" "SearchMore"}} 7238 <li class="dropdown__item dropdown__item--seperator dw-mod"> 7239 @if (useFacebookPixel) 7240 { 7241 <text>{{{facebookPixelSearch name number priceDouble currency searchParameter}}}</text> 7242 } 7243 @if (useGoogleTagManager) 7244 { 7245 <text>{{{googleEnchantImpression 'Search results' currency googleImpression}}}</text> 7246 } 7247 <div> 7248 <a href="{{link}}" class="js-typeahead-link u-color-inherit u-pull--left" onclick="{{googleImpressionClick}}" title="{{name}}"> 7249 <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> 7250 <div class="u-pull--left"> 7251 <div class="u-bold u-max-w220px u-truncate-text js-typeahead-name">{{name}}</div> 7252 @if (showPrice && !onlyPreview) 7253 { 7254 if (pointShopOnly) 7255 { 7256 <text> 7257 {{#if havePointPrice}} 7258 <div> 7259 <span class="u-color--loyalty-points">{{points}}</span> @Translate("points") 7260 </div> 7261 {{else}} 7262 <small class="help-text u-no-margin">@Translate("Not available")</small> 7263 {{/if}} 7264 {{#unless canBePurchasedWithPoints}} 7265 {{#if havePointPrice}} 7266 <small class="help-text u-no-margin">@Translate("Not enough points to buy this")</small> 7267 {{/if}} 7268 {{/unless}} 7269 </text> 7270 } 7271 else 7272 { 7273 <div>{{price}}</div> 7274 } 7275 } 7276 </div> 7277 </a> 7278 <div class="u-margin-left u-pull--right"> 7279 @if (showAddToCartButton && !onlyPreview) { 7280 if (pointShopOnly) 7281 { 7282 <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" 7283 onclick="Cart.AddToCart(event, { 7284 id: '{{productId}}', 7285 quantity: 1, 7286 buyForPoints: true, 7287 productInfo: {{productInfo}} 7288 }); {{facebookPixelAction}}" {{disabledBuyButton}}> 7289 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue js-ignore-click-outside"></i> 7290 </button> 7291 } else { 7292 <button type="button" class="btn btn--primary btn--condensed btn--full u-no-margin dw-mod {{hideBuyOptions}} js-ignore-click-outside" 7293 onclick="Cart.AddToCart(event, { 7294 id: '{{productId}}', 7295 quantity: 1, 7296 productInfo: {{productInfo}} 7297 }); {{facebookPixelAction}}"> 7298 <i class="@Pageview.AreaSettings.GetItem("Layout").GetItem("Icons").GetList("CartIcon").SelectedValue js-ignore-click-outside"></i> 7299 </button> 7300 } 7301 <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> 7302 } 7303 else if (showViewButton) 7304 { 7305 <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> 7306 } 7307 @if (showAddToDownloadButton) 7308 { 7309 <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}}"> 7310 <i class="fas fa-plus js-button-icon"></i> 7311 </button> 7312 } 7313 </div> 7314 </div> 7315 </li> 7316 {{/ifCond}} 7317 {{#ifCond template "===" "SearchMore"}} 7318 {{>SearchMoreProducts}} 7319 {{/ifCond}} 7320 {{/Product}} 7321 {{else}} 7322 <li class="dropdown__item dropdown__item--seperator dw-mod"> 7323 @Translate("Your search gave 0 results") 7324 </li> 7325 {{/each}} 7326 </script> 7327 7328 <script id="SearchMoreProducts" type="text/x-template"> 7329 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 7330 <a href="/Default.aspx?ID=@productsPageId&Search={{searchParameter}}&GroupID={{groupId}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 7331 @Translate("View all") 7332 </a> 7333 </li> 7334 </script> 7335 7336 <script id="SearchMorePages" type="text/x-template"> 7337 {{#ifCond activeTo "<" currentTime}} 7338 7339 <li class="dropdown__item dropdown__item--not-selectable {{stickToBottom}} dw-mod"> 7340 <a href="/Default.aspx?ID=@contentSearchPageLink&Search={{searchParameter}}" class="btn btn--primary btn--full u-no-margin dw-mod js-typeahead-link"> 7341 @Translate("View all") 7342 </a> 7343 </li> 7344 {{/ifCond}} 7345 7346 </script> 7347 7348 <script id="SearchPagesTemplate" type="text/x-template"> 7349 {{#each .}} 7350 {{#ifCond template "!==" "SearchMore"}} 7351 {{#ifCond activeTo ">=" currentTime}} 7352 7353 <li class="dropdown__item dropdown__item--seperator dw-mod"> 7354 <div> 7355 <a href="/Default.aspx?ID={{id}}" class="js-typeahead-link u-pull--left u-color-inherit"> 7356 <div class="u-margin-right u-pull--left"><i class="fa {{icon}} u-w20px u-ta-center"></i></div> 7357 <div class="u-pull--left"> 7358 <div class="u-bold u-truncate-text u-max-w220px js-typeahead-name">{{name}}</div> 7359 </div> 7360 </a> 7361 </div> 7362 </li> 7363 {{/ifCond}} 7364 7365 7366 {{/ifCond}} 7367 {{#ifCond totalPagesItem "<=" 1 }} 7368 7369 {{#ifCond activeTo "<" currentTime}} 7370 <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable dw-mod"> 7371 @Translate("Your search gave 0 results") 7372 </li> 7373 {{/ifCond}} 7374 {{/ifCond}} 7375 7376 {{#ifCond template "===" "SearchMore"}} 7377 {{#ifCond activeTo ">=" currentTime}} 7378 7379 {{>SearchMorePages}} 7380 {{/ifCond}} 7381 7382 {{/ifCond}} 7383 7384 {{else}} 7385 <li class="dropdown__item dropdown__item--seperator dropdown__item--not-selectable dw-mod"> 7386 @Translate("Your search gave 0 results") 7387 </li> 7388 7389 7390 {{/each}} 7391 </script> 7392 7393 <script id="SearchPagesTemplateWrap" type="text/x-template"> 7394 <div class="dropdown__column-header">@Translate("Pages")</div> 7395 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 7396 7397 {{>SearchPagesTemplate}} 7398 </ul> 7399 </script> 7400 7401 <script id="SearchProductsTemplateWrap" type="text/x-template"> 7402 <div class="dropdown__column-header">@Translate("Products")</div> 7403 <ul class="dropdown__list u-min-w220px u-full-width u-margin-bottom dw-mod"> 7404 {{>SearchProductsTemplate}} 7405 </ul> 7406 </script> 7407 } 7408 7409 7410 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 7411 7412 @using System 7413 @using System.Web 7414 @using System.Collections.Generic 7415 @using Dynamicweb.Rapido.Blocks.Extensibility 7416 @using Dynamicweb.Rapido.Blocks 7417 7418 @{ 7419 BlocksPage bottomSnippetsBlocksPage = BlocksPage.GetBlockPage("Master"); 7420 7421 Block primaryBottomSnippets = new Block() 7422 { 7423 Id = "MasterJavascriptInitializers", 7424 SortId = 100, 7425 Template = RenderPrimaryBottomSnippets() 7426 }; 7427 bottomSnippetsBlocksPage.Add(MasterBlockId.MasterReferences, primaryBottomSnippets); 7428 } 7429 7430 @helper RenderPrimaryBottomSnippets() { 7431 bool isWireframeMode = Model.Area.Item.GetItem("Settings").GetBoolean("WireframeMode"); 7432 bool useGoogleTagManager = !string.IsNullOrEmpty(Pageview.AreaSettings.GetItem("Settings").GetString("GoogleTagManagerID")); 7433 7434 if (isWireframeMode) 7435 { 7436 <script> 7437 Wireframe.Init(true); 7438 </script> 7439 } 7440 7441 7442 if (useGoogleTagManager) 7443 { 7444 <script> 7445 document.addEventListener('addToCart', function(event) { 7446 var googleImpression = event.detail.productInfo.googleImpression; 7447 dataLayer.push({ 7448 'event': 'addToCart', 7449 'ecommerce': { 7450 'currencyCode': '@Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency().Code', 7451 'add': { 7452 'products': [{ 7453 'name': googleImpression.name, 7454 'id': googleImpression.id, 7455 'price': googleImpression.price, 7456 'brand': googleImpression.brand, 7457 'category': googleImpression.category, 7458 'variant': googleImpression.variant, 7459 'quantity': event.detail.quantity 7460 }] 7461 } 7462 } 7463 }); 7464 }); 7465 </script> 7466 } 7467 7468 //if digitalwarehouse 7469 if (Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("ShowDownloadCart")) 7470 { 7471 string cartContextId = Converter.ToString(HttpContext.Current.Application["DownloadCartContext"]); 7472 7473 if (string.IsNullOrEmpty(cartContextId)) { 7474 var moduleProps = Dynamicweb.Modules.Properties.GetParagraphModuleSettings(GetPageIdByNavigationTag("DownloadCart"), "eCom_CartV2"); 7475 var cartSettings = new Dynamicweb.Ecommerce.Cart.ModuleSettings(moduleProps); 7476 cartContextId = cartSettings.OrderContextID; 7477 HttpContext.Current.Application["DownloadCartContext"] = cartContextId; 7478 } 7479 7480 <script> 7481 let downloadCart = new DownloadCart({ 7482 cartPageId: @GetPageIdByNavigationTag("MiniCartFeed"), 7483 contextId: "@cartContextId", 7484 addButtonText: "@Translate("Add")", 7485 removeButtonText: "@Translate("Remove")" 7486 }); 7487 </script> 7488 } 7489 7490 <!--@Javascripts--> 7491 } 7492 @if (File.Exists(HttpContext.Current.Server.MapPath("/MasterBlocks/Custom__Blocks.cshtml"))) { 7493 <text>@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 7494 7495 @using System 7496 @using System.Web 7497 @using System.Collections.Generic 7498 @using Dynamicweb.Rapido.Blocks 7499 7500 @{ 7501 BlocksPage masterCustomBlocksPage = BlocksPage.GetBlockPage("Master"); 7502 7503 }</text> 7504 } 7505 7506 7507 @functions { 7508 public class ManifestIcon 7509 { 7510 public string src { get; set; } 7511 public string type { get; set; } 7512 public string sizes { get; set; } 7513 } 7514 7515 public class Manifest 7516 { 7517 public string name { get; set; } 7518 public string short_name { get; set; } 7519 public string start_url { get; set; } 7520 public string display { get; set; } 7521 public string background_color { get; set; } 7522 public string theme_color { get; set; } 7523 public List<ManifestIcon> icons { get; set; } 7524 } 7525 } 7526 @{ 7527 if (!String.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("AppName")) && Model.Area.Item.GetItem("Settings").GetFile("AppIcon") != null) { 7528 Manifest manifest = new Manifest { 7529 name = Model.Area.Item.GetItem("Settings").GetString("AppName"), 7530 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"), 7531 start_url = "/", 7532 display = "standalone", 7533 background_color = Model.Area.Item.GetItem("Settings").GetString("AppBackgroundColor"), 7534 theme_color = Model.Area.Item.GetItem("Settings").GetString("AppThemeColor") 7535 }; 7536 7537 manifest.icons = new List<ManifestIcon> { 7538 new ManifestIcon { 7539 src = "/Admin/Public/GetImage.ashx?width=192&height=192&crop=5&image=" + Model.Area.Item.GetItem("Settings").GetFile("AppIcon").PathUrlEncoded, 7540 sizes = "192x192", 7541 type = "image/png" 7542 }, 7543 new ManifestIcon { 7544 src = "/Admin/Public/GetImage.ashx?width=512&height=512&crop=5&image=" + Model.Area.Item.GetItem("Settings").GetFile("AppIcon").PathUrlEncoded, 7545 sizes = "512x512", 7546 type = "image/png" 7547 }, 7548 new ManifestIcon { 7549 src = "/Admin/Public/GetImage.ashx?width=1024&height=1024&crop=5&image=" + Model.Area.Item.GetItem("Settings").GetFile("AppIcon").PathUrlEncoded, 7550 sizes = "1024x1024", 7551 type = "image/png" 7552 } 7553 }; 7554 7555 string manifestFilePath = HttpContext.Current.Request.MapPath("/Files/Templates/Designs/Rapido/manifest.json"); 7556 string manifestJSON = Newtonsoft.Json.JsonConvert.SerializeObject(manifest); 7557 string currentManifest = File.ReadAllText(manifestFilePath); 7558 7559 if (manifestJSON != currentManifest) { 7560 File.WriteAllText(manifestFilePath, manifestJSON); 7561 } 7562 } 7563 } 7564 7565 @{ 7566 var swatches = new Dynamicweb.Content.Items.ColorSwatchService(); 7567 var brandColors = swatches.GetColorSwatch(1); 7568 string brandColorOne = brandColors.Palette["BrandColor1"]; 7569 } 7570 7571 <!DOCTYPE html> 7572 7573 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 7574 <head> 7575 <meta http-equiv="Accept-CH" content="DPR, Viewport-Width, Width"> 7576 7577 <!-- Rapido version 3.1 --> 7578 <meta charset="utf-8" /> 7579 <title>@Model.Title</title> 7580 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 7581 7582 7583 @if (Dynamicweb.Context.Current.Request.Url.Host.EndsWith("nozebrahosting.dk") || Dynamicweb.Context.Current.Request.Url.Host.EndsWith("dynamicweb.dk")) 7584 { 7585 <meta name="robots" content="noindex, nofollow"> 7586 } 7587 7588 @{ 7589 var noFollowBool = Pageview.Page.Nofollow; 7590 var noIndexBool = Pageview.Page.Noindex; 7591 } 7592 7593 @if (noIndexBool && noFollowBool) 7594 { 7595 <meta name="robots" content="noindex, nofollow"> 7596 } 7597 else if (noFollowBool) 7598 { 7599 <meta name="robots" content="nofollow"> 7600 } 7601 else if (noIndexBool) 7602 { 7603 <meta name="robots" content="noindex"> 7604 } 7605 7606 7607 <meta name="theme-color" content="@brandColorOne" /> 7608 7609 <meta name="description" content="@Pageview.Page.Description"> 7610 <meta name="keywords" content="@Pageview.Page.Keywords"> 7611 7612 <!-- Open Graph --> 7613 7614 <meta property="og:type" content="@ogType" /> 7615 <meta property="og:site_name" content="@businessName"> 7616 <meta property="og:title" content="@ogTitle" /> 7617 <meta property="og:description" content="@ogDesc" /> 7618 <meta property="og:url" content="@siteURL" /> 7619 <meta property="og:image" content="@domainUrl@ogImage" /> 7620 7621 @*CANONICAL CODE - MADE A CHECK TO SEE IF THE URL HAS A "?" *@ 7622 7623 @{ 7624 var allKeys = Dynamicweb.Context.Current.Request.QueryString.AllKeys.Length; 7625 7626 } 7627 7628 7629 7630 <link rel="canonical" href="@siteURL"> 7631 7632 <style> 7633 html { 7634 font-family: sans-serif; 7635 line-height: 1.15 7636 } 7637 7638 body { 7639 margin: 0 7640 } 7641 7642 header, nav, section { 7643 display: block 7644 } 7645 7646 h1 { 7647 font-size: 2em; 7648 margin: .67em 0 7649 } 7650 7651 main { 7652 display: block 7653 } 7654 7655 a { 7656 background-color: transparent 7657 } 7658 7659 img { 7660 border-style: none 7661 } 7662 7663 svg:not(:root) { 7664 overflow: hidden 7665 } 7666 7667 button, input { 7668 font-family: inherit; 7669 font-size: inherit; 7670 font-style: inherit; 7671 font-variant: inherit; 7672 font-weight: inherit; 7673 line-height: inherit; 7674 margin: 0 7675 } 7676 7677 button, input { 7678 overflow: visible 7679 } 7680 7681 button { 7682 text-transform: none 7683 } 7684 7685 button, [type="submit"] { 7686 -webkit-appearance: button 7687 } 7688 7689 [type="checkbox"] { 7690 box-sizing: border-box; 7691 padding: 0 7692 } 7693 7694 *::-webkit-file-upload-button { 7695 -webkit-appearance: button; 7696 font-family: inherit; 7697 font-size: inherit; 7698 font-style: inherit; 7699 font-variant: inherit; 7700 font-weight: inherit; 7701 line-height: inherit 7702 } 7703 7704 html { 7705 box-sizing: border-box; 7706 font-size: 62.5%; 7707 height: 100%; 7708 overflow-y: scroll 7709 } 7710 7711 *, ::before, ::after { 7712 box-sizing: inherit 7713 } 7714 7715 body { 7716 font-size: 1.6rem; 7717 line-height: 2.4rem; 7718 font-weight: 400; 7719 font-family: Roboto,Helvetica,Arial,sans-serif; 7720 color: rgb(34,34,34) 7721 } 7722 7723 a { 7724 color: rgb(34,34,34); 7725 text-decoration: none; 7726 word-wrap: break-word 7727 } 7728 7729 ul { 7730 list-style: circle none 7731 } 7732 7733 ul { 7734 padding-left: 0; 7735 margin-top: 0 7736 } 7737 7738 ul ul { 7739 margin: 1.5rem 0 1.5rem 3rem 7740 } 7741 7742 li { 7743 margin-bottom: 1rem 7744 } 7745 7746 img { 7747 display: table; 7748 max-width: 100% 7749 } 7750 7751 input[type="text"], input[type="password"] { 7752 background-color: rgb(255,255,255); 7753 border: 1px solid rgb(209,209,209); 7754 box-shadow: none; 7755 box-sizing: border-box; 7756 height: 38px; 7757 padding: 6px 10px; 7758 -webkit-appearance: none 7759 } 7760 7761 label { 7762 display: block; 7763 margin-bottom: .5rem 7764 } 7765 7766 input[type="checkbox"] { 7767 display: inline 7768 } 7769 7770 h1, h2 { 7771 margin-top: 0; 7772 margin-bottom: 2rem; 7773 font-weight: 300; 7774 word-wrap: break-word; 7775 color: rgb(34,34,34) 7776 } 7777 7778 h1 { 7779 font-size: 4rem; 7780 line-height: 1.2 7781 } 7782 7783 h2 { 7784 font-size: 3.6rem; 7785 line-height: 1.25 7786 } 7787 7788 p { 7789 margin-top: 0 7790 } 7791 7792 div, p { 7793 letter-spacing: normal; 7794 word-spacing: normal; 7795 white-space: normal 7796 } 7797 7798 button, input { 7799 margin-bottom: 1.4rem 7800 } 7801 7802 form, p, ul { 7803 margin-bottom: 2.4rem 7804 } 7805 7806 li { 7807 margin-bottom: 1rem 7808 } 7809 7810 label { 7811 margin-bottom: .25rem 7812 } 7813 7814 .btn { 7815 background-color: transparent; 7816 border-top-left-radius: 0; 7817 border-top-right-radius: 0; 7818 border-bottom-right-radius: 0; 7819 border-bottom-left-radius: 0; 7820 border: 1px solid rgb(187,187,187); 7821 color: inherit; 7822 display: inline-block; 7823 font-size: inherit; 7824 font-weight: 500; 7825 letter-spacing: .1rem; 7826 line-height: 20px; 7827 min-height: 38px; 7828 margin-bottom: 1em; 7829 padding: 8px 30px; 7830 text-align: center; 7831 text-decoration: none; 7832 vertical-align: top; 7833 word-break: break-all 7834 } 7835 7836 .btn--primary { 7837 color: rgb(255,255,255); 7838 background-color: rgb(84,84,84); 7839 border-color: rgb(84,84,84) 7840 } 7841 7842 .btn--full { 7843 width: 100% 7844 } 7845 7846 .btn--link { 7847 border: none; 7848 background-color: transparent 7849 } 7850 7851 .btn--link-clean { 7852 border: none; 7853 background-color: transparent; 7854 padding: 0; 7855 margin: 0; 7856 height: auto; 7857 line-height: 1.4; 7858 min-height: 100% 7859 } 7860 7861 .dropdown { 7862 position: relative; 7863 display: inline-block; 7864 text-align: left 7865 } 7866 7867 .dropdown.dropdown--absolute-position { 7868 list-style: none; 7869 z-index: 70; 7870 background-color: rgb(255,255,255); 7871 position: absolute; 7872 top: 100%; 7873 left: 0; 7874 box-shadow: rgba(0,0,0,.239216) 0 6px 12px; 7875 margin: 0 7876 } 7877 7878 .modal-container { 7879 z-index: 10000; 7880 position: fixed; 7881 top: 0; 7882 right: 0; 7883 bottom: 0; 7884 left: 0; 7885 display: none 7886 } 7887 7888 .modal-overlay { 7889 background-color: rgba(0,0,0,.498039); 7890 width: 100%; 7891 height: 100%; 7892 position: fixed; 7893 z-index: 100; 7894 left: 0; 7895 top: 0 7896 } 7897 7898 .modal { 7899 background-color: rgb(255,255,255); 7900 z-index: 10000; 7901 max-width: calc(100% - 5em); 7902 max-height: calc(100% - 5em); 7903 overflow-y: auto; 7904 position: relative 7905 } 7906 7907 .modal h2 { 7908 margin: 0 7909 } 7910 7911 .modal--xs { 7912 width: 280px 7913 } 7914 7915 .modal__header { 7916 padding: .5em 1em; 7917 border-bottom-width: 1px; 7918 border-bottom-style: solid; 7919 border-bottom-color: rgb(211,211,211) 7920 } 7921 7922 .modal__body { 7923 padding: 1em; 7924 overflow-x: auto 7925 } 7926 7927 .modal-trigger { 7928 display: none !important 7929 } 7930 7931 .form__field-group { 7932 margin-bottom: 1em; 7933 position: relative 7934 } 7935 7936 .form__field-group input { 7937 margin-bottom: 0 7938 } 7939 7940 .form__field-group > * { 7941 width: 100% 7942 } 7943 7944 .form__field-group > [for], .form__field-group > [type="checkbox"] { 7945 display: inline; 7946 width: auto 7947 } 7948 7949 .field-error { 7950 color: rgb(195,66,63); 7951 font-size: 1.47rem; 7952 margin-top: 5px 7953 } 7954 7955 input[type="checkbox"].form__control { 7956 display: inline; 7957 position: absolute; 7958 opacity: 0; 7959 width: auto; 7960 height: 0; 7961 margin: 0 7962 } 7963 7964 input[type="checkbox"].form__control + label { 7965 position: relative; 7966 line-height: 17px; 7967 display: inline-block 7968 } 7969 7970 input[type="checkbox"].form__control + label::before { 7971 content: ''; 7972 width: 17px; 7973 height: 17px; 7974 border: 1px solid rgb(209,209,209); 7975 display: inline-block; 7976 margin-right: 5px; 7977 vertical-align: top 7978 } 7979 7980 input[type="checkbox"].form__control:checked + label::after { 7981 content: ''; 7982 height: 5px; 7983 width: 10px; 7984 border-left-width: 2px; 7985 border-left-color: rgb(84,84,84); 7986 border-left-style: solid; 7987 border-bottom-width: 2px; 7988 border-bottom-color: rgb(84,84,84); 7989 border-bottom-style: solid; 7990 left: 4px; 7991 top: 5px; 7992 display: inline-block; 7993 position: absolute 7994 } 7995 7996 .b-lazy { 7997 max-width: 100%; 7998 opacity: 0 7999 } 8000 8001 .background-image { 8002 position: absolute; 8003 top: 0; 8004 bottom: 0; 8005 left: 0; 8006 right: 0 8007 } 8008 8009 .background-image::after { 8010 content: ''; 8011 position: absolute; 8012 top: 0; 8013 bottom: 0; 8014 left: 0; 8015 right: 0; 8016 background-color: inherit 8017 } 8018 8019 .background-image__wrapper { 8020 position: absolute; 8021 width: 100%; 8022 height: 100%; 8023 top: 0; 8024 overflow: hidden 8025 } 8026 8027 .background-image__cover { 8028 height: 100%; 8029 display: block; 8030 max-width: 100%; 8031 width: 100% 8032 } 8033 8034 .image { 8035 position: relative; 8036 top: 0; 8037 bottom: 0; 8038 left: 0; 8039 right: 0 8040 } 8041 8042 .image::after { 8043 content: ''; 8044 position: absolute; 8045 top: 0; 8046 bottom: 0; 8047 left: 0; 8048 right: 0; 8049 background-color: inherit 8050 } 8051 8052 .image-filter { 8053 overflow: hidden 8054 } 8055 8056 .typeahead { 8057 position: relative; 8058 z-index: 70; 8059 color: rgb(34,34,34); 8060 max-width: 600px; 8061 width: 100% 8062 } 8063 8064 .typeahead-search-field { 8065 margin: 0; 8066 border-top-left-radius: 0; 8067 border-top-right-radius: 0; 8068 border-bottom-right-radius: 0; 8069 border-bottom-left-radius: 0; 8070 position: relative 8071 } 8072 8073 @@media (max-width:479px) { 8074 .u-hidden-xxs { 8075 display: none !important 8076 } 8077 } 8078 8079 .grid { 8080 display: -webkit-flex; 8081 zoom: 1; 8082 -webkit-flex-wrap: wrap; 8083 padding: 0; 8084 margin: 0; 8085 position: relative; 8086 width: 100%; 8087 max-width: 100%; 8088 list-style-type: none; 8089 word-spacing: -0.43em !important 8090 } 8091 8092 .grid::before, .grid::after { 8093 letter-spacing: normal; 8094 word-spacing: normal; 8095 white-space: normal; 8096 max-width: 100% 8097 } 8098 8099 .grid ::before, .grid ::after { 8100 letter-spacing: normal; 8101 word-spacing: normal; 8102 white-space: normal 8103 } 8104 8105 .grid .grid { 8106 -webkit-flex: 1 1 auto 8107 } 8108 8109 .grid * { 8110 box-sizing: border-box 8111 } 8112 8113 .grid ::before, .grid ::after { 8114 box-sizing: border-box 8115 } 8116 8117 [class*="grid__col-"] { 8118 display: -webkit-flex; 8119 zoom: 1; 8120 -webkit-flex-direction: column; 8121 letter-spacing: normal; 8122 word-spacing: normal; 8123 white-space: normal; 8124 position: relative; 8125 width: 100%; 8126 vertical-align: top; 8127 padding: .5em 8128 } 8129 8130 .grid__cell { 8131 position: relative; 8132 display: block; 8133 -webkit-flex: 1 1 auto 8134 } 8135 8136 .grid__col-1 { 8137 width: 8.33333333% 8138 } 8139 8140 @@media (min-width:480px) { 8141 .grid__col-xs-12 { 8142 width: 100% 8143 } 8144 } 8145 8146 @@media (min-width:768px) { 8147 .grid__col-sm-12 { 8148 width: 100% 8149 } 8150 8151 .grid__col-sm-4 { 8152 width: 33.33333333% 8153 } 8154 } 8155 8156 @@media (min-width:992px) { 8157 .grid__col-md-12 { 8158 width: 100% 8159 } 8160 8161 .grid__col-md-6 { 8162 width: 50% 8163 } 8164 8165 .grid__col-md-3 { 8166 width: 25% 8167 } 8168 } 8169 8170 @@media (min-width:1200px) { 8171 .grid__col-lg-6 { 8172 width: 50% 8173 } 8174 8175 .grid__col-lg-3 { 8176 width: 25% 8177 } 8178 } 8179 8180 @@media (min-width:992px) { 8181 .grid__col-md-auto { 8182 -webkit-flex: 1 0 0; 8183 width: 0 8184 } 8185 8186 .grid__col-md-auto-width { 8187 width: auto 8188 } 8189 } 8190 8191 @@media (min-width:1200px) { 8192 .grid__col-lg-auto { 8193 -webkit-flex: 1 0 0; 8194 width: 0 8195 } 8196 8197 .grid__col-lg-auto-width { 8198 width: auto 8199 } 8200 } 8201 8202 .grid--wrap { 8203 -webkit-flex-wrap: wrap 8204 } 8205 8206 .grid--align-content-start { 8207 -webkit-align-content: flex-start 8208 } 8209 8210 .grid--align-self-end { 8211 -webkit-align-self: flex-end; 8212 vertical-align: bottom 8213 } 8214 8215 .grid--align-self-center { 8216 -webkit-align-self: center; 8217 vertical-align: middle 8218 } 8219 8220 .grid--justify-end { 8221 text-align: right; 8222 -webkit-justify-content: flex-end 8223 } 8224 8225 .grid--justify-end .grid__cell, .grid--justify-end [class*="grid__col-"] { 8226 text-align: initial 8227 } 8228 8229 .grid--justify-center { 8230 text-align: center; 8231 -webkit-justify-content: center 8232 } 8233 8234 .grid--justify-center .grid__cell, .grid--justify-center [class*="grid__col-"] { 8235 text-align: initial 8236 } 8237 8238 .grid__col--bleed { 8239 padding: 0 8240 } 8241 8242 .grid__col--bleed-x { 8243 padding: .5em 0 8244 } 8245 8246 .grid__cell-img { 8247 display: -webkit-flex; 8248 -webkit-flex: 0 0 auto; 8249 margin-left: 0; 8250 margin-right: 0; 8251 max-width: 100%; 8252 height: auto 8253 } 8254 8255 .grid__cell-img--centered { 8256 width: auto; 8257 margin: 0 auto 8258 } 8259 8260 .grid__cell-footer { 8261 display: -webkit-flex; 8262 zoom: 1; 8263 width: 100%; 8264 margin-top: auto 8265 } 8266 8267 .site { 8268 left: 0; 8269 position: relative; 8270 width: 100vw; 8271 max-width: 100% 8272 } 8273 8274 .page { 8275 min-height: 500px 8276 } 8277 8278 .top-container__center-container { 8279 padding: 0 1em 8280 } 8281 8282 .top-container--sticky { 8283 width: 100%; 8284 position: fixed; 8285 top: 0; 8286 z-index: 90 8287 } 8288 8289 .center-container { 8290 margin: 0 auto; 8291 max-width: 1280px; 8292 position: relative; 8293 width: 100%; 8294 height: 100%; 8295 box-sizing: border-box 8296 } 8297 8298 .paragraph-container { 8299 padding: 1em 8300 } 8301 8302 .paragraph-container p:last-of-type { 8303 margin-bottom: .25em 8304 } 8305 8306 .paragraph-container--full-width { 8307 width: 100vw; 8308 position: relative; 8309 left: 50%; 8310 right: 50%; 8311 margin-left: -50vw 8312 } 8313 8314 .paragraph-container--height-xl { 8315 height: 550px 8316 } 8317 8318 .paragraph-container--height-xl > .paragraph-container { 8319 height: 550px 8320 } 8321 8322 .paragraph-container--height-auto { 8323 min-height: 60px 8324 } 8325 8326 .paragraph-container--height-auto > .paragraph-container { 8327 min-height: 60px 8328 } 8329 8330 .paragraph-container__button { 8331 margin-top: 1em 8332 } 8333 8334 .multiple-paragraphs-container { 8335 position: relative 8336 } 8337 8338 .multiple-paragraphs-container h2 { 8339 color: inherit 8340 } 8341 8342 .multiple-paragraphs-container p { 8343 color: inherit 8344 } 8345 8346 .multiple-paragraphs-container--spacing-none { 8347 padding-top: 0; 8348 padding-bottom: 0 8349 } 8350 8351 .multiple-paragraphs-container--spacing-lg { 8352 padding-top: 1em; 8353 padding-bottom: 1em 8354 } 8355 8356 @@media (max-width:768px) { 8357 .top-container__center-container { 8358 padding: 0 .5em 8359 } 8360 8361 .paragraph-container { 8362 padding: 1em .5em 8363 } 8364 } 8365 8366 .logo { 8367 margin: .5em .5em .5em 0 8368 } 8369 8370 .main-navigation { 8371 box-sizing: border-box; 8372 background-color: rgb(228,228,228); 8373 z-index: 10; 8374 position: relative 8375 } 8376 8377 .menu { 8378 list-style: none; 8379 margin: 0; 8380 padding: 0; 8381 white-space: nowrap 8382 } 8383 8384 .menu--dropdown { 8385 background-color: rgb(246,246,246); 8386 box-shadow: rgba(0,0,0,.172549) 0 3px 6px; 8387 z-index: 10000; 8388 position: absolute; 8389 top: 100%; 8390 left: 0; 8391 display: none; 8392 line-height: 1.4; 8393 min-width: 100%; 8394 padding: .5em 0; 8395 margin-top: 3px 8396 } 8397 8398 .menu--dropdown-right { 8399 background-color: rgb(246,246,246); 8400 box-shadow: rgba(0,0,0,.172549) 0 3px 6px; 8401 z-index: 10000; 8402 position: absolute; 8403 top: 100%; 8404 display: none; 8405 line-height: 1.4; 8406 min-width: 100%; 8407 padding: .5em 0; 8408 margin-top: 3px; 8409 left: auto; 8410 right: 0 8411 } 8412 8413 .menu__item { 8414 position: relative; 8415 padding: 0; 8416 margin: 0; 8417 color: rgb(34,34,34); 8418 text-align: left 8419 } 8420 8421 .menu__item--horizontal { 8422 float: left 8423 } 8424 8425 .menu__item--top-level { 8426 float: left; 8427 border-top-width: 3px; 8428 border-top-style: solid; 8429 border-top-color: rgb(228,228,228); 8430 border-bottom-width: 3px; 8431 border-bottom-style: solid; 8432 border-bottom-color: rgb(228,228,228); 8433 text-align: center 8434 } 8435 8436 .menu__link { 8437 display: block; 8438 text-decoration: none; 8439 white-space: nowrap; 8440 padding: 16px .5em; 8441 font-size: 1.6rem; 8442 color: rgb(34,34,34); 8443 float: left; 8444 line-height: 30px 8445 } 8446 8447 .menu__link.menu__link--icon { 8448 margin-bottom: 0; 8449 line-height: 33px; 8450 color: rgb(34,34,34); 8451 position: relative 8452 } 8453 8454 .is-dropdown::after { 8455 font-family: 'Font Awesome 5 Pro','Font Awesome 5 Free'; 8456 font-weight: 900; 8457 content: '\F107'; 8458 display: inline-block; 8459 line-height: 42px; 8460 padding-right: .5em 8461 } 8462 8463 .is-dropdown--no-icon::after { 8464 font-family: ''; 8465 content: ''; 8466 padding: 0 8467 } 8468 8469 .menu-dropdown__item { 8470 display: block; 8471 text-decoration: none; 8472 white-space: nowrap; 8473 color: rgb(34,34,34); 8474 padding: .5em; 8475 line-height: 1.4; 8476 text-align: left 8477 } 8478 8479 .menu__item--mega { 8480 position: static; 8481 text-align: left 8482 } 8483 8484 .mega-menu { 8485 background-color: rgb(246,246,246); 8486 z-index: 10000; 8487 position: absolute; 8488 top: 100%; 8489 left: 1em; 8490 display: none; 8491 box-shadow: rgba(0,0,0,.172549) 0 3px 6px; 8492 width: calc(100% - (2 * 1em)); 8493 max-width: 1280px 8494 } 8495 8496 .mega-menu__list-wrap { 8497 padding: 0 .5em; 8498 margin-bottom: 1em 8499 } 8500 8501 .mega-menu__grid .grid__col-md-3:nth-child(4n) .mega-menu__list-wrap { 8502 border-right-width: 0 8503 } 8504 8505 .mega-menu__header-container { 8506 margin: 0 .5em 8507 } 8508 8509 .mega-menu__header-container__text { 8510 display: block; 8511 text-decoration: none; 8512 font-size: 1.6rem; 8513 color: rgb(34,34,34); 8514 margin-top: 0; 8515 padding: .5em; 8516 line-height: 1.2 8517 } 8518 8519 .is-mega::after { 8520 font-family: 'Font Awesome 5 Pro','Font Awesome 5 Free'; 8521 font-weight: 900; 8522 content: '\F107'; 8523 display: inline-block; 8524 line-height: 42px; 8525 padding-right: .5em; 8526 float: right 8527 } 8528 8529 html, body { 8530 overflow-x: hidden 8531 } 8532 8533 .tools-navigation { 8534 background-color: rgb(255,255,255) 8535 } 8536 8537 .u-full-width { 8538 width: 100%; 8539 max-width: 100% 8540 } 8541 8542 .u-full-max-width { 8543 max-width: 100% 8544 } 8545 8546 .u-flex { 8547 display: -webkit-flex 8548 } 8549 8550 .u-block { 8551 display: block 8552 } 8553 8554 .u-ta-center { 8555 text-align: center 8556 } 8557 8558 .u-color-light { 8559 color: rgb(255,255,255) 8560 } 8561 8562 .u-color-dark { 8563 color: rgb(42,42,42) 8564 } 8565 8566 .u-w380px { 8567 width: 380px 8568 } 8569 8570 .u-min-w220px { 8571 min-width: 220px 8572 } 8573 8574 .u-no-padding { 8575 padding: 0 8576 } 8577 8578 .u-no-margin { 8579 margin: 0 8580 } 8581 8582 .u-margin-top { 8583 margin-top: .5em 8584 } 8585 8586 .u-margin-right { 8587 margin-right: .5em 8588 } 8589 8590 .u-margin-bottom { 8591 margin-bottom: .5em 8592 } 8593 8594 .u-margin-bottom--lg { 8595 margin-bottom: 1em 8596 } 8597 8598 .u-padding { 8599 padding: .5em 8600 } 8601 8602 .u-padding-bottom--lg { 8603 padding-bottom: 1em 8604 } 8605 8606 a { 8607 color: rgb(0,133,202); 8608 text-decoration: none; 8609 word-wrap: break-word 8610 } 8611 8612 h1 { 8613 font-family: Lato,sans-serif; 8614 font-size: 35px; 8615 font-weight: 900; 8616 line-height: 1.2; 8617 color: rgb(0,0,0) 8618 } 8619 8620 h2 { 8621 font-family: Lato,sans-serif; 8622 font-size: 26px; 8623 font-weight: 900; 8624 line-height: 1.2; 8625 color: rgb(51,51,51) 8626 } 8627 8628 body { 8629 font-family: Lato,sans-serif; 8630 font-size: 18px; 8631 line-height: 1.4; 8632 color: rgb(51,51,51) 8633 } 8634 8635 a { 8636 color: rgb(0,168,74) 8637 } 8638 8639 .btn--primary.dw-mod { 8640 color: rgb(255,255,255); 8641 font-size: 15px; 8642 font-weight: 700; 8643 line-height: 36px; 8644 border-width: 1px; 8645 border-color: rgb(0,168,74); 8646 border-top-left-radius: .2rem; 8647 border-top-right-radius: .2rem; 8648 border-bottom-right-radius: .2rem; 8649 border-bottom-left-radius: .2rem; 8650 background-color: rgb(0,168,74) 8651 } 8652 8653 .btn--link.dw-mod { 8654 color: rgb(0,168,74) 8655 } 8656 8657 .center-container.dw-mod { 8658 max-width: 1280px 8659 } 8660 8661 .site.dw-mod { 8662 background-color: rgb(255,255,255) 8663 } 8664 8665 .logo.dw-mod:not(.logo--mobile) { 8666 background-color: transparent 8667 } 8668 8669 .logo__img.dw-mod:not(.logo__img--mobile) { 8670 height: 75px 8671 } 8672 8673 .main-navigation.dw-mod { 8674 background-color: rgb(255,255,255) 8675 } 8676 8677 .menu--dropdown.dw-mod { 8678 background-color: rgb(243,249,245) 8679 } 8680 8681 .is-dropdown.dw-mod::after { 8682 color: rgb(0,0,0); 8683 font-size: 16px; 8684 line-height: 2.4em 8685 } 8686 8687 .menu-dropdown__item.dw-mod { 8688 color: rgb(0,0,0); 8689 font-size: 16px 8690 } 8691 8692 .mega-menu.dw-mod { 8693 background-color: rgb(243,249,245); 8694 max-width: 1280px 8695 } 8696 8697 .mega-menu__header-container__text.dw-mod { 8698 color: rgb(0,166,75); 8699 font-size: 1.6rem; 8700 font-family: Lato,sans-serif; 8701 text-transform: uppercase 8702 } 8703 8704 .is-mega.dw-mod::after { 8705 line-height: 16px; 8706 color: rgb(0,0,0) 8707 } 8708 8709 .menu__link.dw-mod:not(.menu__link--icon) { 8710 font-family: Lato,sans-serif; 8711 font-size: 16px; 8712 font-weight: 700; 8713 line-height: 1.4; 8714 color: rgb(0,0,0); 8715 text-transform: uppercase 8716 } 8717 8718 .menu__link.dw-mod:not(.menu__link--mobile) { 8719 line-height: 75px 8720 } 8721 8722 .menu__link--icon.dw-mod { 8723 color: rgb(0,0,0) 8724 } 8725 8726 .menu__item--top-level { 8727 border-top-width: 3px; 8728 border-top-style: solid; 8729 border-top-color: transparent; 8730 border-bottom-width: 3px; 8731 border-bottom-style: solid; 8732 border-bottom-color: transparent 8733 } 8734 8735 .menu__item--top-level.dw-mod:not(.menu__item--icon) { 8736 padding: 0 8737 } 8738 8739 .menu__item--top-level.dw-mod:first-of-type { 8740 padding-left: 0 8741 } 8742 8743 .tools-navigation.dw-mod { 8744 background-color: rgb(77,96,116); 8745 font-family: Lato,sans-serif; 8746 font-size: 16px; 8747 line-height: 1.4; 8748 color: rgb(255,255,255) 8749 } 8750 8751 .flag-icon { 8752 background-size: contain; 8753 position: relative; 8754 display: inline-block; 8755 width: 1.33333333em; 8756 line-height: 1.5em; 8757 background-position: 50% 50%; 8758 background-repeat: no-repeat no-repeat 8759 } 8760 8761 .flag-icon::before { 8762 content: '\00a0' 8763 } 8764 8765 /*.flag-icon-de { 8766 background-image: url(../flags/4x3/de.svg) 8767 } 8768 8769 .flag-icon-dk { 8770 background-image: url(../flags/4x3/dk.svg) 8771 }*/ 8772 8773 h1, h2 { 8774 margin-bottom: 12px 8775 } 8776 8777 8778 /*h1, h2 { 8779 font-family: KobenhavnBold,sans-serif 8780 } 8781 8782 body { 8783 font-family: Kobenhavn-Regular,sans-serif 8784 } 8785 8786 a, p, span, input, li, label { 8787 font-family: Kobenhavn-Regular,sans-serif 8788 }*/ 8789 8790 @@font-face { 8791 font-family: font-icons; 8792 font-display: swap; 8793 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') 8794 } 8795 8796 .icon-nz { 8797 position: relative; 8798 top: 1px; 8799 display: inline-block 8800 } 8801 8802 .icon-nz-arrow-long-right, .icon-nz-search { 8803 position: relative; 8804 top: .1em; 8805 display: inline-block 8806 } 8807 8808 .icon-nz-arrow-long-right::before, .icon-nz-search::before { 8809 font-family: font-icons; 8810 font-style: normal; 8811 font-variant: normal; 8812 font-weight: 400; 8813 height: 1em; 8814 line-height: 1em; 8815 speak: none; 8816 text-indent: 0; 8817 text-transform: none; 8818 -webkit-font-smoothing: antialiased 8819 } 8820 8821 .icon-nz-arrow-long-right::before { 8822 content: '\EA06' 8823 } 8824 8825 .icon-nz-search::before { 8826 content: '\EA35' 8827 } 8828 8829 .btn--link.dw-mod { 8830 font-weight: 700; 8831 text-decoration: underline 8832 } 8833 8834 .hero .grid__cell h1 { 8835 font-size: 35px; 8836 color: rgb(255,255,255); 8837 text-transform: uppercase; 8838 font-weight: 700 8839 } 8840 8841 .hero.paragraph-container { 8842 padding: 0; 8843 margin-top: 8rem 8844 } 8845 8846 @@media (min-width:768px) { 8847 .hero.paragraph-container { 8848 margin-top: 10rem 8849 } 8850 } 8851 8852 @@media (min-width:992px) { 8853 .hero.paragraph-container { 8854 margin-top: 12rem 8855 } 8856 } 8857 8858 .hero .paragraph-container--height-xl { 8859 height: 300px 8860 } 8861 8862 @@media (min-width:768px) { 8863 .hero .paragraph-container--height-xl { 8864 height: 470px 8865 } 8866 } 8867 8868 .hero .paragraph-container--height-xl > .paragraph-container { 8869 height: 300px 8870 } 8871 8872 @@media (min-width:768px) { 8873 .hero .paragraph-container--height-xl > .paragraph-container { 8874 height: 470px 8875 } 8876 } 8877 8878 .hero svg { 8879 position: absolute; 8880 left: 0; 8881 bottom: -1px; 8882 width: 100%; 8883 height: auto 8884 } 8885 8886 .footer__content-newsletter input { 8887 border-top-left-radius: 5px; 8888 border-top-right-radius: 5px; 8889 border-bottom-right-radius: 5px; 8890 border-bottom-left-radius: 5px; 8891 border: none; 8892 padding: 7px; 8893 margin-bottom: 0; 8894 line-height: 20px; 8895 background-color: rgb(77,96,116); 8896 color: rgb(255,255,255); 8897 background-position: initial initial; 8898 background-repeat: initial initial 8899 } 8900 8901 .contactform input { 8902 border: none; 8903 border-top-left-radius: 5px; 8904 border-top-right-radius: 5px; 8905 border-bottom-right-radius: 5px; 8906 border-bottom-left-radius: 5px; 8907 resize: none; 8908 padding: 5px 8909 } 8910 8911 .center-container.dw-mod { 8912 max-width: 1440px 8913 } 8914 8915 .multiple-paragraphs-container h1, .multiple-paragraphs-container h2 { 8916 color: inherit 8917 } 8918 8919 @@media (max-width:480px) { 8920 .grid-custom-layout-second { 8921 padding-left: 1rem; 8922 padding-right: 1rem 8923 } 8924 } 8925 8926 @@media (min-width:992px) { 8927 .grid-custom-layout-second { 8928 width: 100%; 8929 margin: 0 auto; 8930 padding-left: 0; 8931 max-width: 1440px 8932 } 8933 } 8934 8935 .grid-custom-layout-second .paragraph-container--full-width.dw-mod { 8936 max-width: 1440px; 8937 width: 100% 8938 } 8939 8940 .usp-first-link-container a { 8941 color: white; 8942 text-transform: uppercase 8943 } 8944 8945 .menu__link.dw-mod:not(.menu__link--mobile) { 8946 line-height: 0 8947 } 8948 8949 .custom-flag::after { 8950 content: '\f078'; 8951 font-family: 'Font Awesome 5 Pro','Font Awesome 5 Free'; 8952 font-weight: 900; 8953 display: inline-block; 8954 font-size: 12px; 8955 position: relative; 8956 right: -25px; 8957 color: white 8958 } 8959 8960 .page { 8961 margin-top: 100px 8962 } 8963 8964 .dropdown { 8965 position: relative; 8966 display: inline-block; 8967 text-align: left 8968 } 8969 8970 .dropdown.dropdown--absolute-position { 8971 list-style: none; 8972 z-index: 70; 8973 background-color: rgb(255,255,255); 8974 position: absolute; 8975 top: 100%; 8976 left: 0; 8977 box-shadow: rgba(0,0,0,.239216) 0 6px 12px; 8978 margin: 0 8979 } 8980 8981 .menu__item--top-level.dw-mod:not(.menu__item--icon) { 8982 margin-right: .8rem 8983 } 8984 8985 .menu__link.dw-mod:not(.menu__link--icon) { 8986 /*font-family: Kobenhavn-Regular,sans-serif;*/ 8987 font-weight: 400 8988 } 8989 8990 .mega-menu.dw-mod { 8991 border-top-width: 1px; 8992 border-top-style: solid; 8993 border-top-color: rgb(191,233,210); 8994 border-bottom-width: 1px; 8995 border-bottom-style: solid; 8996 border-bottom-color: rgb(191,233,210) 8997 } 8998 8999 .mega-menu__header-container.dw-mod { 9000 margin-bottom: 1rem 9001 } 9002 9003 .mega-menu__header-container.dw-mod .mega-menu__header-container__text.dw-mod { 9004 /*font-family: KobenhavnBold,sans-serif;*/ 9005 font-weight: 400; 9006 text-transform: capitalize; 9007 line-height: 30px; 9008 font-size: 22px; 9009 border-bottom-width: 2px; 9010 border-bottom-style: solid; 9011 border-bottom-color: rgb(0,168,74); 9012 padding-left: 0 9013 } 9014 9015 .top-container--sticky.dw-mod { 9016 z-index: 10001 9017 } 9018 9019 @@media (min-width:1200px) { 9020 .top-container--sticky.dw-mod { 9021 z-index: 90 9022 } 9023 } 9024 9025 @@media (min-width:1200px) { 9026 .language-selector-container { 9027 padding-left: 1rem 9028 } 9029 } 9030 9031 .is-mega.dw-mod::after { 9032 content: '' 9033 } 9034 9035 .overlay { 9036 height: 100%; 9037 width: 100%; 9038 display: none; 9039 position: fixed; 9040 z-index: 1; 9041 top: 0; 9042 left: 0; 9043 background-color: rgb(243,249,245); 9044 margin-top: 90px 9045 } 9046 9047 9048 .overlay .menu--dropdown-right { 9049 display: block; 9050 box-shadow: none 9051 } 9052 9053 .overlay .typeahead-search-field.dw-mod { 9054 border: 1px solid rgb(243,249,245) 9055 } 9056 9057 .overlay-content { 9058 position: relative; 9059 top: 5%; 9060 width: 95%; 9061 margin: auto; 9062 text-align: left 9063 } 9064 9065 @@media (min-width:1200px) { 9066 .overlay-content { 9067 width: 70%; 9068 top: 10%; 9069 text-align: center 9070 } 9071 } 9072 9073 .search-field-fullscreen { 9074 max-width: 100% 9075 } 9076 9077 @@media (min-width:1200px) { 9078 .search-field-fullscreen { 9079 padding-right: 20px; 9080 padding-left: 30px 9081 } 9082 } 9083 9084 .fullscreen-input-field.dw-mod { 9085 background-color: rgb(243,249,245); 9086 height: 100px; 9087 color: rgb(0,168,74); 9088 /*font-family: KobenhavnBold,sans-serif;*/ 9089 border: 1px solid rgb(243,249,245); 9090 outline: rgb(0,0,0); 9091 font-size: 2rem; 9092 padding-left: 3rem 9093 } 9094 9095 .fullscreen-input-field.dw-mod::-webkit-input-placeholder { 9096 /*font-family: Kobenhavn-Regular,sans-serif;*/ 9097 color: rgb(163,176,181) 9098 } 9099 9100 @@media (min-width:1200px) { 9101 .fullscreen-input-field.dw-mod { 9102 border-bottom-width: 2px; 9103 border-bottom-style: solid; 9104 border-bottom-color: rgb(116,126,146); 9105 font-size: 3rem; 9106 padding-left: 6rem 9107 } 9108 } 9109 9110 .input-search-icon { 9111 position: absolute; 9112 z-index: 90; 9113 left: -5px; 9114 top: 40% 9115 } 9116 9117 .input-search-icon::before { 9118 font-weight: 700; 9119 font-size: 30px 9120 } 9121 9122 @@media (min-width:1200px) { 9123 .input-search-icon { 9124 left: 10px 9125 } 9126 } 9127 9128 .input-arrow-icon { 9129 position: absolute; 9130 right: 0; 9131 top: 40%; 9132 z-index: 90 9133 } 9134 9135 .input-arrow-icon::before { 9136 font-weight: 700; 9137 font-size: 30px; 9138 color: rgb(0,168,74) 9139 } 9140 9141 .menu__item--icon::before { 9142 content: ''; 9143 height: 100%; 9144 width: 1px; 9145 background-color: rgb(115,125,145); 9146 opacity: .3; 9147 background-position: initial initial; 9148 background-repeat: initial initial 9149 } 9150 9151 .menu__item--icon:last-of-type::after { 9152 content: ''; 9153 height: 100%; 9154 width: 1px; 9155 background-color: rgb(115,125,145); 9156 opacity: .3; 9157 background-position: initial initial; 9158 background-repeat: initial initial 9159 } 9160 9161 .custom-header-menu { 9162 padding-right: 1rem 9163 } 9164 9165 .custom-header-menu .menu__link.menu__link--icon.dw-mod { 9166 padding-top: 1rem 9167 } 9168 9169 .custom-header-menu .menu__link.menu__link--icon.dw-mod .icon-nz { 9170 font-size: 20px 9171 } 9172 9173 @@media (min-width:1200px) { 9174 .custom-header-menu .menu__link.menu__link--icon.dw-mod { 9175 margin-left: 2rem; 9176 margin-right: 2rem 9177 } 9178 } 9179 9180 .u-no-border { 9181 border: none 9182 } 9183 9184 </style> 9185 9186 <!-- Favicon --> 9187 <link href="@favicon" rel="icon" type="image/png"> 9188 9189 <!-- Base (Default, wireframe) styles --> 9190 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css" as="style" media="screen"> 9191 <noscript><link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css"></noscript> 9192 9193 @*<link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/base/base.min.css" type="text/css" media="screen">*@ 9194 9195 <!-- Rapido Css from Website Settings --> 9196 <link rel="stylesheet" href="@autoCssLink" as="style" media="screen"> 9197 <noscript><link rel="stylesheet" href="@autoCssLink"></noscript> 9198 9199 @*<link rel="stylesheet" id="rapidoCss" href="@autoCssLink" type="text/css" media="screen">*@ 9200 9201 <link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/nz/main.css" as="style" media="screen"> 9202 <noscript><link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/nz/main.css"></noscript> 9203 9204 <!-- Ignite Css (Custom site specific styles) --> 9205 @*<link rel="stylesheet" id="igniteCss" type="text/css" href="/Files/Templates/Designs/Rapido/css/nz/main.css" media="screen">*@ 9206 9207 <!-- Font awesome --> 9208 <link rel="preload" href="@fontAwesomeCssLink" as="style" onload="this.onload=null;this.rel='stylesheet'" media="screen"> 9209 <noscript><link rel="stylesheet" href="@fontAwesomeCssLink"></noscript> 9210 9211 @*<link rel="stylesheet" href="@fontAwesomeCssLink" type="text/css" media="screen">*@ 9212 9213 <!-- Flag icon --> 9214 @*<link rel="stylesheet" href="/Files/Templates/Designs/Rapido/css/fonts/flag-icon.min.css" type="text/css" media="screen">*@ 9215 9216 <!-- Google fonts --> 9217 @*@{ 9218 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))); 9219 } 9220 <link href="https://fonts.googleapis.com/css?family=@family" rel="stylesheet">*@ 9221 @{ 9222 PushPromise(favicon); 9223 PushPromise(fontAwesomeCssLink); 9224 PushPromise("/Files/Templates/Designs/Rapido/css/base/base.min.css"); 9225 PushPromise(autoCssLink); 9226 PushPromise("/Files/Templates/Designs/Rapido/css/ignite/ignite.min.css"); 9227 PushPromise("/Files/Templates/Designs/Rapido/css/nz/main.css"); 9228 PushPromise("/Files/Images/placeholder.gif"); 9229 } 9230 9231 @if (!String.IsNullOrEmpty(Model.Area.Item.GetItem("Settings").GetString("AppName"))) 9232 { 9233 <link rel="manifest" href="/Files/Templates/Designs/Rapido/manifest.json"> 9234 PushPromise("/Files/Templates/Designs/Rapido/manifest.json"); 9235 } 9236 @if (!String.IsNullOrEmpty(headerScripts)) 9237 { 9238 @headerScripts 9239 } 9240 @if (!String.IsNullOrEmpty(pageHeaderScripts)) 9241 { 9242 @pageHeaderScripts 9243 } 9244 9245 9246 @*HREF LANG*@ 9247 9248 @foreach (var language in Model.Languages) { 9249 string langHeader = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + language.PrimaryDomain; 9250 string pageid = language.Page.ID.ToString(); 9251 int firstActivePageId = language.FirstActivePage.ID; 9252 string urls = langHeader; 9253 string firstActivePage = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + firstActivePageId); 9254 string currentPage = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + pageid); 9255 9256 if(currentPage != firstActivePage) 9257 { 9258 urls = langHeader + Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + pageid); 9259 } 9260 9261 <link rel="alternate" href='@urls' hreflang='@language.Culture' /> 9262 } 9263 9264 @{ 9265 string businessPhotoPath = Model.Area.Item.GetItem("Settings").GetFile("BusinessPhoto") != null ? Model.Area.Item.GetItem("Settings").GetFile("BusinessPhoto").Path : ""; 9266 var address = Model.Area.Item.GetItem("Settings").GetItem("Address"); 9267 string streetAddress = ""; 9268 string addressLocality = ""; 9269 string addressRegion = ""; 9270 string postalCode = ""; 9271 string addressCountry = ""; 9272 List<string> strings = new List<string>(); 9273 if (address != null) { 9274 streetAddress = address.GetString("StreetAddress"); 9275 addressLocality = address.GetString("City"); 9276 addressRegion = address.GetString("Region"); 9277 postalCode = address.GetString("PostalCode"); 9278 addressCountry = address.GetString("Country"); 9279 } 9280 string contactEmail = Model.Area.Item.GetItem("Settings").GetString("ContactEmail"); 9281 string contactNumber = Model.Area.Item.GetItem("Settings").GetString("ContactNumber"); 9282 string openingHours = Model.Area.Item.GetItem("Settings").GetString("OpeningHours"); 9283 var currency = Dynamicweb.Ecommerce.Services.Currencies.GetDefaultCurrency(); 9284 string searchParameter = !String.IsNullOrEmpty(HttpContext.Current.Request["Search"]) ? HttpContext.Current.Request.QueryString.Get("Search") : ""; 9285 string areaId = !String.IsNullOrEmpty(HttpContext.Current.Request["Areaid"]) ? HttpContext.Current.Request.QueryString.Get("Areaid") : ""; 9286 string pageType = !String.IsNullOrEmpty(HttpContext.Current.Request["Pagetype"]) ? HttpContext.Current.Request.QueryString.Get("Pagetype") : ""; 9287 string searchFeedId = Converter.ToString(GetPageIdByNavigationTag("ContentSearchFeed")); 9288 string siteUrlWithoutQuery = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 9289 var searchQuery = HttpContext.Current.Request.QueryString.Get("Search"); 9290 } 9291 9292 @if (!string.IsNullOrEmpty(businessName)) 9293 { 9294 <script type="application/ld+json"> 9295 { 9296 "@@context": "http://schema.org", 9297 "@@type": "Store", 9298 "image": [ 9299 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 9300 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 9301 "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath" 9302 ], 9303 "@@id": "@siteURL", 9304 "name": "@businessName", 9305 "address": { 9306 "@@type": "PostalAddress", 9307 "streetAddress": "@streetAddress", 9308 "addressLocality": "@addressLocality", 9309 "addressRegion": "@addressRegion", 9310 "postalCode": "@postalCode", 9311 "addressCountry": "@addressCountry" 9312 } 9313 @if (!string.IsNullOrEmpty(contactEmail)) 9314 { 9315 <text>,"email": "@contactEmail"</text> 9316 } 9317 @if (!string.IsNullOrEmpty(contactNumber)) 9318 { 9319 <text>,"telephone": "@contactNumber"</text> 9320 } 9321 } 9322 </script> 9323 } 9324 9325 @if (siteURL.Contains("hededanmark")) 9326 { 9327 <script type="application/ld+json"> 9328 { 9329 "@@context": "https://schema.org", 9330 "@@type": "Organization", 9331 "name": "@businessName", 9332 "url": "@siteURL", 9333 "aggregateRating": { 9334 "@@type": "AggregateRating", 9335 "ratingValue": "5", 9336 "reviewCount": "2" 9337 }, 9338 9339 @*Social URL link hack from JAA*@ 9340 "sameAs": 9341 [ 9342 @foreach (var socialitem in Model.Area.Item.GetItem("Layout").GetItems("FooterSocialLinks")) 9343 { 9344 string socialLink = '"' + socialitem.GetString("Link") + '"'; 9345 strings.Add(socialLink); 9346 } 9347 9348 @{ 9349 string joined = string.Join(",", strings); 9350 } 9351 9352 @joined 9353 ] 9354 } 9355 </script> 9356 } 9357 9358 @if (siteURL.Contains("hd2412")) 9359 { 9360 <script type="application/ld+json"> 9361 { 9362 "@@context": "http://schema.org", 9363 "@@type": "LocalBusiness", 9364 "address": { 9365 "@@type": "PostalAddress", 9366 "streetAddress": "@streetAddress", 9367 "addressLocality": "@addressLocality", 9368 "addressRegion": "@addressRegion", 9369 "postalCode": "@postalCode", 9370 "addressCountry": "@addressCountry" 9371 }, 9372 @*NEED INFO ABOUT DESCRIPTION PROPERTY - DM ANBEFALER AT ANVENDE DESCRIPTION FRA GOOGLE MY BUSINESS*@ 9373 "description": "", 9374 "name": "@businessName", 9375 "openingHours": [ 9376 "@openingHours" 9377 ], 9378 @if (!string.IsNullOrEmpty(contactNumber)) 9379 { 9380 <text>"telephone": "@contactNumber",</text> 9381 } 9382 "priceRange": "@currency", 9383 "image": [ 9384 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 9385 "@siteURL/Admin/Public/GetImage.ashx?width=400&height=300&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath", 9386 "@siteURL/Admin/Public/GetImage.ashx?width=448&height=225&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath" 9387 ] 9388 } 9389 </script> 9390 } 9391 9392 9393 <script type="application/ld+json"> 9394 @if (String.IsNullOrEmpty(searchParameter)) 9395 { 9396 <text> 9397 { 9398 "@@context": "https://schema.org", 9399 "@@type": "WebSite", 9400 "name": "@businessName", 9401 "url": "@siteUrlWithoutQuery" 9402 } 9403 </text> 9404 } 9405 9406 @if (!String.IsNullOrEmpty(searchParameter)) 9407 { 9408 <text> 9409 { 9410 "@@context": "https://schema.org", 9411 "@@type": "WebSite", 9412 "name": "@businessName", 9413 "url": "@siteUrlWithoutQuery", 9414 "potentialAction": 9415 { 9416 @*Ikke sikker p� target valuen er korrekt*@ 9417 "@@type": "SearchAction", 9418 "target": "@siteUrlWithoutQuery/search?search={@searchQuery}", 9419 "query-input": "required name=@searchParameter" 9420 } 9421 } 9422 </text> 9423 } 9424 </script> 9425 9426 <script> 9427 !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); 9428 </script> 9429 @{ 9430 var userAgent = HttpContext.Current.Request.UserAgent.ToString(); 9431 var tridentString = userAgent.Contains("Trident"); 9432 } 9433 @if (tridentString) //If sætning virker ikke korrekt 9434 { 9435 9436 <script> 9437 var firstTime = localStorage.getItem("first_time"); 9438 if(!firstTime) { 9439 // first time loaded! 9440 localStorage.setItem("first_time", "1"); 9441 9442 document.addEventListener("DOMContentLoaded", function (event) { 9443 9444 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>'); 9445 }); 9446 9447 let showOnEvent_8669 = 'onStart'; 9448 let showOnceIn_8669 = +'0'; 9449 let showOnceWhenCTAButtonIsClicked_8669 = 'False'.toLowerCase() == 'true'; 9450 9451 function showOverlay_8669() { 9452 let overlayTrigger = document.getElementById('overlay_8669'); 9453 let overlayModalContainer = document.getElementById('overlayModalContainer_8669'); 9454 let overlayModal = document.getElementById('overlayModal_8669'); 9455 9456 if ('animation--fadeIn' != '' && overlayModalContainer) { 9457 overlayModalContainer.classList.add('animation--fadeIn'); 9458 } 9459 if ('fade' != '' && overlayModal) { 9460 overlayModal.classList.add('fade'); 9461 } 9462 9463 let ctaButton = overlayModal.querySelector('.btn'); 9464 9465 if (ctaButton) { 9466 ctaButton.addEventListener('click', function () { 9467 document.cookie = 'overlayCTAButtonIsClicked_8669=true'; 9468 }); 9469 } 9470 9471 overlayTrigger.checked = true; 9472 overlayTrigger.addEventListener('change', closeOverlay_8669); 9473 } 9474 9475 function closeOverlay_8669() { 9476 if (!this.checked) { 9477 let date = new Date; 9478 date.setDate(date.getDate() + showOnceIn_8669); 9479 document.cookie = "overlayWasShown_8669=" + showOnceIn_8669 + "; path=/; expires=" + date.toUTCString(); 9480 } 9481 } 9482 9483 function showOverlayWithSettings_8669() { 9484 9485 if ((showOnceIn_8669 && RememberState.GetCookie("overlayWasShown_8669") == showOnceIn_8669) 9486 || (showOnceWhenCTAButtonIsClicked_8669 && RememberState.GetCookie('overlayCTAButtonIsClicked_8669'))) { 9487 return; 9488 } 9489 9490 switch (showOnEvent_8669) { 9491 case "afterDelay": 9492 setTimeout(showOverlay_8669, 5000); 9493 break; 9494 case "onScroll": 9495 let modalPosition = document.getElementById('overlayAnchor_8669').getBoundingClientRect().bottom + window.pageYOffset; 9496 window.addEventListener('scroll', function showOnScroll() { 9497 if (window.pageYOffset > modalPosition) { 9498 showOverlay_8669(); 9499 window.removeEventListener('scroll', showOnScroll, false) 9500 } 9501 }, false); 9502 break; 9503 case "onMouseLeave": 9504 window.addEventListener("mouseout", function onMouseLeave(e) { 9505 e = e ? e : window.event; 9506 let from = e.relatedTarget || e.toElement; 9507 if (!from || from.nodeName == "HTML") { 9508 showOverlay_8669(); 9509 window.removeEventListener('mouseout', onMouseLeave, false) 9510 } 9511 }, false); 9512 break; 9513 default: 9514 showOverlay_8669(); 9515 break; 9516 } 9517 } 9518 9519 9520 document.addEventListener('DOMContentLoaded', function () { 9521 showOverlayWithSettings_8669(); 9522 }); 9523 } 9524 9525 </script> 9526 } 9527 9528 </head> 9529 9530 <body> 9531 @if (!String.IsNullOrEmpty(bodyScripts)) 9532 { 9533 @bodyScripts 9534 } 9535 @if (!String.IsNullOrEmpty(pageBodyScripts)) 9536 { 9537 @pageBodyScripts 9538 } 9539 9540 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 9541 @RenderBlockList(masterPage.BlocksRoot.BlocksList) 9542 9543 9544 @RenderSnippet("JavaScript") 9545 9546 @helper RenderMasterHeader() 9547 { 9548 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterHeader").OrderBy(item => item.SortId).ToList(); 9549 bool isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 9550 string stickyTop = "top-container--sticky"; 9551 9552 <header class="top-container @stickyTop js-header dw-mod" id="Top"> 9553 @RenderBlockList(subBlocks) 9554 </header> 9555 } 9556 9557 @helper RenderMain() 9558 { 9559 List<Block> subBlocks = this.masterPage.GetBlockListById("MasterMain").OrderBy(item => item.SortId).ToList(); 9560 9561 <main class="site dw-mod js-content"> 9562 @RenderBlockList(subBlocks) 9563 </main> 9564 } 9565 9566 @helper RenderPageContent() 9567 { 9568 bool isNavigationStickyMenu = Pageview.Device.ToString() != "Mobile" && Pageview.Device.ToString() != "Tablet" && Model.Area.Item.GetItem("Layout").GetItem("Header").GetBoolean("StickyTop"); 9569 string pagePos = isNavigationStickyMenu ? "js-page-pos" : ""; 9570 9571 <div id="Page" class="page @pagePos"> 9572 <section class="center-container content-container dw-mod" id="content"> 9573 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 9574 9575 @using Dynamicweb.Extensibility 9576 @using Dynamicweb.Core 9577 @using Dynamicweb.Rapido.Blocks.Components 9578 @using Dynamicweb.Rapido.Blocks.Components.Articles 9579 @using Dynamicweb.Rapido.Blocks.Components.General 9580 @using Dynamicweb.Rapido.Blocks 9581 @using S_DW_HD2412.CustomCode 9582 9583 @functions { 9584 BlocksPage articlePage = BlocksPage.GetBlockPage("DynamicArticle"); 9585 9586 public string GetParentSettingsItem(string systemName) 9587 { 9588 string item = null; 9589 9590 Dynamicweb.Content.Page current = Dynamicweb.Services.Pages.GetPage(Model.ID); 9591 while (current != null && current.Parent != current) 9592 { 9593 var temp = current.Item != null ? current.Item[systemName] : ""; 9594 9595 if (temp != null) 9596 { 9597 item = temp.ToString(); 9598 9599 if (!String.IsNullOrEmpty(item) && !String.Equals("default", item, StringComparison.OrdinalIgnoreCase)) 9600 { 9601 break; 9602 } 9603 } 9604 9605 current = current.Parent; 9606 } 9607 9608 return item; 9609 } 9610 9611 public string GetArticleCategory(int pageId) 9612 { 9613 string categoryName = null; 9614 9615 //Secure that the article is not in the root folder = Actual has a category 9616 if (!String.IsNullOrEmpty(Dynamicweb.Services.Pages.GetPage(pageId).Parent.Parent.ItemType)) 9617 { 9618 categoryName = Dynamicweb.Services.Pages.GetPage(pageId).Parent.GetDisplayName(); 9619 } 9620 9621 return categoryName; 9622 } 9623 9624 public string GetArticleCategoryColor(int pageId) 9625 { 9626 string categoryColor = ""; 9627 9628 //Secure that the article is not in the root folder = Actual has a category 9629 if (!String.IsNullOrEmpty(Dynamicweb.Services.Pages.GetPage(pageId).Parent.Parent.ItemType)) 9630 { 9631 if (Dynamicweb.Services.Pages.GetPage(pageId).Parent.Item["CategoryColor"] != null) 9632 { 9633 categoryColor = Dynamicweb.Services.Pages.GetPage(pageId).Parent.Item["CategoryColor"].ToString(); 9634 } 9635 } 9636 9637 return categoryColor; 9638 } 9639 } 9640 @{ 9641 string listPageId = Converter.ToString(GetPageIdByNavigationTag("DynamicListFeed")); 9642 string parentPageId = Dynamicweb.Services.Pages.GetPage(Model.ID).Parent.ID.ToString(); 9643 string topLayout = Model.Item.GetList("TopLayout") != null ? Model.Item.GetList("TopLayout").SelectedValue : "default"; 9644 topLayout = topLayout == "default" && GetParentSettingsItem("ArticleTopLayout") != null ? GetParentSettingsItem("ArticleTopLayout").ToString().ToLower() : topLayout; 9645 string textLayout = Model.Item.GetList("TextLayout") != null ? Model.Item.GetList("TextLayout").SelectedValue : "default"; 9646 textLayout = textLayout == "default" && GetParentSettingsItem("ArticleTextLayout") != null ? GetParentSettingsItem("ArticleTextLayout").ToString().ToLower() : textLayout; 9647 string imageLayout = Model.Item.GetList("ImageLayout") != null ? Model.Item.GetList("ImageLayout").SelectedValue : "default"; 9648 imageLayout = imageLayout == "default" && GetParentSettingsItem("ArticleImageLayout") != null ? GetParentSettingsItem("ArticleImageLayout").ToString().ToLower() : imageLayout; 9649 9650 string imageColumns = imageLayout == "straight" && textLayout != "full" ? "8" : "12"; 9651 string contentColumns = textLayout != "full" ? "8" : "12"; 9652 string buttonContentColumns = textLayout != "full" ? "6" : "12"; 9653 int externalParagraphId = Model.Item.GetItem("CTAParagraphLink") != null ? Model.Item.GetItem("CTAParagraphLink").ParagraphID : 0; 9654 9655 ArticleHeaderLayout headerLayout; 9656 9657 switch (topLayout) 9658 { 9659 case "default": 9660 headerLayout = ArticleHeaderLayout.Clean; 9661 break; 9662 case "split": 9663 headerLayout = ArticleHeaderLayout.Split; 9664 break; 9665 case "banner": 9666 headerLayout = ArticleHeaderLayout.Banner; 9667 break; 9668 case "overlay": 9669 headerLayout = ArticleHeaderLayout.Overlay; 9670 break; 9671 default: 9672 headerLayout = ArticleHeaderLayout.Clean; 9673 break; 9674 } 9675 9676 ButtonLayout topBannerButtonLayout = ButtonLayout.Primary; 9677 9678 9679 switch (Model.Item.GetString("ButtonDesign")) 9680 { 9681 case "primary": 9682 topBannerButtonLayout = ButtonLayout.Primary; 9683 break; 9684 case "secondary": 9685 topBannerButtonLayout = ButtonLayout.Secondary; 9686 break; 9687 case "teritary": 9688 topBannerButtonLayout = ButtonLayout.Tertiary; 9689 break; 9690 case "link": 9691 topBannerButtonLayout = ButtonLayout.Link; 9692 break; 9693 } 9694 9695 ArticleHeaderExtended heroBanner = new ArticleHeaderExtended 9696 { 9697 Layout = ArticleHeaderLayout.Banner, 9698 Image = new Image { Path = Model.Item.GetFile("Image") }, 9699 }; 9700 9701 Block articleHero = new Block 9702 { 9703 Id = "ArticleBanner", 9704 SortId = 0, 9705 Component = heroBanner, 9706 9707 Design = new Design 9708 { 9709 RenderType = RenderType.Column, 9710 Size = "12", 9711 HidePadding = true 9712 } 9713 }; 9714 articlePage.Add(articleHero); 9715 9716 9717 ArticleHeaderExtended topHeading = new ArticleHeaderExtended 9718 { 9719 Layout = headerLayout, 9720 Heading = Model.Item.GetString("Title"), 9721 Subheading = Model.Item.GetString("Summary"), 9722 TextColor = "#fff", 9723 Author = Model.Item.GetString("Author"), 9724 Date = Translate("News Published", "Udgivet:") + " " + Model.Item.GetString("Date").Replace("00:00:00", ""), 9725 Category = GetArticleCategory(Model.ID), 9726 CategoryColor = GetArticleCategoryColor(Model.ID), 9727 Link = Model.Item.GetString("Link"), 9728 LinkText = Model.Item.GetString("LinkText"), 9729 ButtonLayout = topBannerButtonLayout, 9730 RatingScore = Model.Item.GetString("Rating") != null ? Converter.ToInt32(Model.Item.GetList("Rating").SelectedValue) : 0, 9731 RatingOutOf = Model.Item.GetString("Rating") != null ? Model.Item.GetList("Rating").Options.Count : 0, 9732 ExternalParagraphId = externalParagraphId, 9733 ButtonNofollow = Model.Item.GetBoolean("Nofollow") 9734 }; 9735 9736 Block articleContainer = new Block 9737 { 9738 Id = "ArticleContainer", 9739 SortId = 10, 9740 Design = new Design 9741 { 9742 RenderType = RenderType.Row 9743 }, 9744 9745 BlocksList = new List<Block> { 9746 9747 new Block { 9748 Id = "ArticleBody", 9749 SortId = 30, 9750 Design = new Design { 9751 RenderType = RenderType.Column, 9752 Size = "12", 9753 HidePadding = true 9754 } 9755 } 9756 } 9757 }; 9758 articlePage.Add(articleContainer); 9759 9760 Block articleTop = new Block 9761 { 9762 Id = "ArticleHead", 9763 SortId = 20, 9764 Component = topHeading, 9765 Design = new Design 9766 { 9767 RenderType = RenderType.Column, 9768 Size = "12", 9769 HidePadding = true, 9770 CssClass = "article-head" 9771 } 9772 }; 9773 articlePage.Add("ArticleContainer", articleTop); 9774 9775 9776 Block articleBodyRow = new Block 9777 { 9778 Id = "ArticleBodyRow", 9779 SortId = 10, 9780 SkipRenderBlocksList = true 9781 }; 9782 articlePage.Add("ArticleBody", articleBodyRow); 9783 9784 9785 if (Model.Item.GetString("Paragraphs") != null) 9786 { 9787 int count = 0; 9788 foreach (var paragraph in Model.Item.GetItems("Paragraphs")) 9789 { 9790 if (!paragraph.GetBoolean("RenderAsQuote")) 9791 { 9792 string enableDropCap = Model.Item.GetString("EnableDropCap") != null ? Model.Item.GetList("EnableDropCap").SelectedValue.ToLower() : "default"; 9793 enableDropCap = enableDropCap == "default" && GetParentSettingsItem("EnableDropCap") != null ? GetParentSettingsItem("EnableDropCap").ToString().ToLower() : enableDropCap; 9794 string text = paragraph.GetString("Text") != null ? paragraph.GetString("Text") : ""; 9795 9796 if (!String.IsNullOrEmpty(text) && enableDropCap == "true" && count == 0 && paragraph.GetString("Text").Substring(0, 3) == "<p>") 9797 { 9798 string firstLetter = paragraph.GetString("Text").Substring(3, 1); 9799 text = paragraph.GetString("Text").Remove(3, 1); 9800 text = text.Insert(3, "<span class=\"article__drop-cap\">" + firstLetter + "</span>"); 9801 } 9802 9803 if (paragraph.GetFile("Image") != null) 9804 { 9805 string imageTitle = !string.IsNullOrEmpty(paragraph.GetString("Heading")) ? paragraph.GetString("Heading") : ""; 9806 9807 Block articleParagraphImage = new Block 9808 { 9809 Id = "ArticleParagraph" + count + "Image", 9810 SortId = (count * 10), 9811 Design = new Design 9812 { 9813 RenderType = RenderType.Column, 9814 Size = imageColumns, 9815 CssClass = "u-color-light--bg u-padding--lg u-no-padding-top" 9816 } 9817 }; 9818 9819 9820 ArticleImage image = new ArticleImage 9821 { 9822 Image = new Image 9823 { 9824 Path = paragraph.GetFile("Image"), 9825 Title = imageTitle, 9826 ImageDefault = new ImageSettings { Width = 1300 }, 9827 Caption = paragraph.GetString("ImageCaption") 9828 } 9829 }; 9830 articleParagraphImage.Component = image; 9831 9832 9833 articlePage.Add("ArticleBodyRow", articleParagraphImage); 9834 } 9835 9836 if (!String.IsNullOrEmpty(paragraph.GetString("VideoURL"))) 9837 { 9838 Block articleParagraphVideo = new Block 9839 { 9840 Id = "ArticleParagraph" + count + "Video", 9841 SortId = (count * 10) + 1, 9842 Component = new ArticleVideo { Url = paragraph.GetString("VideoURL"), AutoPlay = "false" }, 9843 Design = new Design 9844 { 9845 RenderType = RenderType.Column, 9846 Size = imageColumns, 9847 CssClass = "u-color-light--bg u-padding--lg u-no-padding-top" 9848 } 9849 }; 9850 articlePage.Add("ArticleBodyRow", articleParagraphVideo); 9851 } 9852 9853 if (!String.IsNullOrEmpty(paragraph.GetString("Heading"))) 9854 { 9855 Block articleParagraphHeader = new Block 9856 { 9857 Id = "ArticleParagraph" + count + "Heading", 9858 SortId = (count * 10) + 2, 9859 Component = new ArticleSubHeader { Title = paragraph.GetString("Heading") }, 9860 Design = new Design 9861 { 9862 RenderType = RenderType.Column, 9863 Size = contentColumns, 9864 CssClass = "u-color-light--bg u-padding--lg u-no-padding-bottom" 9865 } 9866 }; 9867 articlePage.Add("ArticleBodyRow", articleParagraphHeader); 9868 } 9869 9870 if (!String.IsNullOrEmpty(text)) 9871 { 9872 Block articleParagraphText = new Block 9873 { 9874 Id = "ArticleParagraph" + count + "Text", 9875 SortId = (count * 10) + 3, 9876 Component = new ArticleText { Text = text }, 9877 Design = new Design 9878 { 9879 RenderType = RenderType.Column, 9880 Size = contentColumns, 9881 CssClass = "u-color-light--bg u-padding--lg u-no-padding-top" 9882 } 9883 }; 9884 9885 articlePage.Add("ArticleBodyRow", articleParagraphText); 9886 } 9887 if (!String.IsNullOrEmpty(paragraph.GetString("Link"))) 9888 { 9889 Block articleParagraphLink = new Block 9890 { 9891 Id = "ArticleParagraph" + count + "Link", 9892 SortId = (count * 10) + 2, 9893 Component = new Button() { Link = paragraph.GetString("Link"), Title = paragraph.GetString("ButtonText"), ButtonLayout = topBannerButtonLayout, CssClass = "u-half-width" }, 9894 Design = new Design 9895 { 9896 RenderType = RenderType.Column, 9897 Size = buttonContentColumns, 9898 CssClass = "u-color-light--bg u-padding--lg u-no-padding-top" 9899 } 9900 9901 }; 9902 articlePage.Add("ArticleBodyRow", articleParagraphLink); 9903 } 9904 } 9905 else 9906 { 9907 if (!String.IsNullOrEmpty(paragraph.GetString("Text"))) 9908 { 9909 string quoteText = paragraph.GetString("Text") != null ? paragraph.GetString("Text") : ""; 9910 string quoteAuthor = paragraph.GetString("Heading") != null ? paragraph.GetString("Heading") : ""; 9911 9912 Block articleParagraphQuote = new Block 9913 { 9914 Id = "ArticleParagraph" + count + "Quote", 9915 SortId = (count * 10) + 3, 9916 Component = new ArticleQuote { Image = new Image { Path = paragraph.GetFile("Image") }, Text = quoteText, Author = quoteAuthor }, 9917 Design = new Design 9918 { 9919 RenderType = RenderType.Column, 9920 Size = contentColumns, 9921 CssClass = "u-color-light--bg u-padding u-no-padding-top" 9922 } 9923 }; 9924 articlePage.Add("ArticleBodyRow", articleParagraphQuote); 9925 } 9926 } 9927 9928 count++; 9929 } 9930 } 9931 9932 articleBodyRow.Component = new ArticleBodyRow { SubBlocks = articleBodyRow.BlocksList, TopLayout = topLayout, TextLayout = textLayout }; 9933 9934 Block socialShare = new Block 9935 { 9936 Id = "socialShare", 9937 SortId = 25, 9938 Template = RenderSocialShare() 9939 }; 9940 9941 articlePage.Add("ArticleBody", socialShare); 9942 9943 //Related 9944 string showRelatedArtices = Model.Item.GetString("ShowRelatedArticles") != null ? Model.Item.GetList("ShowRelatedArticles").SelectedValue.ToLower() : "default"; 9945 showRelatedArtices = showRelatedArtices == "default" && GetParentSettingsItem("ShowRelatedArticles") != null ? GetParentSettingsItem("ShowRelatedArticles").ToString().ToLower() : showRelatedArtices; 9946 9947 if (showRelatedArtices == "true") 9948 { 9949 Block articleRelated = new Block 9950 { 9951 Id = "ArticleRelated", 9952 SortId = 30, 9953 Component = new ArticleRelated { Title = Translate("Related articles"), FeedPageId = listPageId, Query = "sourceType=Page&sourcePage=" + parentPageId, PageSize = 4, CurrentPageId = Model.ID.ToString() }, 9954 Design = new Design 9955 { 9956 RenderType = RenderType.Column, 9957 Size = "12", 9958 CssClass = "u-no-padding" 9959 } 9960 }; 9961 articlePage.Add("ArticleContainer", articleRelated); 9962 } 9963 9964 articlePage.Add("ArticleContainer", new Block 9965 { 9966 Id = "ParagraphGalleryModal", 9967 SortId = 30, 9968 Component = new ArticleGalleryModal { } 9969 }); 9970 9971 } 9972 9973 @{ 9974 9975 @*SCHEMA MARKUP FOR NEWS ARTICLES*@ 9976 9977 var imageSchema = Model.Item.GetFile("Image"); 9978 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 : ""; 9979 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 : ""; 9980 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 : ""; 9981 string eventName = Model.Item.GetString("Title") != null ? Model.Item.GetString("Title") : ""; 9982 DateTime startDate = Model.Item.GetDateTime("Date"); 9983 var endDateVar = new Dynamicweb.Forms.Field(); 9984 DateTime endDate = endDateVar.UpdatedDate; 9985 9986 string siteURL = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 9987 string siteCanonical = Dynamicweb.Context.Current.Request.Url.Scheme + "://" + Dynamicweb.Context.Current.Request.Url.Host; 9988 string businessName = Model.Area.Item.GetItem("Settings").GetString("BusinessName") != null ? Model.Area.Item.GetItem("Settings").GetString("BusinessName") : ""; 9989 string businessPhotoPath = Model.Area.Item.GetItem("Settings").GetFile("BusinessPhoto") != null ? Model.Area.Item.GetItem("Settings").GetFile("BusinessPhoto").Path : ""; 9990 string summary = Model.Item.GetString("Summary") != null ? Model.Item.GetString("Summary") : ""; 9991 9992 } 9993 9994 9995 @* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@ 9996 @RenderBlockList(articlePage.BlocksRoot.BlocksList) 9997 9998 9999 <script type="application/ld+json"> 10000 { 10001 "@@context": "https://schema.org", 10002 "@@type": "NewsArticle", 10003 "mainEntityOfPage": { 10004 "@@type": "WebPage", 10005 "@@id": "@siteCanonical" 10006 }, 10007 "headline": "@eventName", 10008 @if (imageSchema != null) 10009 { 10010 <text>"@@image": [ 10011 "@image1x1", 10012 "@image4x3", 10013 "@image16x9" 10014 ],</text> 10015 } 10016 "datePublished": "@startDate.ToString("dd-MM-yyyy")", 10017 "dateModified": "@endDate.ToString("dd-MM-yyyy")", 10018 "author": { 10019 "@@type": "Organization", 10020 "name": "@businessName" 10021 }, 10022 "publisher": { 10023 "@@type": "Organization", 10024 "name": "@businessName", 10025 "logo": { 10026 "@@type": "ImageObject", 10027 "url": "@siteURL/Admin/Public/GetImage.ashx?width=400&height=400&crop=0&Compression=75&DoNotUpscale=true&image=@businessPhotoPath" 10028 } 10029 }, 10030 "description": "@summary" 10031 } 10032 </script> 10033 10034 </section> 10035 </div> 10036 } 10037 </body> 10038 </html> 10039