Exception in template (Designs/Animo/_parsed/Landing_Page.parsed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at Application.Helpers.RedirectHelperV2.MasterpageRedirectCheck(String currentUrlMain, List`1 areaLanguages)
   at CompiledRazorTemplates.Dynamic.eaffddd.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()
@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System.Web @using Dynamicweb @using Application.Helpers @{ var currentPageId = GetGlobalValue("Global:Page.ID"); var languages = GetLoop("Languages"); var currentUrlMain = HttpContext.Current.Request.Url.AbsoluteUri.ToString().ToLowerInvariant(); var isAdminCall = currentUrlMain.ToLower().Contains("/admin/"); var loginUrl = string.Format("/Default.aspx?ID={0}", GetPageIdByNavigationTag("login")); // Redirect if nessecary // Niet uitvoeren bij /admin/ aanroepen (imagehandler, 404, etc) if (!isAdminCall) { //Application.Helpers.RedirectHelper.MasterpageRedirectCheck(currentUrlMain, currentPageId, languages); Application.Helpers.RedirectHelperV2.MasterpageRedirectCheck(currentUrlMain, languages); } var loggedInText = Application.Helpers.UserHelper.GetLoggedInText(Translate("Login"), Translate("Logged in as", "Ingelogd als"), GetString("DW_extranet_AccessUserName")); var culture = GetString("LongLang"); // Set language values: // Alternate links and content-language meta tags, // Desktop navigation list items // Mobile navigation list items // Niet uitvoeren bij /admin/ aanroepen (imagehandler, 404, etc) var languageHeaderContent = new System.Text.StringBuilder(); var languageNavigationListItems_Desktop = new System.Text.StringBuilder(); var languageNavigationListItems_Mobile = new System.Text.StringBuilder(); if (!isAdminCall) { Application.Helpers.NavigationHelper.SetMasterLanguageValues( languages, currentPageId, GetString("DWExtranetAction"), currentUrlMain, GetGlobalValue("Global:Area.ID"), out languageHeaderContent, out languageNavigationListItems_Desktop, out languageNavigationListItems_Mobile); } var extranetLoginEnabled = GetBoolean("Item.Area.ExtranetLoginEnabled"); // Check if page is an Extranet page or child. var currentPage = Dynamicweb.Frontend.PageView.Current().Page; var extranetPageId = GetPageIdByNavigationTag("Extranet"); var isExtranet = ExtranetHelper.IsExtranetPage(currentPage, extranetPageId); } <!DOCTYPE html> <html lang='@culture'> <head> <!-- 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-MGFF9C');</script> <!-- End Google Tag Manager --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="theme-color" content="#000000"> <meta name="globalsign-domain-verification" content="ElMIalq8Mv4eCDxwOXnBFkHkkIEYZppGpaeurb6Ouk"> @RenderSnippet("MetaTags") <title>@GetValue("Title")</title> @GetValue("MetaTags") @GetValue("CopyRightNotice") @* Print alternate links and content-language meta tags *@ @languageHeaderContent.ToString() <!-- Standard Favicon in multiple sizes --> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Animo/Assets/Img/Favicons/favicon-16x16.png"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Animo/Assets/Img/Favicons/favicon-24x24.png"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Animo/Assets/Img/Favicons/favicon-32x32.png"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Animo/Assets/Img/Favicons/favicon-64x64.png"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Animo/Assets/Img/Favicons/favicon-92x92.png"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Animo/Assets/Img/Favicons/favicon-128x128.png"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Animo/Assets/Img/Favicons/favicon-256x256.png"> <!-- Favicons for iOS --> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/Files/Templates/Designs/Animo/Assets/Img/Favicons/apple-touch-icon-72x72-precomposed.png"> <link rel="apple-touch-icon-precomposed" sizes="120x120" href="/Files/Templates/Designs/Animo/Assets/Img/Favicons/apple-touch-icon-120x120-precomposed.png"> <link rel="apple-touch-icon-precomposed" sizes="144x144" href="/Files/Templates/Designs/Animo/Assets/Img/Favicons/apple-touch-icon-144x144-precomposed.png"> <link rel="apple-touch-icon-precomposed" sizes="152x152" href="/Files/Templates/Designs/Animo/Assets/Img/Favicons/apple-touch-icon-152x152-precomposed.png"> <!-- For Windows (tile) --> <meta name="msapplication-TileImage" content="Assets/Img/Favicons/pinned.png"> <meta name="msapplication-TileColor" content="#000000"> <!-- UIKit Core CSS --> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Library/UIKit/uikit.min.css"> <!-- UIKit Extra CSS --> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Library/UIKit/Components/slidenav.min.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Library/UIKit/Components/slideshow.min.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Library/UIKit/Components/slidenav.min.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Library/UIKit/Components/accordion.almost-flat.min.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Library/UIKit/Components/accordion.gradient.min.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Library/UIKit/Components/accordion.min.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Library/UIKit/Components/form-file.min.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Library/UIKit/Components/search.almost-flat.min.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Library/UIKit/Components/autocomplete.almost-flat.css"> <!-- Site CSS --> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Fonts/animo.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Fonts/futurastd.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Fonts/agaramondpro.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/site.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/faq-page.css"> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/login-overlay.css"> <!-- Lightbox --> <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/Library/Lightbox2/lightbox.min.css"> <!-- Font-Awesome --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> @* Required in head *@ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> @RenderSnippet("StyleSheet") @RenderSnippet("JavaScript") @GetValue("Stylesheets") @GetValue("Javascripts") </head> <body> <!-- Google Tag Manager (noscript) --> <noscript> <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MGFF9C" height="0" width="0" style="display:none;visibility:hidden"></iframe> </noscript> <!-- End Google Tag Manager (noscript) --> <div class="container"> <header class="main-header"> <nav id="mainnav" class="uk-navbar"> <a href='/@culture.ToLowerInvariant()' class="uk-navbar-brand uk-hidden-small"><img src="/Files/Templates/Designs/Animo/Assets/Img/brand_logo.svg" alt="animo brand icon"></a> <a href="javascript:void(0)" class="uk-navbar-toggle uk-visible-small" onclick="OffCanvasOpen('mainoffcanvasnav')"></a> <!-- Navigation links left --> @* 'expandmode:all' required for the proper mainnavbar template behavior *@ @GetValue("DwNavigation(mainnavbar)") <!-- Navigation links right --> <div class="uk-navbar-flip"> <ul class="uk-navbar-nav"> <li class="uk-parent uk-hidden-small" data-uk-dropdown="{pos:'bottom-right'}" aria-haspopup="true" aria-expanded="false"> <a href="javascript:void(0)">@Application.Helpers.RedirectHelper.DisplayLanguageCode(culture, languages)</a> <div class="uk-dropdown uk-dropdown-navbar uk-dropdown-bottom" style="top: 40px; left: 0px;"> <ul class="uk-nav uk-nav-navbar"> @languageNavigationListItems_Desktop </ul> </div> </li> @if (!isExtranet) { <li><a href="javascript:void(0)" onclick="OffCanvasOpen('searchbar')"><i class="icon-search2"></i></a></li> } @if (extranetLoginEnabled) { <li> <a href="@loginUrl"> <div class="user-container"> <i class="icon-user"></i> <span class="placeholder-user"> @loggedInText </span> </div> </a> </li> } </ul> </div> <!-- Center the brand on small viewports --> <a href='/@culture.ToLowerInvariant()' id="nav-logo" class="uk-navbar-content uk-navbar-center uk-navbar-brand uk-visible-small"><img src="/Files/Templates/Designs/Animo/Assets/Img/brand_logo.svg" alt="animo brand icon"></a> </nav> <!-- Subnavigation --> @GetValue("DwNavigation(subnavbar)") @if (Pageview.Page.Parent != null) { <!-- Breadcrumb --> <nav class="breadcrumb-container"> <ul class="breadcrumb"> @GetValue("DwNavigation(NavBreadcrumb)") </ul> </nav> } </header> <!-- Main navigation off canvas (mobile navigation) --> <div id="mainoffcanvasnav" class="uk-offcanvas"> <nav class="uk-offcanvas-bar"> @GetValue("DwNavigation(mainoffcanvasnavbar)") <ul id="lang-nav" class="uk-nav uk-nav-offcanvas uk-nav-parent-icon" data-uk-nav=""> <li class="uk-parent"> <a href="#">@Application.Helpers.RedirectHelper.DisplayLanguageCode(culture, languages)</a> <ul class="uk-nav-sub M1"> @languageNavigationListItems_Mobile </ul> </li> </ul> </nav> </div> <!-- Searchbar off canvas --> <div id="searchbar" class="uk-offcanvas"> <div class="uk-offcanvas-bar uk-offcanvas-bar-flip"> <nav id="searchnav" class="uk-navbar"> <ul class="uk-navbar-nav"> <li><a onclick="OffCanvasClose('searchbar')"><i class="fa fa-times" style="font-family: FontAwesome !important;"></i></a></li> <li><span class="uk-navbar-content">@Translate("Search", "Search")</span></li> </ul> </nav> <form class="uk-form" method="get" action="/Default.aspx" data-uk-search=""> <input type="hidden" name="ID" value='@GetValue("DwAreaSearchPageID")'> <div class="uk-form-row"><input type="search" name="q" class="uk-search-field" placeholder='@Translate("SearchPhrase", "What are you trying to find?")' value='@HttpContext.Current.Request.QueryString["q"]'></div> <div class="uk-form-row"><button type="submit" class="uk-button uk-button-glacier-blue uk-width-1-1">@Translate("Search", "Search")</button></div> </form> </div> </div> <section class="main-section"> @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System.Text.RegularExpressions; @SnippetStart("StyleSheet") <link rel="stylesheet" href="/Files/Templates/Designs/Animo/Assets/Stylesheets/landing-page.css"> @SnippetEnd("StyleSheet") @SnippetStart("JavaScriptBottom") <script src="/Files/Templates/Designs/Animo/Assets/JS/video-player.js"></script> <script src="https://www.youtube.com/iframe_api"></script> @SnippetEnd("JavaScriptBottom") <div class="uk-slidenav-position" data-uk-slideshow="{autoplay:true, animation: 'swipe'}"> <ul class="uk-slideshow"> @foreach (var item in GetLoop("Item.Promotions")) { var image = Regex.Replace(item.GetString("Item.Promotions.Promo_Image"), @"\s+","%20"); var titleClass = item.GetString("Item.Promotions.Text_Color") == "black" ? "title-black" : "title-white"; <li> <img src='@image' alt='@item.GetValue("Item.Promotions.Promo_Image_Alt")'> <div class="uk-overlay-panel uk-flex uk-flex-middle slider-overlay"> <div class="title-container"> <h1 class="@titleClass title-block"> <span class="title">@item.GetValue("Item.Promotions.Promo_Title")</span> <span class="subtitle">@item.GetValue("Item.Promotions.Promo_Subtitle")</span> </h1> <a class="uk-button uk-button-glacier-blue more-button" href='@item.GetValue("Item.Promotions.Promo_Link")'>@item.GetValue("Item.Promotions.Promo_Btn_Text")</a> </div> </div> </li> } </ul> <a href="" class="uk-slidenav uk-slidenav-contrast uk-slidenav-previous" data-uk-slideshow-item="previous"></a> <a href="" class="uk-slidenav uk-slidenav-contrast uk-slidenav-next" data-uk-slideshow-item="next"></a> </div> <div class="uk-grid uk-grid-width-small-1-1 uk-grid-width-medium-1-4 content-blocks-section" data-uk-grid="" data-uk-grid-match=""> @{ string type; string block; string title; string subtitle; for(var i = 1; i <= 4; i++) { block = "Item.Content_Block_" + i; type = GetString(block+".Type"); title = GetString(block+".Title"); subtitle = GetString(block+".Subtitle"); <div id="content-block-@i" class="content-block"> <div class="content-block-container"> @if(type == "link") { string image = GetString(block+".Image"); string link = GetString(block+".Link"); <div class="content-block-image uk-height-1-1" style='background-image:url("@image")'> <a href="@link" class="content-block-overlay uk-vertical-align "> <div class="image-text uk-vertical-align-middle uk-align-center"> <h2 class="title">@title</h2> <h3 class="subtitle">@subtitle</h3> </div> </a> </div> } else if (type == "video") { string videoID = GetString(block+".Video_ID"); string screenURL = "https://img.youtube.com/vi/" + GetString(block+".Video_ID") + "/0.jpg"; <div id="video-@i-controller" class="content-block-image uk-height-1-1" style='background-image:url("@screenURL")'> <a href="javascript:playVideo('video-@i')" class="content-block-overlay uk-vertical-align "> <div class="image-text uk-vertical-align-middle uk-align-center"> <h2 class="title">@title</h2> <h3 class="subtitle">@subtitle</h3> </div> <img class="video-button" src="/Files/Templates/Designs/Animo/Assets/Img/buttons/icon_video_play.svg"> </a> </div> <div id="video-@i" class="video-placeholder" data-videoid="@videoID"></div> } </div> </div> } } </div> </section> <footer class="main-footer"> <div> <div class="brand"><img src="/Files/Templates/Designs/Animo/Assets/Img/brand_icon.svg" alt="animo brand icon"></div> <div class="slogan">@Translate("FooterSlogan", "DEDICATED TO EVERY CUP")</div> <div class="subscribe-newsletter-small uk-text-uppercase uk-clearfix"> <p>@Translate("SubscribeNewsletter", "Subscribe to our newsletter")</p> <a class="uk-button uk-button-glacier-blue" href='@Translate("SuscribeNewsletterPage", "SuscribeNewsletterPage")'>@Translate("Subscribe", "Subscribe")</a> </div> <nav> @GetValue("DwNavigation(footernavbar)") </nav> <p class="copyright">@Translate("CopyRights", "© 2016 Animo B.V. All rights reserved.")</p> </div> </footer> <!-- UIKit Core JavaScript --> @*<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>*@ <script src="/Files/Templates/Designs/Animo/Assets/JS/Library/UIKit/uikit.min.js"></script> <!-- UIKit Extra JavaScript --> <script src="/Files/Templates/Designs/Animo/Assets/JS/Library/UIKit/Core/nav.min.js"></script> <script src="/Files/Templates/Designs/Animo/Assets/JS/Library/UIKit/Components/slideshow.min.js"></script> <script src="/Files/Templates/Designs/Animo/Assets/JS/Library/UIKit/Components/sticky.min.js"></script> <script src="/Files/Templates/Designs/Animo/Assets/JS/Library/UIKit/Core/smooth-scroll.min.js"></script> <!-- UIKit Component JS --> <script src="/Files/Templates/Designs/Animo/Assets/JS/Library/UIKit/Components/accordion.min.js"></script> <script src="/Files/Templates/Designs/Animo/Assets/JS/Library/UIKit/Components/search.min.js"></script> <script src="/Files/Templates/Designs/Animo/Assets/JS/Library/UIKit/Components/autocomplete.min.js"></script> <!-- Site JavaScript --> <script src="/Files/Templates/Designs/Animo/Assets/JS/site.js"></script> <script src="/Files/Templates/Designs/Animo/Assets/JS/OffCanvasFix.js"></script> <script src="/Files/Templates/Designs/Animo/Assets/JS/login-overlay.js"></script> <!-- Lightbox JavaScript --> <script src="/Files/Templates/Designs/Animo/Assets/JS/Library/Lightbox2/lightbox.min.js"></script> @RenderSnippet("JavaScriptBottom") <script type="text/javascript"> var addthis_config = { // ... members go here ui_tabindex: 3 } </script> <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-56f2aca36c4c0313"></script> <!-- MouseFlow --> <script type="text/javascript"> var _mfq = _mfq || []; (function () { var mf = document.createElement("script"); mf.type = "text/javascript"; mf.async = true; mf.src = "//cdn.mouseflow.com/projects/210dde68-0078-4f22-bd8a-81e7a4258eeb.js"; document.getElementsByTagName("head")[0].appendChild(mf); })(); </script> </div> </body> </html>