Exception in template (Designs/Danespo/_parsed/Page.parsed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.fdaaefbcffabf.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.RenderRazorTemplate()
@using System; @using System.Web; @using Dynamicweb; @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb; @helper RenderFacebookScript() { <div id="fb-root"></div> <script> (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/da_DK/sdk.js#xfbml=1&version=v2.8"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> } @using Dynamicweb; @helper RenderFacebookShare() { bool sharePageFB = GetBoolean("Item.Page.SharePageOnFacebook"); var pageViewUrlForSharing = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain() + Pageview.SearchFriendlyUrl; if (sharePageFB) { <div class="fb-share-button" data-href='@pageViewUrlForSharing' data-layout="button" data-size="small" data-mobile-iframe="true"><a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse">Del</a></div> } } @SnippetStart("Meta") @{ string sharePageImage = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain() + GetString("Item.Page.ImageForSharing"); string title = GetString("Title"); string description = GetString("Meta.Description"); var pageViewUrlForSharing = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain() + Pageview.SearchFriendlyUrl; <meta property="fb:app_id" content="966242223397117"> /* default facebook app-id */ <meta property="og:title" content='@title'> <meta property="og:type" content="article"> if (!string.IsNullOrEmpty(GetString("Item.Page.ImageForSharing"))) { <meta property="og:image" content='@sharePageImage'> } <meta property="og:url" content='@pageViewUrlForSharing'> <meta property="og:description" content="@description"> } @SnippetEnd("Meta") @{ var designBaseUrl = GetString("Template:DesignBaseUrl").TrimEnd('/'); List<LoopItem> languages = GetLoop("WebsiteLanguages"); bool isAlternativeSite = GetBoolean("Item.Area.IsAlternativeSite"); string languageTag = GetGlobalValue("Global:Area.Lang").ToLower(); } <!DOCTYPE html> <html lang="@languageTag"> <head> <title>@GetValue("Title")</title> @GetValue("MetaTags") @GetValue("CopyRightNotice") <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta http-equiv="x-ua-compatible" content="ie=edge"> @RenderSnippet("Meta") <link rel="stylesheet" href='@designBaseUrl/Assets/Styles/Main.min.css?v.2.14'> @RenderSnippet("Styling") @{ string alternativeColor = Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["AlternativeColor"]); if (!string.IsNullOrEmpty(alternativeColor)) { <style type="text/css"> .content-row-wrapper .content-row-content-wrapper .content-row-content.style2 .content-row-link-alternative { background-color: @alternativeColor; } </style> } } <!-- Google Tag Manager --> <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 = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); })(window, document, 'script', 'dataLayer', 'GTM-NWHDKFK'); </script> <!-- End Google Tag Manager --> @GetValue("Stylesheets") @GetValue("Javascripts") </head> <body> <!-- Google Tag Manager (noscript) --> <noscript> <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NWHDKFK" height="0" width="0" style="display:none;visibility:hidden"></iframe> </noscript> <!-- End Google Tag Manager (noscript) --> <div class="wrapper"> <div class="page"> <header class="header"> <div class="header-topline hidden-sm-down"> <div class="container"> <div class="row"> <div class="col-md-12 header-tabs"> @if (languageTag == "da") { if (isAlternativeSite) { <span class="tab active-tab">@Translate("Smartpage:Header.Sites.Site1", "Forbruger")</span> <a href='@GetValue("Item.Area.AlternativeSite")' class="tab ">@Translate("Smartpage:Header.Sites.Site2", "Erhverv")</a> } else { <a href='@GetValue("Item.Area.AlternativeSite")' class="tab">@Translate("Smartpage:Header.Sites.Site1", "Forbruger")</a> <span class="tab active-tab">@Translate("Smartpage:Header.Sites.Site2", "Erhverv")</span> } } </div> <div class="col-md-12 header-lang-select"> @if (languages.Any() && Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["LanguageActive"]) == "True") { <div class="dropdown"> <button class="dropdown-button" type="button" id="desktopLangSelect" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> @languages.FirstOrDefault(l => l.GetBoolean("IsCurrent")).GetString("Name") </button> <div class="dropdown-menu" aria-labelledby="desktopLangSelect"> @foreach (var language in languages) { string url = "/Default.aspx?id=" + language.GetValue("FirstPageID"); //for pretty urls string isMaster = language.GetBoolean("IsMaster") ? "js-langmaster" : ""; <a href="@url" class="dropdown-item @isMaster"> @language.GetValue("Name") </a> } </div> </div> } </div> </div> </div> </div> <div class="header-topbar"> <div class="container"> <div class="row"> <div class="col-xs-18 col-sm-8 col-md-4 col-lg-4 header-logo"> <a href='@GetValue("Item.Area.SiteFrontpage")' class="header-logo-link"> <img src='@Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["Logo"])' class="img-fluid hidden-md-up" alt='@Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["SiteName"])'> <img src='@Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["LogoLarge"])' class="img-fluid hidden-sm-down" alt='@Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["SiteName"])'> </a> </div> <div class="col-xs-6 col-sm-16 hidden-md-up header-hamburger"> <button class="hamburger hamburger--slider js-navigation-toggle" type="button"> <span class="hamburger-box"> <span class="hamburger-inner"></span> </span> </button> </div> <div class="col-xs-24 col-sm-24 col-md-20 col-lg-20 header-navigation"> <div class="navigation js-navigation"> <div class="header-topline hidden-md-up"> <div class="container"> <div class="row"> <div class="col-xs-14 header-tabs"> @if (isAlternativeSite) { <span class="tab active-tab">@Translate("Smartpage:Header.Sites.Site1", "Forbruger")</span> <a href='@GetValue("Item.Area.AlternativeSite")' class="tab ">@Translate("Smartpage:Header.Sites.Site2", "Erhverv")</a> } else { <a href='@GetValue("Item.Area.AlternativeSite")' class="tab">@Translate("Smartpage:Header.Sites.Site1", "Forbruger")</a> <span class="tab active-tab">@Translate("Smartpage:Header.Sites.Site2", "Erhverv")</span> } </div> <div class="col-xs-10 header-lang-select"> @if (languages.Any() && !isAlternativeSite) { <div class="dropdown"> <button class="dropdown-button" type="button" id="mobileLangSelect" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> @languages.FirstOrDefault(l => l.GetBoolean("IsCurrent")).GetString("Name") </button> <div class="dropdown-menu" aria-labelledby="mobileLangSelect"> @foreach (var language in languages) { <a href='/Default.aspx?id=@language.GetValue("FirstPageID")' class="dropdown-item"> @language.GetValue("Name") </a> } </div> </div> } </div> </div> </div> </div> <div class="navigation-wrap"> @GetValue("DwNavigation(mainnavigation)") </div> </div> </div> </div> </div> </div> </header> <div class="content-wrapper"> @using System; @using System.Web; @using System.Linq; @using Dynamicweb; @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System; @using System.Web; @using Dynamicweb; @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @helper RenderBreadcrumbs() { if ((Pageview.Page.PropertyItem != null && Dynamicweb.Core.Converter.ToBoolean(Pageview.Page.PropertyItem["ShowBreadcrumbsOnPage"])) && Dynamicweb.Core.Converter.ToBoolean(Pageview.Area.Item["ShowBreadcrumbsOnWebsite"])) { @GetValue("DwNavigation(mainbreadcrumbs)") } } <div class="container"> @RenderFacebookShare() <div class="row page-row"> <div class="col-xs-24 col-sm-24 col-md-16 col-lg-18"> <div class="page-content"> <ul class="breadcrumbs" itemscope="" itemtype="http://schema.org/ListItem"> @RenderBreadcrumbs() </ul> <div id="content">@GetValue("DwContent(content)")</div> </div> </div> <div class="col-xs-24 col-sm-24 col-md-8 col-lg-6"> <div class="page-side" id="side">@GetValue("DwContent(side)")</div> </div> </div> </div> @SnippetStart("Styling") @{ string backgroundImagePath = Dynamicweb.Core.Converter.ToString(Pageview.Page.PropertyItem["BackgroundImage"]); string backgroundImage = "url('" + backgroundImagePath + "')"; } @if (!string.IsNullOrEmpty(backgroundImagePath)) { <style type="text/css"> body { background-image: @backgroundImage; } </style> } @SnippetEnd("Styling") </div> </div> </div> <footer class="footer"> <div class="container"> <div class="row"> <div class="col-xs-24 col-sm-24 col-md-6"> <h4 class="h4">@Translate("Smartpage:Footer.List.Header.CompanyName", "Danespo A/S")</h4> <ul class="list"> @if (!string.IsNullOrEmpty(Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["CompanyAddress"]))) { <li class="list-item">@Pageview.Area.Item["CompanyAddress"]</li> } @if (!string.IsNullOrEmpty(Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["CompanyPhone"]))) { <li class="list-item">@Translate("Smartpage:Footer.CompanyInfo.Phone", "Telefon:") @Pageview.Area.Item["CompanyPhone"]</li> } @if (!string.IsNullOrEmpty(Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["CompanyEmail"]))) { <li class="list-item">@Translate("Smartpage:Footer.CompanyInfo.Email", "Email:") @Pageview.Area.Item["CompanyEmail"]</li> } @if (!string.IsNullOrEmpty(Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["CompanyNo"]))) { <li class="list-item">@Translate("Smartpage:Footer.CompanyInfo.CompanyNo", "CVR nr.") @Pageview.Area.Item["CompanyNo"]</li> } </ul> </div> <div class="col-xs-24 col-sm-24 col-md-6"> <h4 class="h4">@Translate("Smartpage:Footer.List.Header.Production", "Produktion")</h4> @GetValue("DwNavigation(footerlist1)") </div> <div class="col-xs-24 col-sm-24 col-md-6"> <h4 class="h4">@Translate("Smartpage:Footer.List.Header.Profile", "Om os")</h4> @GetValue("DwNavigation(footerlist2)") </div> <div class="col-xs-24 col-sm-24 col-md-6"> <h4 class="h4">@Translate("Smartpage:Footer.List.Header.Links", "Links")</h4> <ul class="list inline"> @if (!string.IsNullOrEmpty(Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["FacebookLink"]))) { <li class="list-item"> <a href='@Pageview.Area.Item["FacebookLink"]' target="_blank" class="list-item-link facebook"></a> </li> } @if (!string.IsNullOrEmpty(Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["SmileyLink"]))) { string smileyLink = Dynamicweb.Core.Converter.ToString(Pageview.Area.Item["SmileyLink"]); <li class="list-item"> <a href="@smileyLink" target="_blank" class="list-item-link smiley"></a> </li> } </ul> </div> </div> </div> </footer> <script> (function (d) { var config = { kitId: 'znw6ggx', scriptTimeout: 3000, async: true }, h = d.documentElement, t = setTimeout(function () { h.className = h.className.replace(/\bwf-loading\b/g, "") + " wf-inactive"; }, config.scriptTimeout), tk = d.createElement("script"), f = false, s = d.getElementsByTagName("script")[0], a; h.className += " wf-loading"; tk.src = 'https://use.typekit.net/' + config.kitId + '.js'; tk.async = true; tk.onload = tk.onreadystatechange = function () { a = this.readyState; if (f || a && a != "complete" && a != "loaded") return; f = true; clearTimeout(t); try { Typekit.load(config) } catch (e) { } }; s.parentNode.insertBefore(tk, s) })(document); </script> <script src='@designBaseUrl/Assets/Scripts/Main.min.js?v.1.6'></script> @RenderSnippet("JavaScript") <!-- Facebook Pixel Code --> <script> !function (f, b, e, v, n, t, s) { if (f.fbq) return; n = f.fbq = function () { n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments) }; if (!f._fbq) f._fbq = n; n.push = n; n.loaded = !0; n.version = '2.0'; n.queue = []; t = b.createElement(e); t.async = !0; t.src = v; s = b.getElementsByTagName(e)[0]; s.parentNode.insertBefore(t, s) }(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js'); fbq('init', '809140685906229', { em: 'insert_email_variable' }); fbq('track', 'PageView'); </script> <noscript> <img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=809140685906229&ev=PageView&noscript=1"> </noscript> <!-- DO NOT MODIFY --> <!-- End Facebook Pixel Code --> <div id="fb-root"></div> <script> (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/da_DK/sdk.js#xfbml=1&version=v2.8"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> </body> </html>