Error compiling template "Designs/ClientBase_generated/_parsed/ThemeMaster.parsed.cshtml"
Line 408: 'Services' is obsolete: 'Use Dynamicweb.Content.Services instead.'
Line 408: 'Services.Items' is obsolete: 'Use Dynamicweb.Content.Services.Items instead.'
Line 409: 'Services' is obsolete: 'Use Dynamicweb.Content.Services instead.'
Line 409: 'Services.Pages' is obsolete: 'Use Dynamicweb.Content.Services.Pages instead.'
Line 439: 'Services' is obsolete: 'Use Dynamicweb.Content.Services instead.'
Line 439: 'Services.Pages' is obsolete: 'Use Dynamicweb.Content.Services.Pages instead.'
Line 462: A local variable or function named 'isVisualEditor' is already defined in this scope
Line 492: A local variable or function named 'font_configuration' is already defined in this scope
Line 492: 'Services' is obsolete: 'Use Dynamicweb.Content.Services instead.'
Line 492: 'Services.Pages' is obsolete: 'Use Dynamicweb.Content.Services.Pages instead.'
Line 499: A local variable or function named 'designRoot' is already defined in this scope
Line 528: A local variable or function named 'appcss' is already defined in this scope
Line 414: The variable 'isThemeMaster' is assigned but its value is never used
Line 508: The variable 'isOffline' is assigned but its value is never used

