Branding Stylesheet

Font configuration

Error compiling template "Designs/ColoursAndCoating_generated/Paragraph/FontConfiguration.cshtml"
Line 33: No overload for method 'Write' takes 0 arguments

1 // <auto-generated/> 2 #pragma warning disable 1591 3 namespace CompiledRazorTemplates.Dynamic 4 { 5 #line hidden 6 using System.Threading.Tasks; 7 using System; 8 using System.Collections.Generic; 9 using System.Linq; 10 using System.IO; 11 using Dynamicweb; 12 using Bluedesk.Tools.Generic; 13 using Dynamicweb.Content; 14 using Dynamicweb.Content.Items; 15 using Dynamicweb.Security.Permissions; 16 using Bluedesk.DynamicWeb.ItemTypes; 17 using Bluedesk.DynamicWeb.ItemTypes.Configuration; 18 using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 19 using Dynamicweb.Frontend; 20 using Dynamicweb.Frontend.Navigation; 21 using Dynamicweb.Ecommerce.ProductCatalog; 22 using Dynamicweb.Environment; 23 using Dynamicweb.Rendering; 24 using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 25 internal class RazorEngine_2177d8a31877499a98702a347374b1eb : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 26 { 27 #pragma warning disable 1998 28 public async override global::System.Threading.Tasks.Task ExecuteAsync() 29 { 30 WriteLiteral("\r\n"); 31 WriteLiteral("\r\n\r\n"); 32 WriteLiteral("*"); 33 Write(); 34 WriteLiteral("\r\n\r\n"); 35 36 37 var paragraphID = Model.ItemId; 38 FontConfiguration _data = ItemManager.Storage.GetById<FontConfiguration>(paragraphID ?? "0"); 39 var colorService = new ColorSwatchService(); 40 41 var master_configuration = Dynamicweb.Content.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 42 MasterConfig mc = master_configuration.Item.ToCodeFirstItemCached<MasterConfig>(); 43 44 var corporate_settings = Dynamicweb.Content.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "CorporateSettingsPage"); 45 CorporateSettingsPage cs = corporate_settings.Item.ToCodeFirstItemCached<CorporateSettingsPage>(); 46 47 WriteLiteral("\r\n<section>\r\n\t<div"); 48 BeginWriteAttribute("class", " class=\"", 6005, "\"", 6013, 0); 49 EndWriteAttribute(); 50 WriteLiteral(" style=\"margin: 25px; padding: 25px; background-color: white; box-shadow: rgb(153 153 255 / 10%) 10px 10px 10px;\">\r\n\t\t<h1"); 51 BeginWriteAttribute("style", " style=\"", 6135, "\"", 6172, 2); 52 WriteAttributeValue("", 6143, "font-family:", 6143, 12, true); 53 WriteAttributeValue("", 6155, _data.FontFamily, 6155, 17, false); 54 EndWriteAttribute(); 55 WriteLiteral(">The quick brown fox jumps over the lazy dog.</h1>\r\n\t\t<label>"); 56 Write(_data.FontName); 57 WriteLiteral("</label>\r\n\t</div>\r\n</section>\r\n\r\n<style>\r\n</style>\r\n\r\n"); 58 } 59 #pragma warning restore 1998 60 } 61 } 62 #pragma warning restore 1591 63

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO; 3 @using Dynamicweb; 4 @using Bluedesk.Tools.Generic; 5 @using Dynamicweb.Content; 6 @using Dynamicweb.Content.Items; 7 @using Dynamicweb.Security.Permissions; 8 @using Bluedesk.DynamicWeb.ItemTypes; 9 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 10 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 11 @using Dynamicweb.Frontend; 12 @using Dynamicweb.Frontend.Navigation 13 @using Dynamicweb.Ecommerce.ProductCatalog 14 @using Dynamicweb.Environment 15 @using Dynamicweb.Rendering; 16 17 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 18 19 20 @*@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 21 @using Bluedesk.DynamicWeb.ItemTypes 22 @using Bluedesk.DynamicWeb.ItemTypes.Configuration 23 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration 24 @using Bluedesk.DynamicWeb.ItemTypes.DefaultParagraphs 25 26 27 @functions { 28 29 Dictionary<string, string> GetFontConfiguration(string TextColor, FontConfigurationItemTab FontConfiguration) 30 { 31 var colorService = new ColorSwatchService(); 32 TextColor = !string.IsNullOrWhiteSpace(TextColor) ? TextColor : ""; 33 TextColor = !TextColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, TextColor) : TextColor; 34 Dictionary<string, string> FontConfig = new Dictionary<string, string>() { 35 { "textColor" , TextColor }, 36 { "fontSize" , FontConfiguration.FontSize }, 37 { "lineHeight", FontConfiguration.LineHeight}, 38 { "fontFamily" , FontConfiguration.FontConfiguration.FontFamily }, 39 { "fontWeight" , FontConfiguration.FontWeight }, 40 { "fontStyle" , FontConfiguration.FontStyle } 41 }; 42 return FontConfig; 43 } 44 45 public string GenerateButtonConfigVariables(ButtonConfiguration BC, MasterConfig mc, int areaId) 46 { 47 string ButtonLabelAlignment = BC.ButtonLabelAlignment; 48 switch (ButtonLabelAlignment) 49 { 50 case "align-left": 51 ButtonLabelAlignment = "flex-start"; 52 break; 53 case "align-center": 54 ButtonLabelAlignment = "center"; 55 break; 56 case "align-right": 57 ButtonLabelAlignment = "flex-end"; 58 break; 59 case "align-full": 60 ButtonLabelAlignment = "space-between"; 61 break; 62 default: 63 ButtonLabelAlignment = "flex-start"; 64 break; 65 } 66 67 var btnStyleBlock = new System.Text.StringBuilder(); 68 69 // General Config 70 btnStyleBlock.Append(GenerateCssVar("btn-min-height", $"{mc.GeneralConfiguration.ButtonHeight}px")); 71 btnStyleBlock.Append(GenerateCssVar("btn-border-radius", $"{mc.GeneralConfiguration.RoundedCornerValue}px")); 72 73 // Button Config 74 btnStyleBlock.Append(GenerateCssVar("btn-border-width", $"{BC.BorderSize.ToString()}px")); 75 btnStyleBlock.Append(GenerateCssVar("btn-label-alignment", ButtonLabelAlignment)); 76 77 // Button Config Tab 78 /* 79 btnStyleBlock.Append(GenerateCssVar("btn-bg-color", BC.ButtonColorConfiguration.BackgroundColor.GetColorCode(areaId))); 80 btnStyleBlock.Append(GenerateCssVar("btn-font-color", BC.ButtonColorConfiguration.FontColor.GetColorCode(areaId))); 81 btnStyleBlock.Append(GenerateCssVar("btn-border-color", BC.ButtonColorConfiguration.BorderColor.GetColorCode(areaId))); 82 */ 83 84 // Button Config Hover tab 85 /* 86 btnStyleBlock.Append(GenerateCssVar("btn-bg-color-hover", BC.ButtonHoverColorConfiguration.BackgroundColor.GetColorCode(areaId))); 87 btnStyleBlock.Append(GenerateCssVar("btn-font-color-hover", BC.ButtonHoverColorConfiguration.FontColor.GetColorCode(areaId))); 88 btnStyleBlock.Append(GenerateCssVar("btn-border-color-hover", BC.ButtonHoverColorConfiguration.BorderColor.GetColorCode(areaId))); 89 */ 90 91 // Button Config Font Config 92 btnStyleBlock.Append(GenerateCssVar("btn-font-size", BC.FontConfiguration.FontSize)); 93 // btnStyleBlock.Append(GenerateCssVar("btn-font-config-color", BC.FontConfiguration.Color.GetColorCode(areaId))); 94 btnStyleBlock.Append(GenerateCssVar("btn-font-line-height", BC.FontConfiguration.LineHeight)); 95 btnStyleBlock.Append(GenerateCssVar("btn-font-family", BC.FontConfiguration.FontConfiguration.FontFamily)); 96 btnStyleBlock.Append(GenerateCssVar("btn-font-weight", BC.FontConfiguration.FontWeight)); 97 btnStyleBlock.Append(GenerateCssVar("btn-font-transform", BC.FontConfiguration.FontStyle)); 98 99 return btnStyleBlock.ToString(); 100 } 101 102 public string GenerateCssVar(string name, string value) 103 { 104 if (!string.IsNullOrWhiteSpace(value)) 105 { 106 return $"--{name}: {value};"; 107 } 108 else 109 { 110 return ""; 111 } 112 } 113 } 114 115 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 116 @using Bluedesk.DynamicWeb.ItemTypes 117 @using Dynamicweb.Frontend 118 @using Dynamicweb.Content.Items 119 120 @functions{ 121 public string RenderButton(CTAButton button, PageView Pageview) 122 { 123 string template = ""; 124 125 if (!string.IsNullOrWhiteSpace(button.GetLink(Pageview))) 126 { 127 template = button.GetButtonTemplate().Replace("{{ ButtonLink }}", button.GetLink(Pageview)); 128 } 129 130 return template; 131 } 132 } 133 134 135 @* @helper RenderButton(CTAButton button, PageView Pageview) 136 { 137 if (!string.IsNullOrWhiteSpace(button.GetLink(Pageview))) 138 { 139 string Template = button.GetButtonTemplate().Replace("{{ ButtonLink }}", button.GetLink(Pageview)); 140 @Template; 141 } 142 } *@ 143 *@ 144 145 @{ 146 147 var paragraphID = Model.ItemId; 148 FontConfiguration _data = ItemManager.Storage.GetById<FontConfiguration>(paragraphID ?? "0"); 149 var colorService = new ColorSwatchService(); 150 151 var master_configuration = Dynamicweb.Content.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 152 MasterConfig mc = master_configuration.Item.ToCodeFirstItemCached<MasterConfig>(); 153 154 var corporate_settings = Dynamicweb.Content.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "CorporateSettingsPage"); 155 CorporateSettingsPage cs = corporate_settings.Item.ToCodeFirstItemCached<CorporateSettingsPage>(); 156 157 } 158 159 <section> 160 <div class="" style="margin: 25px; padding: 25px; background-color: white; box-shadow: rgb(153 153 255 / 10%) 10px 10px 10px;"> 161 <h1 style="font-family:@_data.FontFamily">The quick brown fox jumps over the lazy dog.</h1> 162 <label>@_data.FontName</label> 163 </div> 164 </section> 165 166 <style> 167 </style> 168 169
Error compiling template "Designs/ColoursAndCoating_generated/Paragraph/FontConfiguration.cshtml"
Line 33: No overload for method 'Write' takes 0 arguments

1 // <auto-generated/> 2 #pragma warning disable 1591 3 namespace CompiledRazorTemplates.Dynamic 4 { 5 #line hidden 6 using System.Threading.Tasks; 7 using System; 8 using System.Collections.Generic; 9 using System.Linq; 10 using System.IO; 11 using Dynamicweb; 12 using Bluedesk.Tools.Generic; 13 using Dynamicweb.Content; 14 using Dynamicweb.Content.Items; 15 using Dynamicweb.Security.Permissions; 16 using Bluedesk.DynamicWeb.ItemTypes; 17 using Bluedesk.DynamicWeb.ItemTypes.Configuration; 18 using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 19 using Dynamicweb.Frontend; 20 using Dynamicweb.Frontend.Navigation; 21 using Dynamicweb.Ecommerce.ProductCatalog; 22 using Dynamicweb.Environment; 23 using Dynamicweb.Rendering; 24 using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 25 internal class RazorEngine_6c06ec9298324c678ab1313e729afed5 : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 26 { 27 #pragma warning disable 1998 28 public async override global::System.Threading.Tasks.Task ExecuteAsync() 29 { 30 WriteLiteral("\r\n"); 31 WriteLiteral("\r\n\r\n"); 32 WriteLiteral("*"); 33 Write(); 34 WriteLiteral("\r\n\r\n"); 35 36 37 var paragraphID = Model.ItemId; 38 FontConfiguration _data = ItemManager.Storage.GetById<FontConfiguration>(paragraphID ?? "0"); 39 var colorService = new ColorSwatchService(); 40 41 var master_configuration = Dynamicweb.Content.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 42 MasterConfig mc = master_configuration.Item.ToCodeFirstItemCached<MasterConfig>(); 43 44 var corporate_settings = Dynamicweb.Content.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "CorporateSettingsPage"); 45 CorporateSettingsPage cs = corporate_settings.Item.ToCodeFirstItemCached<CorporateSettingsPage>(); 46 47 WriteLiteral("\r\n<section>\r\n\t<div"); 48 BeginWriteAttribute("class", " class=\"", 6005, "\"", 6013, 0); 49 EndWriteAttribute(); 50 WriteLiteral(" style=\"margin: 25px; padding: 25px; background-color: white; box-shadow: rgb(153 153 255 / 10%) 10px 10px 10px;\">\r\n\t\t<h1"); 51 BeginWriteAttribute("style", " style=\"", 6135, "\"", 6172, 2); 52 WriteAttributeValue("", 6143, "font-family:", 6143, 12, true); 53 WriteAttributeValue("", 6155, _data.FontFamily, 6155, 17, false); 54 EndWriteAttribute(); 55 WriteLiteral(">The quick brown fox jumps over the lazy dog.</h1>\r\n\t\t<label>"); 56 Write(_data.FontName); 57 WriteLiteral("</label>\r\n\t</div>\r\n</section>\r\n\r\n<style>\r\n</style>\r\n\r\n"); 58 } 59 #pragma warning restore 1998 60 } 61 } 62 #pragma warning restore 1591 63

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using System.IO; 3 @using Dynamicweb; 4 @using Bluedesk.Tools.Generic; 5 @using Dynamicweb.Content; 6 @using Dynamicweb.Content.Items; 7 @using Dynamicweb.Security.Permissions; 8 @using Bluedesk.DynamicWeb.ItemTypes; 9 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 10 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 11 @using Dynamicweb.Frontend; 12 @using Dynamicweb.Frontend.Navigation 13 @using Dynamicweb.Ecommerce.ProductCatalog 14 @using Dynamicweb.Environment 15 @using Dynamicweb.Rendering; 16 17 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 18 19 20 @*@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 21 @using Bluedesk.DynamicWeb.ItemTypes 22 @using Bluedesk.DynamicWeb.ItemTypes.Configuration 23 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration 24 @using Bluedesk.DynamicWeb.ItemTypes.DefaultParagraphs 25 26 27 @functions { 28 29 Dictionary<string, string> GetFontConfiguration(string TextColor, FontConfigurationItemTab FontConfiguration) 30 { 31 var colorService = new ColorSwatchService(); 32 TextColor = !string.IsNullOrWhiteSpace(TextColor) ? TextColor : ""; 33 TextColor = !TextColor.Contains("#") ? colorService.GetHexColor(Pageview.AreaID, TextColor) : TextColor; 34 Dictionary<string, string> FontConfig = new Dictionary<string, string>() { 35 { "textColor" , TextColor }, 36 { "fontSize" , FontConfiguration.FontSize }, 37 { "lineHeight", FontConfiguration.LineHeight}, 38 { "fontFamily" , FontConfiguration.FontConfiguration.FontFamily }, 39 { "fontWeight" , FontConfiguration.FontWeight }, 40 { "fontStyle" , FontConfiguration.FontStyle } 41 }; 42 return FontConfig; 43 } 44 45 public string GenerateButtonConfigVariables(ButtonConfiguration BC, MasterConfig mc, int areaId) 46 { 47 string ButtonLabelAlignment = BC.ButtonLabelAlignment; 48 switch (ButtonLabelAlignment) 49 { 50 case "align-left": 51 ButtonLabelAlignment = "flex-start"; 52 break; 53 case "align-center": 54 ButtonLabelAlignment = "center"; 55 break; 56 case "align-right": 57 ButtonLabelAlignment = "flex-end"; 58 break; 59 case "align-full": 60 ButtonLabelAlignment = "space-between"; 61 break; 62 default: 63 ButtonLabelAlignment = "flex-start"; 64 break; 65 } 66 67 var btnStyleBlock = new System.Text.StringBuilder(); 68 69 // General Config 70 btnStyleBlock.Append(GenerateCssVar("btn-min-height", $"{mc.GeneralConfiguration.ButtonHeight}px")); 71 btnStyleBlock.Append(GenerateCssVar("btn-border-radius", $"{mc.GeneralConfiguration.RoundedCornerValue}px")); 72 73 // Button Config 74 btnStyleBlock.Append(GenerateCssVar("btn-border-width", $"{BC.BorderSize.ToString()}px")); 75 btnStyleBlock.Append(GenerateCssVar("btn-label-alignment", ButtonLabelAlignment)); 76 77 // Button Config Tab 78 /* 79 btnStyleBlock.Append(GenerateCssVar("btn-bg-color", BC.ButtonColorConfiguration.BackgroundColor.GetColorCode(areaId))); 80 btnStyleBlock.Append(GenerateCssVar("btn-font-color", BC.ButtonColorConfiguration.FontColor.GetColorCode(areaId))); 81 btnStyleBlock.Append(GenerateCssVar("btn-border-color", BC.ButtonColorConfiguration.BorderColor.GetColorCode(areaId))); 82 */ 83 84 // Button Config Hover tab 85 /* 86 btnStyleBlock.Append(GenerateCssVar("btn-bg-color-hover", BC.ButtonHoverColorConfiguration.BackgroundColor.GetColorCode(areaId))); 87 btnStyleBlock.Append(GenerateCssVar("btn-font-color-hover", BC.ButtonHoverColorConfiguration.FontColor.GetColorCode(areaId))); 88 btnStyleBlock.Append(GenerateCssVar("btn-border-color-hover", BC.ButtonHoverColorConfiguration.BorderColor.GetColorCode(areaId))); 89 */ 90 91 // Button Config Font Config 92 btnStyleBlock.Append(GenerateCssVar("btn-font-size", BC.FontConfiguration.FontSize)); 93 // btnStyleBlock.Append(GenerateCssVar("btn-font-config-color", BC.FontConfiguration.Color.GetColorCode(areaId))); 94 btnStyleBlock.Append(GenerateCssVar("btn-font-line-height", BC.FontConfiguration.LineHeight)); 95 btnStyleBlock.Append(GenerateCssVar("btn-font-family", BC.FontConfiguration.FontConfiguration.FontFamily)); 96 btnStyleBlock.Append(GenerateCssVar("btn-font-weight", BC.FontConfiguration.FontWeight)); 97 btnStyleBlock.Append(GenerateCssVar("btn-font-transform", BC.FontConfiguration.FontStyle)); 98 99 return btnStyleBlock.ToString(); 100 } 101 102 public string GenerateCssVar(string name, string value) 103 { 104 if (!string.IsNullOrWhiteSpace(value)) 105 { 106 return $"--{name}: {value};"; 107 } 108 else 109 { 110 return ""; 111 } 112 } 113 } 114 115 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 116 @using Bluedesk.DynamicWeb.ItemTypes 117 @using Dynamicweb.Frontend 118 @using Dynamicweb.Content.Items 119 120 @functions{ 121 public string RenderButton(CTAButton button, PageView Pageview) 122 { 123 string template = ""; 124 125 if (!string.IsNullOrWhiteSpace(button.GetLink(Pageview))) 126 { 127 template = button.GetButtonTemplate().Replace("{{ ButtonLink }}", button.GetLink(Pageview)); 128 } 129 130 return template; 131 } 132 } 133 134 135 @* @helper RenderButton(CTAButton button, PageView Pageview) 136 { 137 if (!string.IsNullOrWhiteSpace(button.GetLink(Pageview))) 138 { 139 string Template = button.GetButtonTemplate().Replace("{{ ButtonLink }}", button.GetLink(Pageview)); 140 @Template; 141 } 142 } *@ 143 *@ 144 145 @{ 146 147 var paragraphID = Model.ItemId; 148 FontConfiguration _data = ItemManager.Storage.GetById<FontConfiguration>(paragraphID ?? "0"); 149 var colorService = new ColorSwatchService(); 150 151 var master_configuration = Dynamicweb.Content.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "MasterConfiguration"); 152 MasterConfig mc = master_configuration.Item.ToCodeFirstItemCached<MasterConfig>(); 153 154 var corporate_settings = Dynamicweb.Content.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "CorporateSettingsPage"); 155 CorporateSettingsPage cs = corporate_settings.Item.ToCodeFirstItemCached<CorporateSettingsPage>(); 156 157 } 158 159 <section> 160 <div class="" style="margin: 25px; padding: 25px; background-color: white; box-shadow: rgb(153 153 255 / 10%) 10px 10px 10px;"> 161 <h1 style="font-family:@_data.FontFamily">The quick brown fox jumps over the lazy dog.</h1> 162 <label>@_data.FontName</label> 163 </div> 164 </section> 165 166 <style> 167 </style> 168 169