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