Exception in template (Designs/Clusius2015/_parsed/news-detail.parsed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at Dynamicweb.Frontend.Page.get_Parent()
   at CompiledRazorTemplates.Dynamic.cdedbfbebfba.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
   at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb; @using System.Linq; <!DOCTYPE html> <html lang='@GetString("Lang")'> <head> <meta charset="utf-8" prefix="og: http://ogp.me/ns#"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300,600,900' rel='stylesheet' type='text/css'> @{ var color = GetString("DwTopPageID"); var NewsSector = string.Empty; if (Pageview.Page.Item != null && Pageview.Page.Item.SystemName == "News" && Pageview.Page.Item["Sector"] != null) { color = string.IsNullOrWhiteSpace(Pageview.Page.Item["Sector"].ToString()) ? color : Pageview.Page.Item["Sector"].ToString(); NewsSector = Pageview.Page.Item["Sector"].ToString().ToUpper(); } if (string.IsNullOrWhiteSpace(NewsSector)) { <title>@GetValue("Title")</title> @GetValue("MetaTags") @GetValue("CopyRightNotice") } else { @(string.Format("<title>Clusius College - {0} - {1}</title>", NewsSector, Pageview.Page.get_Value("pagemenutext"))) } if (Pageview.Page.Item != null && Pageview.Page.Item.SystemName == "Sector") { color = Pageview.Page.ID.ToString(); } if (Pageview.Page.Item != null && Pageview.Page.Item.SystemName == "Opleiding") { color = Pageview.Page.Parent.ID.ToString(); } switch (color) { case "corporate": case "11859": <link href="/Files/Templates/Designs/Clusius2015/dist/css/style_corporate.min.css?v=1.1" rel="stylesheet"> break; case "vmbo": case "11870": <link href="/Files/Templates/Designs/Clusius2015/dist/css/style_vmbo.min.css" rel="stylesheet"> break; case "mbo": case "11869": <link href="/Files/Templates/Designs/Clusius2015/dist/css/style_mbo.min.css" rel="stylesheet"> break; case "12917": <link href="/Files/Templates/Designs/Clusius2015/dist/css/style_dier.min.css" rel="stylesheet"> break; case "12918": <link href="/Files/Templates/Designs/Clusius2015/dist/css/style_voeding.min.css" rel="stylesheet"> break; case "12919": <link href="/Files/Templates/Designs/Clusius2015/dist/css/style_techniek.min.css" rel="stylesheet"> break; case "12920": <link href="/Files/Templates/Designs/Clusius2015/dist/css/style_bloem.min.css" rel="stylesheet"> break; case "12921": <link href="/Files/Templates/Designs/Clusius2015/dist/css/style_agribusiness.min.css" rel="stylesheet"> break; default: <link href="/Files/Templates/Designs/Clusius2015/dist/css/style_corporate.min.css" rel="stylesheet"> break; } } @{ var pagetitle = GetString("Title"); var description = GetString("Meta.Description"); var url = Base.GetHttpDomain() + Base.GetHttpUrl(true, true); <meta property="og:title" content="@pagetitle"> <meta property="og:url" content="@url"> <meta property="og:description " content="@description"> } <!--11859:corporate,11869:mbo,11870:vmbo--> <link rel="apple-touch-icon" sizes="57x57" href="/Files/Templates/Designs/Clusius2015/img/favicons/apple-touch-icon-57x57.png"> <link rel="apple-touch-icon" sizes="60x60" href="/Files/Templates/Designs/Clusius2015/img/favicons/apple-touch-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="/Files/Templates/Designs/Clusius2015/img/favicons/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="/Files/Templates/Designs/Clusius2015/img/favicons/apple-touch-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="/Files/Templates/Designs/Clusius2015/img/favicons/apple-touch-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="/Files/Templates/Designs/Clusius2015/img/favicons/apple-touch-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="/Files/Templates/Designs/Clusius2015/img/favicons/apple-touch-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="/Files/Templates/Designs/Clusius2015/img/favicons/apple-touch-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="/Files/Templates/Designs/Clusius2015/img/favicons/apple-touch-icon-180x180.png"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Clusius2015/img/favicons/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Clusius2015/img/favicons/favicon-194x194.png" sizes="194x194"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Clusius2015/img/favicons/favicon-96x96.png" sizes="96x96"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Clusius2015/img/favicons/android-chrome-192x192.png" sizes="192x192"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Clusius2015/img/favicons/favicon-16x16.png" sizes="16x16"> <link rel="manifest" href="/Files/Templates/Designs/Clusius2015/img/favicons/manifest.json"> <link rel="shortcut icon" href="/Files/Templates/Designs/Clusius2015/img/favicons/favicon.ico"> <meta name="msapplication-TileColor" content="#da532c"> <meta name="msapplication-TileImage" content="/Files/Templates/Designs/Clusius2015/img/favicons/mstile-144x144.png"> <meta name="msapplication-config" content="/Files/Templates/Designs/Clusius2015/img/favicons/browserconfig.xml"> <meta name="theme-color" content="#ffffff"> <!-- Google Tag Manager --> <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W23Q66" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push( {'gtm.start': new Date().getTime(),event:'gtm.js'} );var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-W23Q66');</script> <!-- End Google Tag Manager --> <!-- Global site tag (gtag.js) - Google Ads: 801701432 --> <script async="" src="https://www.googletagmanager.com/gtag/js?id=AW-801701432"></script> <script> window.dataLayer = window.dataLayer || []; function gtag() {dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'AW-801701432'); </script> @GetValue("Stylesheets") @GetValue("Javascripts") </head> @{ var styling = GetString("Item.Area.MainGroupStyling"); var topPageID = GetString("DwTopPageID") + ":"; var bodyClass = styling.Split(',').Where(e => e.StartsWith(topPageID)).Select(e => e.Replace(topPageID, "")).FirstOrDefault() ?? "corporate"; } <body class="@bodyClass"> <header> <nav class="navbar"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="navbar-icon-bars"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </span> <span class="icon-bar"></span> <div class="closemenu"> <span class="dia"><i class="diamond"></i></span> </div> </button> <a class="navbar-brand" href="/"></a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right tools"> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="btnSearch" role="button" aria-haspopup="true" aria-expanded="false" title="Zoeken..."><span class="search"><i class="diamond"></i></span></a> <form class="dropdown-menu searchform" aria-labelledby="btnSearch" method="get" action="/Default.aspx"> <span class="shadow"></span> <input type="hidden" name="ID" value="12900"> <input type="text" name="q" value="" placeholder="Type hier je zoekwoord..."> <button type="submit"><span class="dia"><i class="diamond"></i>Zoek</span></button> </form> </li> <li class="dropdown"> <a href="#" class="dropdown-toggle" id="btnMyClusius" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" title="Mijn.Clusius Intranet"><span class="lock"><i class="diamond"></i></span></a> <ul class="dropdown-menu myClusius" aria-labelledby="btnMyClusius"> <li class="shadow"></li> @GetValue("DwNavigation(intranetnav)") </ul> </li> @if (Pageview.Area.Item["English_PageID"].ToString() != "0") { <li><a href='/Default.aspx?ID=@Pageview.Area.Item["English_PageID"].ToString()'><span class="text"><i class="diamond" data-diamondcontent="EN"></i></span></a></li> } </ul> <ul class="nav navbar-nav navbar-right menu"> <li><a href="#" id="scrollToTop"></a></li> <li class="dropdown dropdown-mobile"> <a href="#" class="dropdown-toggle" id="btnMyClusius2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">Mijn.Clusius</a> <ul class="dropdown-menu myClusius collapsing-mobile" aria-labelledby="btnMyClusius2"> @GetValue("DwNavigation(intranetnav2)") <hr class="hr-dropdown-mobile"> </ul> </li> @GetValue("DwNavigation(Hoofdnavigatie)") <li class="mobilesearch"> <form method="get" action="/Default.aspx"> <input type="hidden" name="ID" value="12900"> <input type="text" name="q" value="" placeholder="Type hier je zoekwoord..."> <button type="submit"><span class="dia"><i class="diamond"></i></span></button> </form> </li> </ul> </div> </div> </nav> </header> @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System; <div class='newsdetail @GetString("Item.Page.Pageclass.Value")'> <div class="container-fluid"> @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb; @{ var Breadcrumb_Menu = GetString("DwNavigation(breadcrumbnav)"); if (GetBoolean("Item.Page.LayoutHideBreadcrumb") != true && !string.IsNullOrWhiteSpace(Breadcrumb_Menu)) { <div class="row breadcrumbs"> <ul> <li><a href="/" title="">Clusius.nl</a></li> @GetValue("DwNavigation(breadcrumbnav)") </ul> </div> } } @if (GetBoolean("Item.ShowSlider")) { var itemid = "carousel_" + GetValue("Item.Id"); var count = 1; <div class="row slider"> <div id="@itemid" class="carousel slide imgonly" data-ride="carousel" data-interval="4000"> <div class="carousel-inner" role="listbox"> @foreach (LoopItem i in GetLoop("Item.Slider")) { var active = count != 1 ? "" : "active"; var link = i.GetString("Item.Slider.Link"); var title = i.GetString("Item.Slider.Titel"); var img = i.GetString("Item.Slider.Image"); <div class="item @active" style="background: url('@img') center center; background-size: cover;"> <a href="@link" title="@title"> </a> <div class="carousel-caption"> <span>@title</span> </div> </div> count++; } </div> <div class="carousel-controls"> <a class="prev dia" href="#@itemid" role="button" data-slide="prev"> <span class="dia"><i class="diamond"></i></span> <span class="sr-only">Previous</span> </a> <a class="next" href="#@itemid" role="button" data-slide="next"> <span class="dia"><i class="diamond"></i></span> <span class="sr-only">Next</span> </a> </div> </div> </div> } else if (!string.IsNullOrWhiteSpace(GetString("Item.Image"))) { var img = GetString("Item.AfbeeldingGroot"); <div class="row slider"> <div class="news-img" style="background: url('@img') center center; background-size: cover; height: 400px;"></div> </div> } </div> <div class="container"> <div class="row"> @{ var newssector = GetString("Item.Sector"); var newsdate = GetDate("Item.Datum").ToString("dd MMM yyyy"); var newstitle = GetString("Item.Titel"); var newsteaser = GetString("Item.Teaser"); } <div class="introblock"> <div class="detailsbar"> <span class="sector @newssector.ToLower()">@newssector</span> <span class="date">@newsdate</span> </div> <h1>@newstitle</h1> <h2>@newsteaser</h2> </div> @if (!string.IsNullOrWhiteSpace(GetString("Item.Quote"))) { <div class="quote"> <span> @GetString("Item.Quote") </span> </div> } <div class="newscontent"> @GetString("Item.Text") </div> @{ var RelatedPages = new List<Dynamicweb.Frontend.Page>(); for (int i = 1; i <= 5; i++) { var pageid = GetInteger("Item.RelatedPage_" + i); if (pageid > 0) { RelatedPages.Add(Dynamicweb.Frontend.Page.FindPage(pageid)); } } if (RelatedPages.Count > 0) { <div class="relatedpages"> <h3>Gerelateerde pagina's</h3> <ul> @foreach (var page in RelatedPages) { <li><a href="/Default.aspx?ID=@page.ID" title="@page.get_Value(" pagemenutext")"=""><i class="diamond"></i> @page.get_Value("pagemenutext")</a></li> } </ul> </div> } } <div class="social"> <h3>Deel dit bericht via sociale media</h3> <!-- AddThis Button BEGIN --> <div class="addthis_toolbox addthis_default_style addthis_32x32_style"> <a class="addthis_button_facebook"></a> <a class="addthis_button_twitter"></a> <a class="addthis_button_google_plusone_share"></a> <a class="addthis_button_email"></a> </div> <script type="text/javascript">var addthis_config = { "data_track_addressbar": false };</script> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4fad889f28cb66a7"></script> <!-- AddThis Button END --> </div> @if (!string.IsNullOrWhiteSpace(GetString("Item.RelatedNews"))) { <div class="relatednews"> <div class="row newshome" id="news"> <h2>Gerelateerd nieuws</h2> @foreach (var item in GetLoop("Item.RelatedNews.Options")) { if (item.GetBoolean("Item.RelatedNews.Option.IsSelected")) { var newsitem = Dynamicweb.Content.Items.Item.GetItemById("news", item.GetString("Item.RelatedNews.Option.Value")); var sector = newsitem["Sector"]; <a href="/Default.aspx?ID=@newsitem.Page.ID" class="news-item @sector" title='@newsitem["Titel"]'> <div class="news-img"> <img src='/Admin/Public/GetImage.ashx?Image=@newsitem["Image"]&Height=480&Compression=100' alt='@newsitem["Titel"]'> </div> <div class="textblock"> <div class=""> <span class="sector">@sector</span> <span class="date">@Convert.ToDateTime(newsitem["Datum"]).ToString("dd MMM yyyy")</span> </div> <span class="news-title">@newsitem["Titel"]</span> <span class="cta"><i></i></span> </div> </a> } } </div> <a href="/Default.aspx?ID=@Pageview.Page.Parent.ID" class="cta"><i class="diamond"></i>Bekijk al het nieuws</a> </div> } </div> </div> </div> <footer> <div class="container-fluid"> <div class="footer-items"> <ul class="footer-links"> @GetValue("DwNavigation(Footerlinks)") </ul> <ul class="footer-rechts"> <li> <a href='@Pageview.Area.Item["Facebook"]' title="facebook" target="_blank" class="fb"><span class="dia"><i class="diamond"></i> Facebook</span></a> </li> <li> <a href='@Pageview.Area.Item["Twitter"]' title="twitter" target="_blank" class="twt"><span class="dia"><i class="diamond"></i> Twitter</span></a> </li> </ul> </div> </div> </footer> @if (GetInteger("DwPageID") != GetInteger("DwTopPageID")) { var backtext = string.Format("Terug naar {0}.", Pageview.Page.Parent.get_Value("pagemenutext")); <div class="backlevelup"> <a href="javascript:history.back();" title="@backtext"><span class="dia"><i class="diamond"></i></span></a> </div> } <script src="//maps.google.com/maps/api/js?key=AIzaSyBBbi7EANTU1npts5Vt_U2uTN6GLjzxIXw" type="text/javascript"></script> <script type="text/javascript" src="/Files/Templates/Designs/Clusius2015/dist/js/main.js?v=1.1"></script> </body> </html>