Error executing template "Designs/ClientBase_generated/_parsed/ProductDetailPage.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend.EcomFrontendServices.RenderProductAndVariants(String ProductId, String VariantId, String GroupId, String LangId, PageView PageView) in C:\vso\KoksNewHorizon\BluedeskBaseSolution\ClientBase\ItemTypes\Bluedesk.DynamicWeb.ItemTypes.BaseSolution\Frontend\ProductAndVariants.cs:line 197
at CompiledRazorTemplates.Dynamic.RazorEngine_45d6bcebe74d41c1b90b5b4df2a3f0ed.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ProductDetailPage.parsed.cshtml:line 178
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.ParagraphViewModel>
2
3 @using System.Web;
4 @using System.Collections.Generic;
5 @using Dynamicweb;
6 @using Dynamicweb.Content.Items;
7 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
8 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend;
9 @using Bluedesk.DynamicWeb.ItemTypes;
10
11 @Title("Configuration page template")
12
13 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
14
15 @using System;
16 @using System.Web;
17 @using System.Linq;
18 @using System.Globalization;
19
20 @using Dynamicweb;
21 @using Dynamicweb.Content.Items;
22 @using Dynamicweb.Environment;
23 @using Dynamicweb.Frontend;
24 @using Dynamicweb.Frontend.Navigation;
25
26 @using Bluedesk.Tools.Generic;
27
28 @using Bluedesk.DynamicWeb.ItemTypes;
29 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
30 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
31
32 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
33
34 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
35 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend;
36
37 @{
38
39 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration");
40 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>();
41
42 bool HideStandardFooter = mc.FooterConfiguration.HideStandardFooter.ToString() == "True" ? true : false;
43
44 string MasterConfigCssClass = !string.IsNullOrWhiteSpace(mc.CssClass) ? mc.CssClass : "";
45
46 // GeneralConfig GeneralConfiguration = mc.GeneralConfiguration;
47 EcomConfig EcommerceConfiguration = mc.EcomConfiguration;
48
49 bool WithVATBool = Pageview.Area.EcomPricesWithVat == "True";
50 bool pricesWithoutVatForUsers = EcommerceConfiguration.ShowPricesWithoutVatForUsers;
51 bool pricesWithoutVatForValidVat = EcommerceConfiguration.ShowPricesWithoutVatWhenValidVatNumber;
52 if(pricesWithoutVatForUsers && !pricesWithoutVatForValidVat && Pageview.User != null) {
53 WithVATBool = false;
54 }
55 if(pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber)) {
56 WithVATBool = false;
57 }
58 string ecomShowPricesWithVat = WithVATBool.ToString().ToLower();
59 string ecomPricesFormatted = (EcommerceConfiguration.FormattedPrices).ToString().ToLower();
60
61 bool IsNotContentManager = false;
62 bool isVisualEditor = Pageview.IsVisualEditorMode;
63
64 if (isVisualEditor)
65 {
66 System.Web.HttpContext.Current.Session["PreviousPage"] = Pageview.Page.ID;
67 IsNotContentManager = (Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser()?.Groups?.All(g => g.Name != "Content managers") ?? true);
68 }
69
70 BaseSettingsObj BaseSettings = new BaseSettingsObj();
71
72 BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview);
73 HttpContext.Current.Session["BaseSettings"] = BaseSettings;
74
75 //if (HttpContext.Current.Session["BaseSettings"] == null)
76 //{
77
78 //}
79 //else
80 //{
81 // BaseSettings = (BaseSettingsObj)HttpContext.Current.Session["BaseSettings"];
82 // if (BaseSettings.AreaID != Pageview.AreaID)
83 // {
84 // BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview);
85 // HttpContext.Current.Session["BaseSettings"] = BaseSettings;
86 // }
87 //}
88
89 BaseSettingsBrandConfiguration BaseSettingsBrandConfiguration = BaseSettings.BrandConfiguration;
90 BaseSettingsButtons BaseSettingsButtons = BaseSettingsBrandConfiguration.Buttons;
91
92 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration");
93
94 var httpdomain = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain();
95 var lang = Pageview.Area.CultureInfo.TwoLetterISOLanguageName;
96 var langName = Pageview.Area.Culture;
97
98 var csrftoken = application._webapi.Helper.CSRFHelper.TokenHeaderValue();
99 var designRoot = BaseSettings.DesignRoot;
100
101 var phonenumber = BaseSettings.CorporateSettings.Phonenumber;
102 var formattedPhonenumber = phonenumber.Replace(" ", String.Empty);
103 var emailadress = BaseSettings.CorporateSettings.Emailadress;
104 var buttonIconClass = Pageview.Area.Item["Global_button_icon"] != null ? Pageview.Area.Item["Global_button_icon"].ToString().Replace("+", " ") : "fal fa-arrow-right";
105 var callmebackformlink = BaseSettings.BrandConfiguration.CallMeBackForm;
106 var mobileThemeColor = BaseSettings.BrandConfiguration.MobileThemeColor;
107
108 bool isOffline = false;
109
110 DateTime workingHoursStart = BaseSettings.CorporateSettings.OpeningTime;
111 DateTime workingHoursEnd = BaseSettings.CorporateSettings.ClosingTime;
112 DateTime today = DateTime.Now;
113 var cHour = DateTime.Now.TimeOfDay;
114 int cDay = (int)DateTime.Now.DayOfWeek;
115 string availableToHour24hFormat = workingHoursEnd.TimeOfDay.ToString().Substring(0, 5);
116 var timeFromInput = DateTime.ParseExact(availableToHour24hFormat, "H:m", null, DateTimeStyles.None);
117 string availableToHour12hFormat = timeFromInput.ToString("hh:mm tt", CultureInfo.InvariantCulture);
118 var availableToHour = lang == "en" ? availableToHour12hFormat : availableToHour24hFormat;
119 bool isOvertime = cHour >= workingHoursEnd.TimeOfDay || cHour <= workingHoursStart.TimeOfDay;
120 bool isNoValidDate = today < workingHoursStart || today > workingHoursEnd;
121 if (isNoValidDate || isOvertime)
122 {
123 isOffline = true;
124 }
125
126 Boolean showBreadcrumbs = Pageview.Page.PropertyItem != null && Pageview.Page.PropertyItem["ShowBreadcrumbs"] != null ? Convert.ToBoolean(Pageview.Page.PropertyItem["ShowBreadcrumbs"]) : false;
127
128 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css");
129
130 var favicon32 = Cache.VersionedFile(designRoot + "/assets/img/favicon-32.png", true);
131 var favicon16 = Cache.VersionedFile(designRoot + "/assets/img/favicon-16.png", true);
132 var favicon = Cache.VersionedFile(designRoot + "/assets/img/favicon.ico", true);
133
134 favicon = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon) ? BaseSettings.BrandConfiguration.Favicons.Favicon : favicon;
135 favicon16 = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon16) ? BaseSettings.BrandConfiguration.Favicons.Favicon16 : favicon16;
136 favicon32 = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon32) ? BaseSettings.BrandConfiguration.Favicons.Favicon32 : favicon32;
137
138 var appbundlejs = Cache.VersionedFile(designRoot + "/dist/app.bundle.js");
139 var appAsyncbundlejs = Cache.VersionedFile(designRoot + "/dist/appAsync.bundle.js");
140 var vuebundlejs = Cache.VersionedFile(designRoot + "/dist/vue.bundle.js");
141
142 //*** Start Scanapp configuration ***\\
143 bool hideHeader = false;
144 bool hideFooter = false;
145 bool hideBottombar = false;
146
147 if (HttpContext.Current.Session["ScanApp"] != null)
148 {
149 hideHeader = mc.ScanAppConfig.ShowHeader;
150 hideFooter = mc.ScanAppConfig.ShowFooter;
151 hideBottombar = mc.ScanAppConfig.ShowBottombar;
152 }
153 // END Scanapp configration **\\
154
155 }
156
157
158 @{
159 ProductDetailPage _data = ItemManager.Storage.GetById<ProductDetailPage>(Pageview.Item.Id.ToString());
160
161 string ProductId = _data.Product.ToString();
162 string VariantId = "";
163
164
165 ProductId = ProductId.Replace("p_", "");
166
167 if (ProductId.Contains(":"))
168 {
169
170 VariantId = ProductId.Split(':')?[1];
171 ProductId = ProductId.Split(':')?[0];
172
173 }
174
175 ProductDetailServices ProductDetailServices = new ProductDetailServices();
176 EcomFrontendServices EcomFrontendServices = new EcomFrontendServices();
177
178 HttpContext.Current.Session["ProductAndVariants"] = EcomFrontendServices.RenderProductAndVariants(ProductId, VariantId, "", Pageview.Area.EcomLanguageId, Pageview);
179
180 ProductObj ProductObj = (ProductObj) HttpContext.Current.Session["ProductDetails"];
181 ProductAndVariantsObj ProductAndVariantsObj = (ProductAndVariantsObj) HttpContext.Current.Session["ProductAndVariants"];
182 }
183
184 <!DOCTYPE html>
185 <html prefix="og: http://ogp.me/ns#">
186 <head>
187 <script>
188 window.globals = {
189 pageId: '@Pageview.ID',
190 Token: '@csrftoken',
191 DW_AREA_CULTURE: '@langName',
192 DW_AREA_CULTURE_SHORT: '@lang',
193 globalIconClass: '@buttonIconClass',
194 DW_USERID: '@Dynamicweb.Security.UserManagement.User.GetCurrentExtranetUserId()'
195 };
196 </script>
197 <style>
198 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
199 @using Dynamicweb;
200
201 @using System.Data;
202 @using System.Data.SqlClient;
203 @using Bluedesk.Tools.DynamicWeb.DataAccess;
204
205 @using Bluedesk.DynamicWeb.ItemTypes;
206 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
207 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
208 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
209
210 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend;
211
212 @Title("Configuration page template")
213
214 @{
215
216 string RoundedCornersValue = BaseSettings.BrandConfiguration.RoundedCorners;
217 string ButtonHeight = BaseSettings.BrandConfiguration.ButtonHeight;
218
219 string fontawesomeFontFamily = "Font Awesome 5 Pro";
220 int fontawesomeFontWeight = 300;
221
222 switch (BaseSettings.BrandConfiguration.FontawesomeStyle)
223 {
224
225 case "fal":
226 fontawesomeFontWeight = 300;
227 break;
228 case "far":
229 fontawesomeFontWeight = 400;
230 break;
231 case "fas":
232 fontawesomeFontWeight = 900;
233 break;
234 case "fad":
235 fontawesomeFontWeight = 900;
236 fontawesomeFontFamily = "Font Awesome 5 Duotone";
237 break;
238 }
239
240 }
241
242 @BaseSettingServices.RenderButtonCSS("btn__primary", BaseSettingsButtons.PrimaryButtonConfiguration)
243 @BaseSettingServices.RenderButtonCSS("btn__secondary", BaseSettingsButtons.SecondaryButtonConfiguration)
244 @BaseSettingServices.RenderButtonCSS("btn__contrast", BaseSettingsButtons.ContrastButtonConfiguration)
245
246 :root,
247 body {
248
249 --BaseColorPrimary : @BaseSettingsBrandConfiguration.BaseColorPrimary;
250 --BaseColorSecondary : @BaseSettingsBrandConfiguration.BaseColorSecondary;
251 --BaseColorContrast : @BaseSettingsBrandConfiguration.BaseColorContrast;
252
253 --BaseFontPrimary : @BaseSettingsBrandConfiguration.PrimaryFontFamily;
254 --BaseFontSecondary : @BaseSettingsBrandConfiguration.PrimaryFontFamily;
255
256 @BaseSettings.BrandConfiguration.BodyInlineStyles
257 --StandardUnitSize : 3.2rem;
258 }
259
260 .footer {
261 --FooterContainerDisplay: none !important;
262 display: var(--FooterContainerDisplay)
263 }
264
265 h1, h2, h3, h4, h5, h6 { @BaseSettings.BrandConfiguration.HeaderInlineStyles }
266
267 h1.cta-paragraph__header { @BaseSettings.BrandConfiguration.H1InlineStyles }
268 h2.cta-paragraph__header { @BaseSettings.BrandConfiguration.H2InlineStyles }
269 h3.cta-paragraph__header { @BaseSettings.BrandConfiguration.H3InlineStyles }
270 h4.cta-paragraph__header { @BaseSettings.BrandConfiguration.H4InlineStyles }
271
272 .po-block__addtocart .btn,
273 .productdetails__add-to-cart,
274 .searchbox__input {
275 border-radius: @RoundedCornersValue;
276 }
277
278 main.blur {
279 filter: grayscale(50%) blur(15px);
280 -webkit-filter: grayscale(50%) blur(15px);
281 }
282
283 .AdvancedGridButton {
284 --BorderRadius: @RoundedCornersValue;
285 }
286
287 .btn {
288 height: var(--StandardUnitSize);
289 }
290
291 .btn__icon {
292
293 --fontawesomeFontFamily : "@fontawesomeFontFamily";
294 --fontawesomeFontWeight : @fontawesomeFontWeight;
295
296 font-family: var(--fontawesomeFontFamily);
297 font-weight: var(--fontawesomeFontWeight);
298
299 -moz-osx-font-smoothing: grayscale;
300 -webkit-font-smoothing: antialiased;
301 display: inline-block;
302 font-style: normal;
303 font-variant: normal;
304 text-rendering: auto;
305 line-height: 1;
306
307 }
308
309 .cta-paragraph {
310 background-color: var(--mainBackgroundColor);
311 }
312
313 .cta-paragraph__container {
314 background-color: var(--contentBackgroundColor);
315 border: var(--contentBorder);
316 }
317
318 .cta-paragraph__subheader,
319 .cta-paragraph__header,
320 .cta-paragraph__text p,
321 .cta-paragraph__text li {
322 color: var(--Color);
323 background-color: var(--BackgroundColor);
324 border-color: var(--BorderColor);
325 position: var(--Position);
326 top: var(--Top);
327 left: var(--Left);
328 right: var(--Right);
329 bottom: var(--Bottom);
330 padding: var(--Padding);
331 border: var(--BorderSize);
332 font-size: var(--FontSize);
333 text-transform: var(--FontStyle);
334 line-height: var(--LineHeight);
335 font-weight: var(--FontWeight);
336 font-family: var(--FontFamily);
337 border-radius: var(--BorderRadius);
338 }
339
340 .cta-paragraph__content-container {
341 align-items: var(--ContentElementAlignmentAlignItems);
342 text-align: var(--ContentElementAlignmentTextAlign);
343 }
344
345 .cta-paragraph__btn-navigation,
346 .cta-paragraph__content-container {
347 align-items : var(--ContainerFitContentAlignmentAlignItems);
348 justify-content: var(--ContainerFitContentAlignmentJustifyContent);
349 }
350
351 .jumbotron__subheader,
352 .jumbotron__header,
353 .jumbotron__shoutbox-intro p,
354 .jumbotron__shoutbox-intro li,
355 .header--desktop.headerNew {
356 position: relative;
357 }
358
359 .header--desktop.headerNew.stickyheader {
360 position: fixed;
361 }
362
363 @@media screen and (min-width: 992px){
364 .image-left {
365 justify-content: flex-end;
366 flex-direction: row;
367 }
368
369 .image-right {
370 justify-content: flex-start;
371 flex-direction: row-reverse;
372 }
373 }
374
375 .AdvancedGrid__row {
376 background-color: var(--BackgroundColor);
377 }
378
379 .cta-paragraph__btn-navigation {
380 padding: 1.2rem 0rem !important;
381 }
382
383 .AdvancedGrid,
384 .AdvancedGrid__container {
385 width: 100%;
386 background-image: var(--BackgroundImage);
387 min-height: var(--Height);
388 }
389
390 @{
391
392 int PageViewId = Pageview.Page.ID;
393 int AreaId = Pageview.AreaID;
394
395 // HttpContext.Current.Session["PageIdForStyles"] = Pageview.Page.ID;
396 // HttpContext.Current.Session["AreaIdForStyles"] = Pageview.AreaID;
397
398 DataTable AdvancedGridStylesDataTable = null;
399
400 AdvancedGridStylesDataTable = DynamicwebData.Query($@"
401
402 SELECT
403 InlineStyles AS Styles
404
405 FROM
406 [dbo].[ItemType_AdvancedGridConfiguration] AS AGC
407 LEFT JOIN [dbo].[GridRow] AS GR ON GR.GridRowItemId = AGC.Id
408
409 WHERE
410 GR.GridRowPageId = @PageId;
411
412 ", new SqlParameter("PageId", PageViewId));
413
414 DataTable BackgroundConfigDataTable = null;
415
416 BackgroundConfigDataTable = DynamicwebData.Query($@"
417
418 SELECT
419 distinct(BG.Stylesheet) AS Styles
420
421 FROM [dbo].GridRow AS GR
422 INNER JOIN dbo.Paragraph AS PG ON PG.ParagraphGridRowId = GR.GridRowId
423 LEFT JOIN dbo.ItemType_CTAParagraph AS CTA ON CTA.Id = PG.ParagraphItemId
424 LEFT JOIN dbo.ItemType_MultiColumnParagraph AS MCP ON MCP.Id = PG.ParagraphItemId
425 LEFT JOIN dbo.ItemType_Carousel AS CS ON CS.Id = PG.ParagraphItemId
426 LEFT JOIN dbo.ItemType_BackgroundConfiguration AS BG ON CTA.BackgroundConfigurationID = BG.Id
427 OR MCP.BackgroundConfigurationID = BG.Id
428 OR CS.BackgroundConfigurationID = BG.Id
429
430 WHERE GR.GridRowPageID=@PageId
431 AND bg.Stylesheet Is NOT NULL", new SqlParameter("PageId", PageViewId));
432
433 DataTable ButtonConfigDataTable = null;
434
435 ButtonConfigDataTable = DynamicwebData.Query($@"
436
437 SELECT
438 distinct(BCONF.Stylesheet) AS Styles
439
440 FROM [dbo].GridRow AS GR
441 LEFT JOIN [dbo].Paragraph AS P ON P.ParagraphGridRowId = GR.GridRowId
442 LEFT JOIN [dbo].ItemType_CTAParagraph AS CTAP ON CTAP.Id = P.ParagraphItemId
443
444 LEFT JOIN [dbo].ItemType_MultiColumnParagraph AS MCP ON MCP.Id = P.ParagraphItemId
445 LEFT JOIN [dbo].[ItemList] AS ColumnIL ON ColumnIL.ItemListId = MCP.ParagraphListID
446 LEFT JOIN [dbo].[ItemListRelation] AS ColumnILR ON ColumnIL.ItemListId = ColumnILR.ItemListRelationItemListId
447 LEFT JOIN [dbo].[ItemType_ParagraphColumn] AS PC ON PC.Id = ColumnILR.ItemListRelationItemId
448
449 LEFT JOIN [dbo].ItemType_Carousel AS CS ON CS.Id = P.ParagraphItemId
450 LEFT JOIN [dbo].[ItemList] AS CIIL ON CIIL.ItemListId = CS.CarouselListID
451 LEFT JOIN [dbo].[ItemListRelation] AS CIILR ON CIIL.ItemListId = CIILR.ItemListRelationItemListId
452 LEFT JOIN [dbo].ItemType_CarouselItem AS CI ON CI.Id = CIILR.ItemListRelationItemId
453
454 LEFT JOIN [dbo].[ItemType_JumbotronContainer] AS JC ON JC.Id = P.ParagraphItemId
455 LEFT JOIN [dbo].[ItemList] AS JCIL ON JCIL.ItemListId = JC.JumbotronListID
456 LEFT JOIN [dbo].[ItemListRelation] AS JCILR ON JCIL.ItemListId = JCILR.ItemListRelationItemListId
457 LEFT JOIN [dbo].ItemType_JumbotronListItem AS JCLI ON JCLI.Id = JCILR.ItemListRelationItemId
458
459 LEFT JOIN [dbo].[ItemType_CTAButton] AS CTAB ON
460 CTAP.ButtonID = CTAB.Id
461 OR CTAP.ExtraButtonID = CTAB.Id
462 OR MCP.ButtonID = CTAB.Id
463 OR PC.ButtonID = CTAB.Id
464 OR PC.ExtraButtonID = CTAB.Id
465 OR CS.ButtonID = CTAB.Id
466 OR CI.ButtonID = CTAB.Id
467 OR CI.ExtraButtonID = CTAB.Id
468 OR JCLI.ButtonID = CTAB.Id
469 LEFT JOIN [dbo].[ItemType_ButtonConfiguration] AS BCONF ON CTAB.ButtonConfigurationID = BCONF.Id
470
471 WHERE
472 GR.GridRowPageID = @PageId
473 AND GR.GridRowActive = 1
474 AND CTAB.ButtonConfigurationID Is NOT NULL", new SqlParameter("PageId", PageViewId));
475
476 DataTable MasterConfigDataTable = null;
477
478 MasterConfigDataTable = DynamicwebData.Query($@"
479
480 SELECT
481 MC.CustomCSS
482
483 FROM
484 [dbo].[Page] AS P
485 INNER JOIN [dbo].[ItemType_MasterConfig] AS MC ON P.PageItemId = MC.Id
486
487 WHERE
488 p.PageItemType = 'MasterConfig'
489 AND PageAreaId = @AreaId;", new SqlParameter("AreaId", AreaId));
490
491 if (AdvancedGridStylesDataTable != null && AdvancedGridStylesDataTable.Rows.Count > 0)
492 {
493 for (int i = 0; i < AdvancedGridStylesDataTable.Rows.Count; i++)
494 {
495 @AdvancedGridStylesDataTable.Rows[i]["Styles"].ToString();
496 }
497 }
498
499 if (BackgroundConfigDataTable != null && BackgroundConfigDataTable.Rows.Count > 0)
500 {
501 for (int i = 0; i < BackgroundConfigDataTable.Rows.Count; i++)
502 {
503 @BackgroundConfigDataTable.Rows[i]["Styles"].ToString();
504 }
505 }
506
507 if (ButtonConfigDataTable != null && ButtonConfigDataTable.Rows.Count > 0)
508 {
509 for (int i = 0; i < ButtonConfigDataTable.Rows.Count; i++)
510 {
511 @ButtonConfigDataTable.Rows[i]["Styles"].ToString();
512 }
513 }
514
515 @MasterConfigDataTable.Rows[0]["CustomCSS"].ToString();
516 }
517
518 </style>
519
520 @{ List<AdvancedGrid> AdvancedGrids = FrontendServices.RenderAdvancedGrid(Pageview, Pageview.Page.ID.ToString()); }
521
522 <style>
523 @{
524 if(AdvancedGrids != null && AdvancedGrids.Count > 0)
525 {
526 foreach (AdvancedGrid AdvancedGrid in AdvancedGrids)
527 {
528 @AdvancedGrid.InlineStyles
529 }
530 }
531 }
532 </style>
533 </head>
534 <body>
535 <link href="@appcss" rel="stylesheet" />
536 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
537 @using System;
538 @using System.Web;
539 @using System.Linq;
540 @using System.Globalization;
541
542 @using Dynamicweb;
543 @using Dynamicweb.Content.Items;
544 @using Dynamicweb.Environment;
545 @using Dynamicweb.Frontend;
546 @using Dynamicweb.Frontend.Navigation;
547
548 @using Bluedesk.Tools.Generic;
549
550 @using Bluedesk.DynamicWeb.ItemTypes;
551 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
552 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
553
554 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
555 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
556 @using Bluedesk.DynamicWeb.ItemTypes.Extensions;
557
558 @helper RenderCSSKeyAndValue(string Key, string Value)
559 {
560 if (!string.IsNullOrWhiteSpace(Value))
561 {
562 <text>@Key : @Value !important;</text>
563 }
564 }
565
566 @helper SetFontCSSVariables(FontConfigurationItemTab FontConfiguration)
567 {
568
569 string Top = FontConfiguration.top != 0 ? FontConfiguration.top.ToString() + "px" : "";
570 string Left = FontConfiguration.left != 0 ? FontConfiguration.left.ToString() + "px" : "";
571 string Right = FontConfiguration.right != 0 ? FontConfiguration.right.ToString() + "px" : "";
572 string Bottom = FontConfiguration.bottom != 0 ? FontConfiguration.bottom.ToString() + "px" : "";
573
574 string Position = FontConfiguration.PositionAbsolute ? "absolute" : "relative";
575
576 string Color = FontConfiguration.Color?.GetColorCode(Pageview.AreaID) ?? "";
577 string BackgroundColor = FontConfiguration.Backgroundcolor?.GetColorCode(Pageview.AreaID) ?? "";
578
579 string BorderColor = FontConfiguration.BorderColor?.GetColorCode(Pageview.AreaID) ?? "";
580 string BorderSize = FontConfiguration.BorderSize != 0 ? FontConfiguration.BorderSize.ToString() + "px" : "";
581
582 <text>
583
584 --Position: @Position;
585
586 @RenderCSSKeyAndValue("--Padding", FontConfiguration.Padding)
587
588 @RenderCSSKeyAndValue("--Top", Top)
589 @RenderCSSKeyAndValue("--Left", Left)
590 @RenderCSSKeyAndValue("--Right", Right)
591 @RenderCSSKeyAndValue("--Bottom", Bottom)
592
593 @RenderCSSKeyAndValue("--Color", Color)
594 @RenderCSSKeyAndValue("--FontSize", FontConfiguration.FontSize)
595 @RenderCSSKeyAndValue("--FontStyle", FontConfiguration.FontStyle)
596
597 @RenderCSSKeyAndValue("--FontWeight", FontConfiguration.FontWeight)
598 @RenderCSSKeyAndValue("--FontFamily", FontConfiguration.FontConfiguration.FontFamily)
599 @RenderCSSKeyAndValue("--LineHeight", FontConfiguration.LineHeight)
600
601 @RenderCSSKeyAndValue("--BackgroundColor", BackgroundColor)
602 @RenderCSSKeyAndValue("--BorderColor", BorderColor)
603 @RenderCSSKeyAndValue("--BorderSize", BorderSize)
604
605 </text>
606
607 }
608
609 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel>
610 @using System;
611 @using System.Web;
612 @using System.Linq;
613 @using System.Globalization;
614
615 @using Dynamicweb;
616 @using Dynamicweb.Content.Items;
617 @using Dynamicweb.Environment;
618 @using Dynamicweb.Frontend;
619 @using Dynamicweb.Frontend.Navigation;
620
621 @using Bluedesk.Tools.Generic;
622
623 @using Bluedesk.DynamicWeb.ItemTypes;
624 @using Bluedesk.DynamicWeb.ItemTypes.Settings;
625
626 @using Bluedesk.DynamicWeb.ItemTypes.Configuration;
627 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution;
628 @using Bluedesk.DynamicWeb.ItemTypes.Extensions;
629 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration;
630
631
632 <header style="padding: 25px; display: flex; flex-direction: row;">
633 <div>
634 <h1>Branding Stylesheet || ProductId : @ProductId VariantId : @VariantId</h1>
635 <h2 style="font-weight: normal;">@Model.Title</h2>
636 </div>
637 <nav style="display: flex; flex-direction: row; margin-left: 50px">
638 <a href="javascript:history.back();" class="ConfigurationButton"><i class="icon fa-light fa-reply"></i><label>Terug</label></a>
639 <a href="/Default.aspx?ID=1598" class="ConfigurationButton"><i class="icon fa-light fa-diagram-cells"></i><label>Dashboard</label></a>
640 <a href="/Default.aspx?ID=1055" class="ConfigurationButton"><i class="icon fa-light fa-diagram-cells"></i><label>Masters</label></a>
641 <a href="/Default.aspx?ID=1055" class="ConfigurationButton"><i class="icon fa-light fa-link"></i><label>Buttons</label></a>
642 <a href="/Default.aspx?ID=1009" class="ConfigurationButton"><i class="icon fa-light fa-paintbrush"></i><label>Backgrounds</label></a>
643 <a href="/Default.aspx?ID=1460" class="ConfigurationButton"><i class="icon fa-light fa-megaphone"></i><label>Jumbotrons</label></a>
644 <a href="/Default.aspx?ID=1518" class="ConfigurationButton"><i class="icon fa-light fa-brush"></i><label>Themes</label></a>
645 <a href="/Default.aspx?ID=1450" class="ConfigurationButton"><i class="icon fa-light fa-font"></i><label>Fonts</label></a>
646 <a href="/Default.aspx?ID=1514" class="ConfigurationButton"><i class="icon fa-light fa-computer"></i><label>Devices</label></a>
647 </nav>
648 </header>
649
650 <style>
651 .ConfigurationButton {
652 display: flex;
653 flex-direction: column;
654 height: 100px;
655 width: 100px;
656 margin-right: 25px;
657 padding: 25px;
658 background-color: #f1f1f1;
659 justify-content: center;
660 align-items: center;
661 box-sizing: border-box;
662 text-align: center;
663 font-size: 12px;
664 }
665
666 .ConfigurationButton .icon {
667 font-size: 25px;
668 }
669 </style>
670
671 <script src="@appbundlejs"></script>
672 <script defer src="@vuebundlejs"></script>
673 <script defer src="@appAsyncbundlejs"></script>
674
675 @if (font_configuration != null)
676 {
677 foreach (var item in font_configuration.Item.ToCodeFirstItem<Bluedesk.DynamicWeb.ItemTypes.Pages.ConfigurationPagesParent>().GetChildConfigs<FontConfiguration>())
678 {
679 <link href="@item[" FontLink"]" rel="stylesheet">
680 }
681 }
682
683 <h2><i class="fa-regular fa-cart-shopping"></i> Product detail configuration page</h2>
684 <div style="display: flex; flex-direction: column; padding: 25px; background-color:#f1f1f1;">
685 @Model.Grid("ProductDetailPage", "Product Detail Page", "default:true;sort:1", "AdvancedGrid")
686 </div>
687
688 <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.15.4/css/all.css" integrity="sha384-rqn26AG5Pj86AF4SO72RK5fyefcQ/x32DNQfChxWvbXIyXFePlEktwD18fEz+kQU" crossorigin="anonymous">
689 <script src="https://kit.fontawesome.com/a46eca85e2.js" crossorigin="anonymous"></script>
690
691 </body>
692 </html>
693