Error executing template "Designs/Rapido/_parsed/Page.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_29cd52707aa54cdfae15ef4163406131.<RenderPageContent>b__194_0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\a4.is\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 7983
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_29cd52707aa54cdfae15ef4163406131.<>c__DisplayClass6_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\a4.is\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 246
   at CompiledRazorTemplates.Dynamic.RazorEngine_29cd52707aa54cdfae15ef4163406131.<>c__DisplayClass5_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\a4.is\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 160
   at CompiledRazorTemplates.Dynamic.RazorEngine_29cd52707aa54cdfae15ef4163406131.<RenderMain>b__193_0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\a4.is\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 7960
   at RazorEngine.Templating.TemplateWriter.ToString()
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at CompiledRazorTemplates.Dynamic.RazorEngine_29cd52707aa54cdfae15ef4163406131.<>c__DisplayClass6_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\a4.is\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 246
   at CompiledRazorTemplates.Dynamic.RazorEngine_29cd52707aa54cdfae15ef4163406131.<>c__DisplayClass5_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\a4.is\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 160
   at CompiledRazorTemplates.Dynamic.RazorEngine_29cd52707aa54cdfae15ef4163406131.<>c__DisplayClass6_0.<RenderBlock>b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\a4.is\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 268
   at CompiledRazorTemplates.Dynamic.RazorEngine_29cd52707aa54cdfae15ef4163406131.<>c__DisplayClass5_0.<RenderBlockList>b__0(TextWriter __razor_helper_writer) in C:\inetpub\wwwroot\a4.is\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 160
   at CompiledRazorTemplates.Dynamic.RazorEngine_29cd52707aa54cdfae15ef4163406131.Execute() in C:\inetpub\wwwroot\a4.is\Files\Templates\Designs\Rapido\_parsed\Page.parsed.cshtml:line 7933
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

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