Error executing template "Designs/ClientBase_generated/Paragraph/FooterWidgetLogo.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_2468ad92915b43e7a43404733305f5db.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\FooterWidgetLogo.cshtml:line 35 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 Dynamicweb; 5 6 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 7 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 8 9 10 @{ 11 12 var paragraphID = Model.ItemId; 13 FooterWidgetLogo _data = Dynamicweb.Services.Items.GetItem("FooterWidgetLogo", paragraphID).ToCodeFirstItem<FooterWidgetLogo>(); 14 15 BaseSettingsObj BaseSettings = (BaseSettingsObj)HttpContext.Current.Session["BaseSettings"]; 16 17 string LogoDesktopImage = (!string.IsNullOrWhiteSpace(_data.LogoDesktopImage.ToString())) ? _data.LogoDesktopImage.ToString() : ""; 18 19 /*** Desktop logo Settings ***/ 20 string footer_logo__top = _data.LogoTop.ToString(); 21 footer_logo__top = !string.IsNullOrWhiteSpace(footer_logo__top) ? footer_logo__top + "px" : "auto"; 22 23 string footer_logo__left = _data.LogoLeft.ToString(); 24 footer_logo__left = !string.IsNullOrWhiteSpace(footer_logo__left) ? footer_logo__left + "px" : "auto"; 25 26 string footer_logo__width = _data.LogoWidth.ToString(); 27 footer_logo__width = !string.IsNullOrWhiteSpace(footer_logo__width) && footer_logo__width != "0" ? footer_logo__width + "px" : "auto"; 28 29 string footer_logo__container_width = _data.LogoContainerWidth.ToString(); 30 footer_logo__container_width = !string.IsNullOrWhiteSpace(footer_logo__container_width) && footer_logo__container_width != "0" ? footer_logo__container_width + "px" : "auto"; 31 32 string footer_logo__height = _data.LogoHeight.ToString(); 33 footer_logo__height = !string.IsNullOrWhiteSpace(footer_logo__height) && footer_logo__height != "0" ? footer_logo__height + "px" : "auto"; 34 35 string footer_desktop__logo = _data.LogoDesktopImage.ToString(); 36 37 } 38 39 <figure class="Footer__logo Footer__logo--@paragraphID @_data.CssClass"> 40 <a href="@BaseSettings.System.HomepageLink" aria-label="Logo"> 41 <img src="@footer_desktop__logo" alt="" /> 42 </a> 43 </figure> 44 45 <style> 46 47 .Footer__logo { 48 top: var(--Top); 49 left: var(--Left); 50 } 51 52 .Footer__logo, 53 .Footer__logo img { 54 width: var(--Width); 55 height: var(--Height); 56 } 57 58 .Footer__logo--@paragraphID { 59 --Top: @footer_logo__top; 60 --Left: @footer_logo__left; 61 --Width: @footer_logo__container_width; 62 } 63 64 .Footer__logo--@paragraphID { 65 --Height: 100%; 66 --Width: @footer_logo__width; 67 } 68 69 .Footer__logo--@paragraphID img { 70 --Height: @footer_logo__height; 71 --Width: @footer_logo__width; 72 } 73 74 </style> 75
Error executing template "Designs/ClientBase_generated/Paragraph/FooterWidgetUSPs.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_eff3517c67b64b33b5517e7d90c00ef4.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\FooterWidgetUSPs.cshtml:line 29 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 @using System.IO; 3 @using System.Web; 4 @using Dynamicweb; 5 @using Dynamicweb.Content.Items; 6 @using Bluedesk.DynamicWeb.ItemTypes; 7 @using Bluedesk.DynamicWeb.ItemTypes.Configuration; 8 @using Bluedesk.DynamicWeb.ItemTypes.Settings.Configuration; 9 10 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 11 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 12 13 14 @{ 15 16 string paragraphID = Model.ItemId; 17 FooterWidgetUSPs _data = Dynamicweb.Services.Items.GetItem("FooterWidgetUSPs", paragraphID).ToCodeFirstItem<FooterWidgetUSPs>(); 18 19 var colorService = new ColorSwatchService(); 20 21 BaseSettingsObj BaseSettings = (BaseSettingsObj) HttpContext.Current.Session["BaseSettings"]; 22 23 string USP_text_color = colorService.GetHexColor(Pageview.AreaID, _data.TopUSPTextColor.ToString()); 24 string USP_icon_color = colorService.GetHexColor(Pageview.AreaID, _data.TopUSPIconColor.ToString()); 25 26 } 27 28 <ul class="usp__list"> 29 @RenderHeaderUSP(BaseSettings.USP.USP_1, BaseSettings.USP.USP_1_icon, paragraphID, _data.fontawesomeStyle) 30 @RenderHeaderUSP(BaseSettings.USP.USP_2, BaseSettings.USP.USP_2_icon, paragraphID, _data.fontawesomeStyle) 31 @RenderHeaderUSP(BaseSettings.USP.USP_3, BaseSettings.USP.USP_3_icon, paragraphID, _data.fontawesomeStyle) 32 @RenderHeaderUSP(BaseSettings.USP.USP_4, BaseSettings.USP.USP_4_icon, paragraphID, _data.fontawesomeStyle) 33 @RenderHeaderUSP(BaseSettings.USP.USP_5, BaseSettings.USP.USP_5_icon, paragraphID, _data.fontawesomeStyle) 34 </ul> 35 36 <style> 37 .usp__item--@paragraphID { 38 color: @USP_text_color; 39 } 40 41 .usp__item--@paragraphID svg, 42 .usp__item--@paragraphID i{ 43 color: @USP_icon_color; 44 } 45 </style> 46 47 @helper RenderHeaderUSP(string USP_content, string USP_icon, string paragraphID, string fas) 48 { 49 if (!string.IsNullOrWhiteSpace(USP_content)) 50 { 51 var usp_icon_class = (!string.IsNullOrWhiteSpace(USP_icon)) ? USP_icon : fas + " fa-check"; 52 53 <li class="usp__item usp__item--@paragraphID"> 54 <i class="@usp_icon_class usp__icon"></i> 55 <span>@USP_content</span> 56 </li> 57 } 58 } 59