1 //------------------------------------------------------------------------------ 2 // <auto-generated> 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319.42000 5 // 6 // Changes to this file may cause incorrect behavior and will be lost if 7 // the code is regenerated. 8 // </auto-generated> 9 //------------------------------------------------------------------------------ 10 11 namespace CompiledRazorTemplates.Dynamic { 12 13 #line 311 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 14 using System; 15 16 #line default 17 #line hidden 18 using System.Collections.Generic; 19 20 #line 313 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 21 using System.Linq; 22 23 #line default 24 #line hidden 25 26 #line 316 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 27 using Dynamicweb; 28 29 #line default 30 #line hidden 31 32 #line 322 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 33 using Bluedesk.Tools.Generic; 34 35 #line default 36 #line hidden 37 38 #line 314 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 39 using System.Globalization; 40 41 #line default 42 #line hidden 43 44 #line 317 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 45 using Dynamicweb.Content.Items; 46 47 #line default 48 #line hidden 49 50 #line 324 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 51 using Bluedesk.DynamicWeb.ItemTypes; 52 53 #line default 54 #line hidden 55 56 #line 325 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 57 using Bluedesk.DynamicWeb.ItemTypes.Settings; 58 59 #line default 60 #line hidden 61 62 #line 319 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 63 using Dynamicweb.Frontend; 64 65 #line default 66 #line hidden 67 68 #line 320 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 69 using Dynamicweb.Frontend.Navigation; 70 71 #line default 72 #line hidden 73 74 #line 10 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 75 using Dynamicweb.Ecommerce.ProductCatalog; 76 77 #line default 78 #line hidden 79 80 #line 318 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 81 using Dynamicweb.Environment; 82 83 #line default 84 #line hidden 85 86 #line 312 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 87 using System.Web; 88 89 #line default 90 #line hidden 91 92 #line 330 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 93 using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 94 95 #line default 96 #line hidden 97 98 #line 327 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 99 using Bluedesk.DynamicWeb.ItemTypes.Configuration; 100101 #line default 102 #line hidden 103104 #line 328 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 105 using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 106107 #line default 108 #line hidden 109110 #line 49 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 111 using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 112113 #line default 114 #line hidden 115116 #line 329 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 117 using Bluedesk.DynamicWeb.ItemTypes.Extensions; 118119 #line default 120 #line hidden 121122123 public class RazorEngine_e5bd2bbe2c364ba58f0ec784d6582ad2 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> { 124125 #line hidden 126127 #line 259 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 128 public RazorEngine.Templating.TemplateWriter RenderCSSKeyAndValue(string Key, string Value) 129 { 130 #line default 131 #line hidden 132 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => { 133134 #line 260 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 135136 if (!string.IsNullOrWhiteSpace(Value)) 137 { 138139140 #line default 141 #line hidden 142 WriteLiteralTo(__razor_helper_writer, "\t\t"); 143144145 #line 263 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 146 WriteTo(__razor_helper_writer, Key); 147148149 #line default 150 #line hidden 151 WriteLiteralTo(__razor_helper_writer, " : "); 152153154 #line 263 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 155 WriteTo(__razor_helper_writer, Value); 156157158 #line default 159 #line hidden 160 WriteLiteralTo(__razor_helper_writer, " !important;"); 161162 WriteLiteralTo(__razor_helper_writer, "\r\n"); 163164165 #line 264 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 166 } 167168169 #line default 170 #line hidden 171 }); 172173 #line 265 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 174 } 175 #line default 176 #line hidden 177178179 #line 267 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 180 public RazorEngine.Templating.TemplateWriter SetFontCSSVariables(FontConfigurationItemTab FontConfiguration) 181 { 182 #line default 183 #line hidden 184 return new RazorEngine.Templating.TemplateWriter(__razor_helper_writer => { 185186 #line 268 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 187188189 string Top = FontConfiguration.top != 0 ? FontConfiguration.top.ToString() + "px" : ""; 190 string Left = FontConfiguration.left != 0 ? FontConfiguration.left.ToString() + "px" : ""; 191 string Right = FontConfiguration.right != 0 ? FontConfiguration.right.ToString() + "px" : ""; 192 string Bottom = FontConfiguration.bottom != 0 ? FontConfiguration.bottom.ToString() + "px" : ""; 193194 string Position = FontConfiguration.PositionAbsolute ? "absolute" : "relative"; 195196 string Color = FontConfiguration.Color?.GetColorCode(Pageview.AreaID) ?? ""; 197 string BackgroundColor = FontConfiguration.Backgroundcolor?.GetColorCode(Pageview.AreaID) ?? ""; 198199 string BorderColor = FontConfiguration.BorderColor?.GetColorCode(Pageview.AreaID) ?? ""; 200 string BorderSize = FontConfiguration.BorderSize != 0 ? FontConfiguration.BorderSize.ToString() + "px" : ""; 201202203204 #line default 205 #line hidden 206 WriteLiteralTo(__razor_helper_writer, "\t"); 207208 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n\t\t--Position:\t\t"); 209210211 #line 285 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 212 WriteTo(__razor_helper_writer, Position); 213214215 #line default 216 #line hidden 217 WriteLiteralTo(__razor_helper_writer, ";\r\n\r\n"); 218219 WriteLiteralTo(__razor_helper_writer, "\t\t"); 220221222 #line 287 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 223 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Padding", FontConfiguration.Padding)); 224225226 #line default 227 #line hidden 228 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n"); 229230 WriteLiteralTo(__razor_helper_writer, "\t\t"); 231232233 #line 289 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 234 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Top", Top)); 235236237 #line default 238 #line hidden 239 WriteLiteralTo(__razor_helper_writer, "\r\n"); 240241 WriteLiteralTo(__razor_helper_writer, "\t\t"); 242243244 #line 290 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 245 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Left", Left)); 246247248 #line default 249 #line hidden 250 WriteLiteralTo(__razor_helper_writer, "\r\n"); 251252 WriteLiteralTo(__razor_helper_writer, "\t\t"); 253254255 #line 291 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 256 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Right", Right)); 257258259 #line default 260 #line hidden 261 WriteLiteralTo(__razor_helper_writer, "\r\n"); 262263 WriteLiteralTo(__razor_helper_writer, "\t\t"); 264265266 #line 292 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 267 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Bottom", Bottom)); 268269270 #line default 271 #line hidden 272 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n"); 273274 WriteLiteralTo(__razor_helper_writer, "\t\t"); 275276277 #line 294 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 278 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--Color", Color)); 279280281 #line default 282 #line hidden 283 WriteLiteralTo(__razor_helper_writer, "\r\n"); 284285 WriteLiteralTo(__razor_helper_writer, "\t\t"); 286287288 #line 295 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 289 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--FontSize", FontConfiguration.FontSize)); 290291292 #line default 293 #line hidden 294 WriteLiteralTo(__razor_helper_writer, "\r\n"); 295296 WriteLiteralTo(__razor_helper_writer, "\t\t"); 297298299 #line 296 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 300 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--FontStyle", FontConfiguration.FontStyle)); 301302303 #line default 304 #line hidden 305 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n"); 306307 WriteLiteralTo(__razor_helper_writer, "\t\t"); 308309310 #line 298 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 311 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--FontWeight", FontConfiguration.FontWeight)); 312313314 #line default 315 #line hidden 316 WriteLiteralTo(__razor_helper_writer, "\r\n"); 317318 WriteLiteralTo(__razor_helper_writer, "\t\t"); 319320321 #line 299 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 322 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--FontFamily", FontConfiguration.FontConfiguration.FontFamily)); 323324325 #line default 326 #line hidden 327 WriteLiteralTo(__razor_helper_writer, "\r\n"); 328329 WriteLiteralTo(__razor_helper_writer, "\t\t"); 330331332 #line 300 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 333 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--LineHeight", FontConfiguration.LineHeight)); 334335336 #line default 337 #line hidden 338 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n"); 339340 WriteLiteralTo(__razor_helper_writer, "\t\t"); 341342343 #line 302 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 344 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--BackgroundColor", BackgroundColor)); 345346347 #line default 348 #line hidden 349 WriteLiteralTo(__razor_helper_writer, "\r\n"); 350351 WriteLiteralTo(__razor_helper_writer, "\t\t"); 352353354 #line 303 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 355 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--BorderColor", BorderColor)); 356357358 #line default 359 #line hidden 360 WriteLiteralTo(__razor_helper_writer, "\r\n"); 361362 WriteLiteralTo(__razor_helper_writer, "\t\t"); 363364365 #line 304 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 366 WriteTo(__razor_helper_writer, RenderCSSKeyAndValue("--BorderSize", BorderSize)); 367368369 #line default 370 #line hidden 371 WriteLiteralTo(__razor_helper_writer, "\r\n\r\n\t"); 372373 WriteLiteralTo(__razor_helper_writer, "\r\n"); 374375376 #line 307 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 377378379380 #line default 381 #line hidden 382 }); 383384 #line 308 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 385 } 386 #line default 387 #line hidden 388389390 public RazorEngine_e5bd2bbe2c364ba58f0ec784d6582ad2() { 391 } 392393 public override void Execute() { 394 WriteLiteral("\r\n"); 395396397 #line 13 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 398 Write(Title("Configuration page template")); 399400401 #line default 402 #line hidden 403 WriteLiteral("\r\n\r\n"); 404405406 #line 15 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 407408 var websitesettings = Dynamicweb.Services.Items.GetItemById<WebsiteSettings>(Model.Area.Item.Id); 409 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration"); 410411 var designRoot = "/Files/Templates/Designs/" + Pageview.Area.Layout.Design.Name; 412 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css"); 413414 bool isThemeMaster = true; 415416 bool isVisualEditor = Dynamicweb.Context.Current.Request.GetBoolean("visualedit"); 417418419 #line default 420 #line hidden 421 WriteLiteral("\r\n\r\n"); 422423 WriteLiteral("\r\n"); 424425 WriteLiteral("\r\n"); 426427 WriteLiteral("\r\n"); 428429 WriteLiteral("\r\n"); 430431 WriteLiteral("\r\n"); 432433 WriteLiteral("\r\n"); 434435436 #line 51 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 437438439 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 440 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>(); 441442 bool HideStandardFooter = mc.FooterConfiguration.HideStandardFooter.ToString() == "True" ? true : false; 443444 string MasterConfigCssClass = !string.IsNullOrWhiteSpace(mc.CssClass) ? mc.CssClass : ""; 445446 // GeneralConfig GeneralConfiguration = mc.GeneralConfiguration; 447 EcomConfig EcommerceConfiguration = mc.EcomConfiguration; 448449 bool WithVATBool = Pageview.Area.EcomPricesWithVat == "True"; 450 bool pricesWithoutVatForUsers = EcommerceConfiguration.ShowPricesWithoutVatForUsers; 451 bool pricesWithoutVatForValidVat = EcommerceConfiguration.ShowPricesWithoutVatWhenValidVatNumber; 452 if(pricesWithoutVatForUsers && !pricesWithoutVatForValidVat && Pageview.User != null) { 453 WithVATBool = false; 454 } 455 if(pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber)) { 456 WithVATBool = false; 457 } 458 string ecomShowPricesWithVat = WithVATBool.ToString().ToLower(); 459 string ecomPricesFormatted = (EcommerceConfiguration.FormattedPrices).ToString().ToLower(); 460461 bool IsNotContentManager = false; 462 bool isVisualEditor = Pageview.IsVisualEditorMode; 463464 if (isVisualEditor) 465 { 466 System.Web.HttpContext.Current.Session["PreviousPage"] = Pageview.Page.ID; 467 IsNotContentManager = (Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser()?.Groups?.All(g => g.Name != "Content managers") ?? true); 468 } 469470 BaseSettingsObj BaseSettings = new BaseSettingsObj(); 471472 BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview); 473 HttpContext.Current.Session["BaseSettings"] = BaseSettings; 474475 //if (HttpContext.Current.Session["BaseSettings"] == null) 476 //{ 477478 //} 479 //else 480 //{ 481 // BaseSettings = (BaseSettingsObj)HttpContext.Current.Session["BaseSettings"]; 482 // if (BaseSettings.AreaID != Pageview.AreaID) 483 // { 484 // BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview); 485 // HttpContext.Current.Session["BaseSettings"] = BaseSettings; 486 // } 487 //} 488489 BaseSettingsBrandConfiguration BaseSettingsBrandConfiguration = BaseSettings.BrandConfiguration; 490 BaseSettingsButtons BaseSettingsButtons = BaseSettingsBrandConfiguration.Buttons; 491492 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration"); 493494 var httpdomain = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 495 var lang = Pageview.Area.CultureInfo.TwoLetterISOLanguageName; 496 var langName = Pageview.Area.Culture; 497498 var csrftoken = application._webapi.Helper.CSRFHelper.TokenHeaderValue(); 499 var designRoot = BaseSettings.DesignRoot; 500501 var phonenumber = BaseSettings.CorporateSettings.Phonenumber; 502 var formattedPhonenumber = phonenumber.Replace(" ", String.Empty); 503 var emailadress = BaseSettings.CorporateSettings.Emailadress; 504 var buttonIconClass = Pageview.Area.Item["Global_button_icon"] != null ? Pageview.Area.Item["Global_button_icon"].ToString().Replace("+", " ") : "fal fa-arrow-right"; 505 var callmebackformlink = BaseSettings.BrandConfiguration.CallMeBackForm; 506 var mobileThemeColor = BaseSettings.BrandConfiguration.MobileThemeColor; 507508 bool isOffline = false; 509510 DateTime workingHoursStart = BaseSettings.CorporateSettings.OpeningTime; 511 DateTime workingHoursEnd = BaseSettings.CorporateSettings.ClosingTime; 512 DateTime today = DateTime.Now; 513 var cHour = DateTime.Now.TimeOfDay; 514 int cDay = (int)DateTime.Now.DayOfWeek; 515 string availableToHour24hFormat = workingHoursEnd.TimeOfDay.ToString().Substring(0, 5); 516 var timeFromInput = DateTime.ParseExact(availableToHour24hFormat, "H:m", null, DateTimeStyles.None); 517 string availableToHour12hFormat = timeFromInput.ToString("hh:mm tt", CultureInfo.InvariantCulture); 518 var availableToHour = lang == "en" ? availableToHour12hFormat : availableToHour24hFormat; 519 bool isOvertime = cHour >= workingHoursEnd.TimeOfDay || cHour <= workingHoursStart.TimeOfDay; 520 bool isNoValidDate = today < workingHoursStart || today > workingHoursEnd; 521 if (isNoValidDate || isOvertime) 522 { 523 isOffline = true; 524 } 525526 Boolean showBreadcrumbs = Pageview.Page.PropertyItem != null && Pageview.Page.PropertyItem["ShowBreadcrumbs"] != null ? Convert.ToBoolean(Pageview.Page.PropertyItem["ShowBreadcrumbs"]) : false; 527528 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css"); 529530 var favicon32 = Cache.VersionedFile(designRoot + "/assets/img/favicon-32.png", true); 531 var favicon16 = Cache.VersionedFile(designRoot + "/assets/img/favicon-16.png", true); 532 var favicon = Cache.VersionedFile(designRoot + "/assets/img/favicon.ico", true); 533534 favicon = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon) ? BaseSettings.BrandConfiguration.Favicons.Favicon : favicon; 535 favicon16 = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon16) ? BaseSettings.BrandConfiguration.Favicons.Favicon16 : favicon16; 536 favicon32 = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon32) ? BaseSettings.BrandConfiguration.Favicons.Favicon32 : favicon32; 537538 var appbundlejs = Cache.VersionedFile(designRoot + "/dist/app.bundle.js"); 539 var appAsyncbundlejs = Cache.VersionedFile(designRoot + "/dist/appAsync.bundle.js"); 540 var vuebundlejs = Cache.VersionedFile(designRoot + "/dist/vue.bundle.js"); 541542 //*** Start Scanapp configuration ***\\ 543 bool hideHeader = false; 544 bool hideFooter = false; 545 bool hideBottombar = false; 546547 if (HttpContext.Current.Session["ScanApp"] != null) 548 { 549 hideHeader = mc.ScanAppConfig.ShowHeader; 550 hideFooter = mc.ScanAppConfig.ShowFooter; 551 hideBottombar = mc.ScanAppConfig.ShowBottombar; 552 } 553 // END Scanapp configration **\\ 554555556557 #line default 558 #line hidden 559 WriteLiteral("\r\n\r\n\r\n<!DOCTYPE html>\r\n<html"); 560561 WriteLiteral(" prefix=\"og: http://ogp.me/ns#\""); 562563 WriteLiteral(">\r\n<head>\r\n\t"); 564565 WriteLiteral("\r\n\r\n</head>\r\n\r\n<body>\r\n\r\n\t<script"); 566567 WriteLiteral(" type=\"text/javascript\""); 568569 WriteLiteral(@"> 570571 var stylesDump; 572573 function onTryItClick(variable) { 574575 var StyleID = variable + 'Style'; 576 var contentID = variable + 'Content'; 577 var frameID = variable + 'Frame'; 578 var MasterConfigID = 'MasterConfig'; 579580 var style = document.getElementById(StyleID).innerHTML; 581 var MasterConfig = document.getElementById(MasterConfigID).innerHTML; 582 var content = document.getElementById(contentID).innerHTML; 583 var iframe = document.getElementById(frameID); 584585 stylesDump = stylesDump + style; 586587 var frameDoc = iframe.document; 588 if (iframe.contentWindow) 589 frameDoc = iframe.contentWindow.document; 590591 frameDoc.open(); 592 frameDoc.writeln(content); 593 frameDoc.writeln(MasterConfig); 594 frameDoc.writeln(stylesDump); 595 frameDoc.close(); 596597 document.getElementById(contentID).remove(); 598599 } 600601 </script> 602603 <section"); 604605 WriteLiteral(" id=\"MasterConfig\""); 606607 WriteLiteral(">\r\n"); 608609610 #line 237 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 611612613 #line default 614 #line hidden 615 WriteLiteral("\r\n"); 616617 WriteLiteral("\r\n"); 618619 WriteLiteral("\r\n"); 620621 WriteLiteral("\r\n"); 622623 WriteLiteral("\r\n"); 624625 WriteLiteral("\r\n"); 626627 WriteLiteral("\r\n"); 628629630 #line 310 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 631632633 #line default 634 #line hidden 635 WriteLiteral("\r\n"); 636637 WriteLiteral("\r\n"); 638639 WriteLiteral("\r\n"); 640641 WriteLiteral("\r\n"); 642643 WriteLiteral("\r\n\t</section>\r\n\r\n"); 644645646 #line 334 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 647648649 #line default 650 #line hidden 651652 #line 334 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 653 if (isVisualEditor) 654 { 655656657 #line default 658 #line hidden 659 WriteLiteral("\t\t<link"); 660661 WriteAttribute("href", Tuple.Create(" href=\"", 12523), Tuple.Create("\"", 12537) 662663 #line 336 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 664 , Tuple.Create(Tuple.Create("", 12530), Tuple.Create<System.Object, System.Int32>(appcss 665666 #line default 667 #line hidden 668 , 12530), false) 669 ); 670671 WriteLiteral(" rel=\"stylesheet\""); 672673 WriteLiteral(" />\r\n"); 674675676 #line 337 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 677678679680 #line default 681 #line hidden 682 WriteLiteral("\t\t<header"); 683684 WriteLiteral(" style=\"padding: 25px;\""); 685686 WriteLiteral(">\r\n\t\t\t<h1>Theme</h1>\r\n\t\t\t<h2"); 687688 WriteLiteral(" style=\"font-weight: normal;\""); 689690 WriteLiteral(">"); 691692693 #line 340 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 694 Write(Model.Title); 695696697 #line default 698 #line hidden 699 WriteLiteral("</h2>\r\n\t\t</header>\r\n"); 700701702 #line 342 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 703 } 704705706 #line default 707 #line hidden 708 WriteLiteral("\r\n"); 709710 WriteLiteral("\t"); 711712713 #line 344 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 714 Write(Model.Grid("Breakpoint", "Breakpoint", "default:true;sort:1", "Configuration/Theme")); 715716717 #line default 718 #line hidden 719 WriteLiteral("\r\n\r\n"); 720721722 #line 346 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 723724725 #line default 726 #line hidden 727728 #line 346 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 729 if (isVisualEditor) 730 { 731 if (font_configuration != null) 732 { 733 foreach (var item in font_configuration.Item.ToCodeFirstItem<Bluedesk.DynamicWeb.ItemTypes.Pages.ConfigurationPagesParent>().GetChildConfigs<FontConfiguration>()) 734 { 735736737 #line default 738 #line hidden 739 WriteLiteral("\t\t\t\t<link"); 740741 WriteAttribute("href", Tuple.Create(" href=\"", 13029), Tuple.Create("\"", 13053) 742743 #line 352 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 744 , Tuple.Create(Tuple.Create("", 13036), Tuple.Create<System.Object, System.Int32>(item["FontLink"] 745746 #line default 747 #line hidden 748 , 13036), false) 749 ); 750751 WriteLiteral(" rel=\"stylesheet\""); 752753 WriteLiteral(">\r\n"); 754755756 #line 353 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 757 } 758 } 759760761762 #line default 763 #line hidden 764 WriteLiteral("\t\t<link"); 765766 WriteLiteral(" rel=\"stylesheet\""); 767768 WriteLiteral(" href=\"https://pro.fontawesome.com/releases/v5.15.4/css/all.css\""); 769770 WriteLiteral(" integrity=\"sha384-rqn26AG5Pj86AF4SO72RK5fyefcQ/x32DNQfChxWvbXIyXFePlEktwD18fEz+k" + 771 "QU\""); 772773 WriteLiteral(" crossorigin=\"anonymous\""); 774775 WriteLiteral(">\r\n"); 776777778 #line 357 "D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\_parsed\ThemeMaster.parsed.cshtml" 779 } 780781782 #line default 783 #line hidden 784 WriteLiteral("</body>\r\n</html>\r\n"); 785786 } 787 } 788 } 789

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 @using Dynamicweb; 3 @using Bluedesk.Tools.Generic; 4 @using System.Globalization; 5 @using Dynamicweb.Content.Items; 6 @using Bluedesk.DynamicWeb.ItemTypes; 7 @using Bluedesk.DynamicWeb.ItemTypes.Settings; 8 @using Dynamicweb.Frontend 9 @using Dynamicweb.Frontend.Navigation 10 @using Dynamicweb.Ecommerce.ProductCatalog 11 @using Dynamicweb.Environment 12 13 @Title("Configuration page template") 14 15 @{ 16 var websitesettings = Dynamicweb.Services.Items.GetItemById<WebsiteSettings>(Model.Area.Item.Id); 17 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration"); 18 19 var designRoot = "/Files/Templates/Designs/" + Pageview.Area.Layout.Design.Name; 20 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css"); 21 22 bool isThemeMaster = true; 23 24 bool isVisualEditor = Dynamicweb.Context.Current.Request.GetBoolean("visualedit"); 25 } 26 27 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 28 29 @using System; 30 @using System.Web; 31 @using System.Linq; 32 @using System.Globalization; 33 34 @using Dynamicweb; 35 @using Dynamicweb.Content.Items; 36 @using Dynamicweb.Environment; 37 @using Dynamicweb.Frontend; 38 @using Dynamicweb.Frontend.Navigation; 39 40 @using Bluedesk.Tools.Generic; 41 42 @using Bluedesk.DynamicWeb.ItemTypes; 43 @using Bluedesk.DynamicWeb.ItemTypes.Settings; 44 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 45 46 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 47 48 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 49 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 50 51 @{ 52 53 var master_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 54 MasterConfig mc = master_configuration.Item.ToCodeFirstItem<MasterConfig>(); 55 56 bool HideStandardFooter = mc.FooterConfiguration.HideStandardFooter.ToString() == "True" ? true : false; 57 58 string MasterConfigCssClass = !string.IsNullOrWhiteSpace(mc.CssClass) ? mc.CssClass : ""; 59 60 // GeneralConfig GeneralConfiguration = mc.GeneralConfiguration; 61 EcomConfig EcommerceConfiguration = mc.EcomConfiguration; 62 63 bool WithVATBool = Pageview.Area.EcomPricesWithVat == "True"; 64 bool pricesWithoutVatForUsers = EcommerceConfiguration.ShowPricesWithoutVatForUsers; 65 bool pricesWithoutVatForValidVat = EcommerceConfiguration.ShowPricesWithoutVatWhenValidVatNumber; 66 if(pricesWithoutVatForUsers && !pricesWithoutVatForValidVat && Pageview.User != null) { 67 WithVATBool = false; 68 } 69 if(pricesWithoutVatForValidVat && Pageview.User != null && !string.IsNullOrWhiteSpace(Pageview.User.VatRegNumber)) { 70 WithVATBool = false; 71 } 72 string ecomShowPricesWithVat = WithVATBool.ToString().ToLower(); 73 string ecomPricesFormatted = (EcommerceConfiguration.FormattedPrices).ToString().ToLower(); 74 75 bool IsNotContentManager = false; 76 bool isVisualEditor = Pageview.IsVisualEditorMode; 77 78 if (isVisualEditor) 79 { 80 System.Web.HttpContext.Current.Session["PreviousPage"] = Pageview.Page.ID; 81 IsNotContentManager = (Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser()?.Groups?.All(g => g.Name != "Content managers") ?? true); 82 } 83 84 BaseSettingsObj BaseSettings = new BaseSettingsObj(); 85 86 BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview); 87 HttpContext.Current.Session["BaseSettings"] = BaseSettings; 88 89 //if (HttpContext.Current.Session["BaseSettings"] == null) 90 //{ 91 92 //} 93 //else 94 //{ 95 // BaseSettings = (BaseSettingsObj)HttpContext.Current.Session["BaseSettings"]; 96 // if (BaseSettings.AreaID != Pageview.AreaID) 97 // { 98 // BaseSettings = BaseSettingServices.RenderBaseSettings(Pageview); 99 // HttpContext.Current.Session["BaseSettings"] = BaseSettings; 100 // } 101 //} 102103 BaseSettingsBrandConfiguration BaseSettingsBrandConfiguration = BaseSettings.BrandConfiguration; 104 BaseSettingsButtons BaseSettingsButtons = BaseSettingsBrandConfiguration.Buttons; 105106 var font_configuration = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "FontConfiguration"); 107108 var httpdomain = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 109 var lang = Pageview.Area.CultureInfo.TwoLetterISOLanguageName; 110 var langName = Pageview.Area.Culture; 111112 var csrftoken = application._webapi.Helper.CSRFHelper.TokenHeaderValue(); 113 var designRoot = BaseSettings.DesignRoot; 114115 var phonenumber = BaseSettings.CorporateSettings.Phonenumber; 116 var formattedPhonenumber = phonenumber.Replace(" ", String.Empty); 117 var emailadress = BaseSettings.CorporateSettings.Emailadress; 118 var buttonIconClass = Pageview.Area.Item["Global_button_icon"] != null ? Pageview.Area.Item["Global_button_icon"].ToString().Replace("+", " ") : "fal fa-arrow-right"; 119 var callmebackformlink = BaseSettings.BrandConfiguration.CallMeBackForm; 120 var mobileThemeColor = BaseSettings.BrandConfiguration.MobileThemeColor; 121122 bool isOffline = false; 123124 DateTime workingHoursStart = BaseSettings.CorporateSettings.OpeningTime; 125 DateTime workingHoursEnd = BaseSettings.CorporateSettings.ClosingTime; 126 DateTime today = DateTime.Now; 127 var cHour = DateTime.Now.TimeOfDay; 128 int cDay = (int)DateTime.Now.DayOfWeek; 129 string availableToHour24hFormat = workingHoursEnd.TimeOfDay.ToString().Substring(0, 5); 130 var timeFromInput = DateTime.ParseExact(availableToHour24hFormat, "H:m", null, DateTimeStyles.None); 131 string availableToHour12hFormat = timeFromInput.ToString("hh:mm tt", CultureInfo.InvariantCulture); 132 var availableToHour = lang == "en" ? availableToHour12hFormat : availableToHour24hFormat; 133 bool isOvertime = cHour >= workingHoursEnd.TimeOfDay || cHour <= workingHoursStart.TimeOfDay; 134 bool isNoValidDate = today < workingHoursStart || today > workingHoursEnd; 135 if (isNoValidDate || isOvertime) 136 { 137 isOffline = true; 138 } 139140 Boolean showBreadcrumbs = Pageview.Page.PropertyItem != null && Pageview.Page.PropertyItem["ShowBreadcrumbs"] != null ? Convert.ToBoolean(Pageview.Page.PropertyItem["ShowBreadcrumbs"]) : false; 141142 var appcss = Cache.VersionedFile(designRoot + "/dist/app.css"); 143144 var favicon32 = Cache.VersionedFile(designRoot + "/assets/img/favicon-32.png", true); 145 var favicon16 = Cache.VersionedFile(designRoot + "/assets/img/favicon-16.png", true); 146 var favicon = Cache.VersionedFile(designRoot + "/assets/img/favicon.ico", true); 147148 favicon = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon) ? BaseSettings.BrandConfiguration.Favicons.Favicon : favicon; 149 favicon16 = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon16) ? BaseSettings.BrandConfiguration.Favicons.Favicon16 : favicon16; 150 favicon32 = !string.IsNullOrWhiteSpace(BaseSettings.BrandConfiguration.Favicons.Favicon32) ? BaseSettings.BrandConfiguration.Favicons.Favicon32 : favicon32; 151152 var appbundlejs = Cache.VersionedFile(designRoot + "/dist/app.bundle.js"); 153 var appAsyncbundlejs = Cache.VersionedFile(designRoot + "/dist/appAsync.bundle.js"); 154 var vuebundlejs = Cache.VersionedFile(designRoot + "/dist/vue.bundle.js"); 155156 //*** Start Scanapp configuration ***\\ 157 bool hideHeader = false; 158 bool hideFooter = false; 159 bool hideBottombar = false; 160161 if (HttpContext.Current.Session["ScanApp"] != null) 162 { 163 hideHeader = mc.ScanAppConfig.ShowHeader; 164 hideFooter = mc.ScanAppConfig.ShowFooter; 165 hideBottombar = mc.ScanAppConfig.ShowBottombar; 166 } 167 // END Scanapp configration **\\ 168169 } 170171172 <!DOCTYPE html> 173 <html prefix="og: http://ogp.me/ns#"> 174 <head> 175 @*@inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 176 @using System; 177 @using System.Web; 178 @using System.Linq; 179 @using System.Globalization; 180181 @using Dynamicweb; 182 @using Dynamicweb.Content.Items; 183 @using Dynamicweb.Environment; 184 @using Dynamicweb.Frontend; 185 @using Dynamicweb.Frontend.Navigation; 186187 @using Bluedesk.Tools.Generic; 188189 @using Bluedesk.DynamicWeb.ItemTypes; 190 @using Bluedesk.DynamicWeb.ItemTypes.Settings; 191192 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 193 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 194 @using Bluedesk.DynamicWeb.ItemTypes.Extensions; 195 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 196 *@ 197198 </head> 199200 <body> 201202 <script type="text/javascript"> 203204 var stylesDump; 205206 function onTryItClick(variable) { 207208 var StyleID = variable + 'Style'; 209 var contentID = variable + 'Content'; 210 var frameID = variable + 'Frame'; 211 var MasterConfigID = 'MasterConfig'; 212213 var style = document.getElementById(StyleID).innerHTML; 214 var MasterConfig = document.getElementById(MasterConfigID).innerHTML; 215 var content = document.getElementById(contentID).innerHTML; 216 var iframe = document.getElementById(frameID); 217218 stylesDump = stylesDump + style; 219220 var frameDoc = iframe.document; 221 if (iframe.contentWindow) 222 frameDoc = iframe.contentWindow.document; 223224 frameDoc.open(); 225 frameDoc.writeln(content); 226 frameDoc.writeln(MasterConfig); 227 frameDoc.writeln(stylesDump); 228 frameDoc.close(); 229230 document.getElementById(contentID).remove(); 231232 } 233234 </script> 235236 <section id="MasterConfig"> 237 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 238 @using System; 239 @using System.Web; 240 @using System.Linq; 241 @using System.Globalization; 242243 @using Dynamicweb; 244 @using Dynamicweb.Content.Items; 245 @using Dynamicweb.Environment; 246 @using Dynamicweb.Frontend; 247 @using Dynamicweb.Frontend.Navigation; 248249 @using Bluedesk.Tools.Generic; 250251 @using Bluedesk.DynamicWeb.ItemTypes; 252 @using Bluedesk.DynamicWeb.ItemTypes.Settings; 253 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 254255 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 256 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 257 @using Bluedesk.DynamicWeb.ItemTypes.Extensions; 258259 @helper RenderCSSKeyAndValue(string Key, string Value) 260 { 261 if (!string.IsNullOrWhiteSpace(Value)) 262 { 263 <text>@Key : @Value !important;</text> 264 } 265 } 266267 @helper SetFontCSSVariables(FontConfigurationItemTab FontConfiguration) 268 { 269270 string Top = FontConfiguration.top != 0 ? FontConfiguration.top.ToString() + "px" : ""; 271 string Left = FontConfiguration.left != 0 ? FontConfiguration.left.ToString() + "px" : ""; 272 string Right = FontConfiguration.right != 0 ? FontConfiguration.right.ToString() + "px" : ""; 273 string Bottom = FontConfiguration.bottom != 0 ? FontConfiguration.bottom.ToString() + "px" : ""; 274275 string Position = FontConfiguration.PositionAbsolute ? "absolute" : "relative"; 276277 string Color = FontConfiguration.Color?.GetColorCode(Pageview.AreaID) ?? ""; 278 string BackgroundColor = FontConfiguration.Backgroundcolor?.GetColorCode(Pageview.AreaID) ?? ""; 279280 string BorderColor = FontConfiguration.BorderColor?.GetColorCode(Pageview.AreaID) ?? ""; 281 string BorderSize = FontConfiguration.BorderSize != 0 ? FontConfiguration.BorderSize.ToString() + "px" : ""; 282283 <text> 284285 --Position: @Position; 286287 @RenderCSSKeyAndValue("--Padding", FontConfiguration.Padding) 288289 @RenderCSSKeyAndValue("--Top", Top) 290 @RenderCSSKeyAndValue("--Left", Left) 291 @RenderCSSKeyAndValue("--Right", Right) 292 @RenderCSSKeyAndValue("--Bottom", Bottom) 293294 @RenderCSSKeyAndValue("--Color", Color) 295 @RenderCSSKeyAndValue("--FontSize", FontConfiguration.FontSize) 296 @RenderCSSKeyAndValue("--FontStyle", FontConfiguration.FontStyle) 297298 @RenderCSSKeyAndValue("--FontWeight", FontConfiguration.FontWeight) 299 @RenderCSSKeyAndValue("--FontFamily", FontConfiguration.FontConfiguration.FontFamily) 300 @RenderCSSKeyAndValue("--LineHeight", FontConfiguration.LineHeight) 301302 @RenderCSSKeyAndValue("--BackgroundColor", BackgroundColor) 303 @RenderCSSKeyAndValue("--BorderColor", BorderColor) 304 @RenderCSSKeyAndValue("--BorderSize", BorderSize) 305306 </text> 307308 } 309310 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 311 @using System; 312 @using System.Web; 313 @using System.Linq; 314 @using System.Globalization; 315316 @using Dynamicweb; 317 @using Dynamicweb.Content.Items; 318 @using Dynamicweb.Environment; 319 @using Dynamicweb.Frontend; 320 @using Dynamicweb.Frontend.Navigation; 321322 @using Bluedesk.Tools.Generic; 323324 @using Bluedesk.DynamicWeb.ItemTypes; 325 @using Bluedesk.DynamicWeb.ItemTypes.Settings; 326327 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 328 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 329 @using Bluedesk.DynamicWeb.ItemTypes.Extensions; 330 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 331332 </section> 333334 @if (isVisualEditor) 335 { 336 <link href="@appcss" rel="stylesheet" /> 337338 <header style="padding: 25px;"> 339 <h1>Theme</h1> 340 <h2 style="font-weight: normal;">@Model.Title</h2> 341 </header> 342 } 343344 @Model.Grid("Breakpoint", "Breakpoint", "default:true;sort:1", "Configuration/Theme") 345346 @if (isVisualEditor) 347 { 348 if (font_configuration != null) 349 { 350 foreach (var item in font_configuration.Item.ToCodeFirstItem<Bluedesk.DynamicWeb.ItemTypes.Pages.ConfigurationPagesParent>().GetChildConfigs<FontConfiguration>()) 351 { 352 <link href="@item["FontLink"]" rel="stylesheet"> 353 } 354 } 355356 <link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.15.4/css/all.css" integrity="sha384-rqn26AG5Pj86AF4SO72RK5fyefcQ/x32DNQfChxWvbXIyXFePlEktwD18fEz+kQU" crossorigin="anonymous"> 357 } 358 </body> 359 </html> 360