Ledningsfrie støvsugere

Error executing template "Designs/Roidmi/Paragraph/2ColParagraph.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_5165b706ad2a43d2b93bbbaa527d3f9f.Execute() in D:\DW9\Solutions\witt.dk\Files\Templates\Designs\Roidmi\Paragraph\2ColParagraph.cshtml:line 16
   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.Linq; 3 @using Dynamicweb.Frontend; 4 @{ 5 var heading = Model.Item.GetString("Heading"); 6 var text = Model.Item.GetString("Text"); 7 var button = Model.Item.GetItem("Button"); 8 var imagePath = Model.Item.GetFile("Image")?.Path ?? string.Empty; 9 var style = Model.Item.GetString("Style"); 10 var styleAttribute = string.Empty; 11 if (!string.IsNullOrWhiteSpace(style)) { 12 styleAttribute = $" style=\"{style}\""; 13 } 14 15 var imagePosition = Model.Item.GetString("Layout"); 16 var cssImageLeft = imagePosition.ToLower() == "left" ? "flex-order-1" : "flex-order-2"; 17 var cssTextRight = imagePosition.ToLower() == "left" ? "flex-order-2" : "flex-order-1"; ; 18 19 } 20 <section> 21 <div class="two-col-cta" id="@Model.ID"> 22 <div class="two-col-cta__large @cssImageLeft" style="background-image: url('@imagePath');"></div> 23 <div class="two-col-cta__small @cssTextRight"> 24 <div class="two-col-cta__text-container" @styleAttribute> 25 <div class="header"> 26 <h1 class="h1 toUpperCase light">@heading</h1> 27 </div> 28 <div class="content">@text</div> 29 @RenderFooter(button) 30 </div> 31 </div> 32 </div> 33 </section> 34 35 36 @helper RenderFooter(ItemViewModel button) 37 { 38 if (!string.IsNullOrWhiteSpace(button.GetString("ButtonText")) && !string.IsNullOrWhiteSpace(button.GetString("link"))) 39 { 40 var target = "target=\"_blank\""; 41 if (!button.GetBoolean("OpenInNewWindow")) 42 { 43 target = string.Empty; 44 } 45 <div class="footer"> 46 <a href="@button.GetString("link")" class="btn btn--primary btn--large ">@button.GetString("ButtonText")</a> 47 </div> 48 } 49 }
Your basket
Your cart is empty
Login
Other languages