The list of items is empty or null

Twente Leeft

Benieuwd naar de verhalen van talenten in de andere branches? Wacht niet langer

Lees het hier!

Benieuwd naar de verhalen van talenten in de andere branches? Wacht niet langer

Lees het hier!
Error executing template "Designs/TwenteBranding/Paragraph/TextParagraph.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_df6e05ac453b41d28f75ad49539b96dc.Execute() in D:\inetpub\wwwroot\www.twente.com\Files\Templates\Designs\TwenteBranding\Paragraph\TextParagraph.cshtml:line 41
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 @using Dynamicweb.Core 2 @using TwenteBranding.Models.Items.Paragraphs 3 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 4 @{ 5 var item = Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId).ToCodeFirstItem<TextParagraph>(); 6 var hasSideBar = item.NavigationTag.IsNotNullOrEmpty(); 7 var backgroundColor = item.BackgroundColor; 8 var backgroundStyle = ""; 9 var containerStyle = ""; 10 var hasBackground = false; 11 12 if (item.FullWidth && !string.IsNullOrWhiteSpace(backgroundColor)) 13 { 14 backgroundStyle = $"background-color: {backgroundColor};"; 15 } 16 else if (!string.IsNullOrWhiteSpace(backgroundColor)) 17 { 18 containerStyle = $"background-color: {backgroundColor};"; 19 hasBackground = true; 20 } 21 22 <div id='@Model.ID' class="text-paragraph @(hasSideBar ? "with-sidebar" : "")" style="@backgroundStyle"> 23 <div class='container text-paragraph__container @(hasBackground ? "text-paragraph__container--background" : "" ) @(item.SmallText ? "text-paragraph__container--small" : "")' style="@containerStyle"> 24 <div class='rich-text @item.TextColor'> 25 26 @if (item.Title.IsNotNullOrEmpty()) 27 { 28 <h1 class="@item.TitleColor">@item.Title</h1> 29 } 30 @if (item.Text.IsNotNullOrEmpty()) 31 { 32 @item.Text 33 } 34 </div> 35 36 @if (hasSideBar) 37 { 38 <div class="sidebar"> 39 @{ 40 var sidebar = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, item.NavigationTag); 41 @RenderPageContent(sidebar.ID) 42 } 43 </div> 44 } 45 </div> 46 </div> 47 } 48

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur placerat euismod malesuada. Nulla non ante non sapien luctus tincidunt ut id metus. Maecenas tincidunt, enim a ultricies mollis, dolor arcu mollis sem, at aliquam odio diam eu odio. Mauris ut congue libero. Aliquam eleifend dolor iaculis, convallis erat ut, laoreet dui. In congue dictum felis. Etiam imperdiet metus urna, id condimentum sem porttitor vitae. Proin tincidunt ligula ex, et malesuada orci pellentesque at.

Vestibulum at arcu urna. Fusce eu libero id mauris tristique consectetur eget vel justo. Proin at arcu diam. Ut tincidunt orci ac est feugiat tristique. Aliquam varius arcu ut libero bibendum fringilla. Maecenas consectetur mi in est luctus, eget semper dolor malesuada. Sed nulla lorem, elementum sit amet ligula ut, varius sollicitudin sapien. Sed ac risus tortor.

 

Strategie in hoofdlijnen

Download hier het strategisch plan 2020 - 2025 in hoofdlijnen.

Download

Download hier het strategisch plan 2020 - 2025 in hoofdlijnen.

Download

Alle vacatures in Twente