Exception in template (Designs/Nissens_website/_parsed/ProductPage.parsed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.dfdcfcdbcc.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
<!DOCTYPE html> <html> @using Dynamicweb; @using System.Globalization; @functions { public bool IsSecret() { var secret = System.Web.HttpContext.Current.Request["secretindexbuildkey"]; if (!string.IsNullOrEmpty(secret)) { var masterAreaId = Dynamicweb.Base.ChkInteger(Pageview.Area.get_Value("AreaMasterAreaID")); var item = masterAreaId == 0 ? Pageview.Area.Item : Dynamicweb.Frontend.Area.GetAreaById(masterAreaId).Item; var areaSecret = item["SecretKey"].ToString(); var isSecret = areaSecret == secret; return isSecret; } return false; } public string Jsonify(object obj) { return Newtonsoft.Json.JsonConvert.SerializeObject(obj, Newtonsoft.Json.Formatting.Indented); } public int GetMasterAreaId() { var masterAreaId = (int)Pageview.Area.get_Value("areamasterareaid"); masterAreaId = masterAreaId > 0 ? masterAreaId : Pageview.AreaID; return masterAreaId; } public IDictionary<int, CultureInfo> GetAreaCultureMap() { var masterAreaId = GetMasterAreaId(); var languageAreas = Pageview.AreaCollection.Values.OfType<Dynamicweb.Frontend.Area>() .Where(a => (bool)a.get_Value("areaactive")) .Where(a => a.ID == masterAreaId || ((int)a.get_Value("areamasterareaid")) == masterAreaId); var map = languageAreas .ToDictionary(a => a.ID, a => new CultureInfo(a.get_Value("areaculture").ToString())); return map; } public int GetPageIdFromLink(string link) { if (string.IsNullOrEmpty(link)) { return 0; } var id = link.Split('=').Last(); int pageId; if (!int.TryParse(id, out pageId)) { return 0; } return pageId; } public Dynamicweb.Frontend.Page GetPageForCurrentCulture(int pageId) { var map = GetAreaCultureMap(); if (!map.ContainsKey(Pageview.AreaID)) { return null; } var culture = map[Pageview.AreaID]; var localPage = GetPageForCulture(pageId, culture.ToString()); return localPage; } public string GetValueFromMasterAreaItem(string key) { var masterArea = Dynamicweb.Frontend.Area.GetAreaById(GetMasterAreaId()); var value = masterArea.Item[key]; if (value == null) { return null; } return value.ToString(); } public Dynamicweb.Frontend.Page GetCurrentPageForCulture(string culture) { return GetPageForCulture(Pageview.ID, culture); } public Dynamicweb.Frontend.Page GetPageForCulture(int pageId, string culture) { var specifiedPage = Dynamicweb.Frontend.Page.FindPage(pageId); if (specifiedPage == null) { return null; } var masterPageId = (int)specifiedPage.get_Value("pagemasterpageid"); var masterPage = Dynamicweb.Frontend.Page.FindPage(masterPageId > 0 ? masterPageId : specifiedPage.ID); if (masterPage == null) { return null; } var cultureMap = GetAreaCultureMap(); var hasCultureArea = cultureMap.Any(pair => pair.Value.Name.ToLower().StartsWith(culture.ToLower())); if (!hasCultureArea) { return null; } var cultureAreaId = cultureMap.First(pair => pair.Value.Name.ToLower().StartsWith(culture.ToLower())).Key; var languageAreas = ((IEnumerable<Dynamicweb.Frontend.Page>)masterPage.Values["Languages"]); if (languageAreas == null) { return null; } var culturePage = languageAreas.FirstOrDefault(p => p.AreaID == cultureAreaId); return culturePage; } public string StripHTML(string input) { return System.Text.RegularExpressions.Regex.Replace(input, "<.*?>", String.Empty); } } @{ var cacheBust = "v=26"; string currentLanguage = GetGlobalValue("Global:Area.Lang"); } <head> <script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="@currentLanguage.ToUpper()" type="text/javascript"></script> <script> window.addEventListener('CookieInformationConsentGiven', function () { if (CookieInformation.getConsentGivenFor('cookie_cat_statistic')) { (function () { (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-10575630-2', 'auto'); ga('send', 'pageview'); })();}}, false); </script> <!-- 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-TFTQ9T6');</script> <!-- End Google Tag Manager --> <!-- 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-TTS6PGH');</script> <!-- End Google Tag Manager --> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>@GetValue("Title")</title> @GetValue("MetaTags") @GetValue("CopyRightNotice") <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="/Files/Templates/Designs/Nissens_website/./css/styles.css?@cacheBust" type="text/css" rel="stylesheet"> <link href="/Files/Templates/Designs/Nissens_website/./css/cookie/cookieinformation.min.css?@cacheBust" type="text/css" rel="stylesheet"> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/modernizr/modernizr-custom.js?@cacheBust"></script> <link rel="apple-touch-icon" sizes="180x180" href="/Files/Templates/Designs/Nissens_website/apple-touch-icon.png"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Nissens_website/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="/Files/Templates/Designs/Nissens_website/favicon-16x16.png" sizes="16x16"> <link rel="manifest" href="/Files/Templates/Designs/Nissens_website/manifest.json"> <link rel="mask-icon" href="/Files/Templates/Designs/Nissens_website/safari-pinned-tab.svg" color="#266795"> <meta name="facebook-domain-verification" content="c6s2qd949f1oz67l34swgaln7waxhh"> <meta name="theme-color" content="#ffffff"> <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,600,700,700i&amp;subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese" rel="stylesheet"> @GetValue("Stylesheets") @GetValue("Javascripts") </head> @{ var ar = Dynamicweb.Content.Area.GetAreaById(Pageview.AreaID); var currentLanguages = (ar != null) ? ar.Culture.ToLower() : string.Empty; } <body class="@currentLanguages"> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TFTQ9T6" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TTS6PGH" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TFTQ9T6" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <script type="text/javascript" src="https://secure.leadforensics.com/js/101799.js"></script> <noscript><img src="https://secure.leadforensics.com/101799.png" style="display:none;"></noscript> @helper renderGridOverview(System.Collections.Generic.IEnumerable<Dynamicweb.Content.Items.Item> itemsInGridOverview, string numberOfColumns, bool extraField) { var columnClass = ""; if(numberOfColumns == "2Columns") { columnClass = ""; } if(numberOfColumns == "2ColumnsGreyBackground") { columnClass = "alt-view"; } if(numberOfColumns == "3Columns") { columnClass = "three-columns"; } <section class="module-overview @columnClass"> <div class="hd-container"> <ul> @foreach(var item in itemsInGridOverview) { var headline = (item["Headline"] as string) ?? string.Empty; var text = (item["Text"] as string) ?? string.Empty; var image = (item["Image"] as string) ?? string.Empty; var link = (item["Link"] as string) ?? string.Empty; var linkText = (item["LinkText"] as string) ?? string.Empty; var newWindowItem = item["OpenInNewWindow"] as bool?; var hover = (!string.IsNullOrEmpty(link)) ? "hover-link" : string.Empty; var newWindow = (bool) newWindowItem; var OpenInNewWindow = (newWindow) ? "_blank" : string.Empty; if(!string.IsNullOrEmpty(link)) { <li> <a href="@link" class="product-list-item @hover" target="@OpenInNewWindow"> @if(!string.IsNullOrEmpty(image)) { <div class="img"> <img data-src="@image" src="@image" alt="" class="lazy-loaded"> </div> } <div class="txt"> <div> <h3>@headline</h3> @text </div> </div> <span class="btn">@linkText<span class="icon-arrow-line-right"></span></span> </a> </li> } else { <li> <div class="product-list-item txt-only"> @if(!string.IsNullOrEmpty(image)){ <div class="img" style="background-image: url(@image)"></div> } <div class="txt"> <div> <h3>@headline</h3> @text </div> </div> </div> </li> } } @if(extraField) { if(numberOfColumns == "3Columns") { var numberOfEmptyFields = itemsInGridOverview.Count() % 3; if(numberOfEmptyFields == 1) { numberOfEmptyFields = 2; } else if(numberOfEmptyFields == 2) { numberOfEmptyFields = 1; } for(int i = 0; i < numberOfEmptyFields; i++) { <li class="empty-element"> <div> </div> </li> } } else{ var numberOfEmptyFields = itemsInGridOverview.Count() % 2; for(int i = 0; i < numberOfEmptyFields; i++) { <li class="empty-element"> <div> </div> </li> } } } </ul> </div> </section> } @using Dynamicweb.Content; @using Dynamicweb.Content.Items; @using System; @using System.Collections; @using System.Collections.Generic; @using System.Globalization; @using System.Text.RegularExpressions; @{ var color = "#FFF"; var hoverColor = "#02afef"; var firstAreaPage = Pageview.Area.get_Value("areafirstactivepage"); var navAreaMainPages = ((IEnumerable)Pageview.Area.get_Value("AreaMainPages")).Cast<int>().Select(pid => pid); var navPages = Page.GetPages(navAreaMainPages.ToArray()); string contactUsDefaultLink = null; string contactUsDefaultName = "Contact Us"; var area = Area.GetAreaById(Pageview.AreaID); var currentArea = area; var currentFlag = area.Flag32x32; var twoLetterName = new RegionInfo(area.CultureInfo.LCID).TwoLetterISORegionName; if(!area.IsMaster) { var oldArea = area; area = area.MasterArea; if (area == null) { area = oldArea; } } var page = Page.GetPageById(Pageview.ID); var areaLanguages = new List<Area>(); areaLanguages.Add(area); areaLanguages.AddRange(area.Languages); var languageMenu = new List<Tuple<string, string, string>>(); var cultureMap = GetAreaCultureMap(); foreach(var languageAreaId in cultureMap.Keys.OrderBy(k => k)) { var culture = cultureMap[languageAreaId]; var name = culture.NativeName; try { name = (culture.IsNeutralCulture) ? culture.NativeName : culture.Parent.NativeName; } catch{} name = culture.TextInfo.ToTitleCase(name); var flag = areaLanguages.First(a => a.ID == languageAreaId).Flag32x32; string link; var langPage = GetPageForCulture(Pageview.ID, culture.Name); if (langPage != null) { link = "/Default.aspx?ID=" + langPage.ID; } else { var firstPageId = Dynamicweb.Frontend.Area.GetAreaById(languageAreaId).get_Value("areafirstactivepage"); link = "/Default.aspx?ID=" + firstPageId; } if(Dynamicweb.Content.Area.GetAreaById(languageAreaId).IsMaster) { link += "?explicitLanguage=1"; } languageMenu.Add(new Tuple<string, string, string>(name, link, flag)); } @*var latinAlphabet = languageMenu.Where(x => Regex.IsMatch(x.Item1, @"^[\p{L}]+$")).OrderBy(x => x.Item1).ToList(); var noneLatinAlphabet = languageMenu.Where(x => !Regex.IsMatch(x.Item1, @"^[a-zA-Z]+$")).OrderBy(x => x.Item1).ToList(); latinAlphabet.AddRange(noneLatinAlphabet); languageMenu = latinAlphabet; @*var languageName = languageMenu.Select(x => x.Item1).ToList(); languageMenu = Heyday.Nissens.Helpers.HelperFunction.OrderByLatinAlphabet(languageName);*@ languageMenu = languageMenu.OrderBy(x => x.Item1).ToList(); var websiteItem = Dynamicweb.Content.Items.ItemManager.Storage.GetById(area.ItemType,area.ItemId); } @if (!IsSecret()) { <header id="top"> <nav id="top-nav"> <div class="container"> @{ var headerLogoImage = websiteItem["HeaderLogoImage"].ToString(); var frontpageUrl = "/Default.aspx?ID=" + firstAreaPage; } <a class="logo" href="@frontpageUrl" style="background-image:url(@System.Web.HttpUtility.UrlPathEncode(headerLogoImage))"> <span class="company-name">Nissens</span> </a> <ul id="primary-nav"> @{ if (navPages.FirstOrDefault(n => n.ItemType == "Automotive") != null) { string markedClassName = "on"; string currentPageStyle = null; var automotive = navPages.FirstOrDefault(n => n.ItemType == "Automotive"); if (page.ID == automotive.ID || page.ParentPageID == automotive.ID) { currentPageStyle = markedClassName; } <li> <a class="toggle-megadropdown @currentPageStyle" data-dropdown-id="#megadropdown-01" href="#">@automotive.MenuText</a> </li> } foreach (var rootPage in navPages) { string currentPageStyle = null; string markedClassName = "on"; if(rootPage.ItemType == "PowerGeneration") { if (page.ID == rootPage.ID || page.ParentPageID == rootPage.ID) { currentPageStyle = markedClassName; } <li> <a class="toggle-megadropdown @currentPageStyle" data-dropdown-id="#megadropdown-02" href="#">@rootPage.MenuText</a> </li> } if(rootPage.ItemType == "OnAndOffroad") { if (page.ID == rootPage.ID || page.ParentPageID == rootPage.ID) { currentPageStyle = markedClassName; } <li> <a class="toggle-megadropdown @currentPageStyle" data-dropdown-id="#megadropdown-03" href="#">@rootPage.MenuText</a> </li> } if(rootPage.ItemType == "AboutNissens") { /*if (page.ID == rootPage.ID || page.ParentPageID == rootPage.ID) { currentPageStyle = markedClassName; }*/ contactUsDefaultLink = rootPage.ID.ToString(); <li> <!--a class="@currentPageStyle" href="/Default.aspx?ID=@rootPage.ID">@rootPage.MenuText</a--> <a class="toggle-megadropdown @currentPageStyle" data-dropdown-id="#megadropdown-04" href="#">@rootPage.MenuText</a> </li> } if(rootPage.ItemType == "ContactMenuItem") { if (page.ID == rootPage.ID || page.ParentPageID == rootPage.ID) { currentPageStyle = markedClassName; } <li> <a class="toggle-megadropdown @currentPageStyle" data-dropdown-id="#megadropdown-05" href="#">@rootPage.MenuText</a> </li> } } } </ul> <div id="search-nav"> <button type="button" class="toggle-megadropdown" data-dropdown-id="#megadropdown-search"> <span class="icon-search"></span> </button> </div> <div id="language-nav"> <button type="button" class="toggle-megadropdown" data-dropdown-id="#megadropdown-language"> <span class="flag"><img src="@currentFlag" alt=""></span> </button> </div> <button type="button" class="burger-btn"> <span></span> <span></span> <span></span> <span></span> </button> </div> </nav> <nav id="megadropdown-nav" class="hidden-print"> <div class="content"> <!--mobile-megadropdown-nav #1 start...--> <div id="mobile-megadropdown-nav"> <div class="language-nav"> <button type="button" class="toggle-megadropdown" data-dropdown-id="#megadropdown-language"> <span class="country"> <!--DEV NOTE: add the active site language below--> <span class="flag"><img src="@currentFlag" alt=""></span> <span class="name">@twoLetterName</span> </span> <span class="icon-arrow-down"></span> </button> </div> <div class="primary-nav"> <ul> @{ foreach (var rootPage in navPages) { if(rootPage.ItemType == "Automotive") { <li> <a class="toggle-megadropdown" data-dropdown-id="#megadropdown-01" href="#">@rootPage.MenuText</a> </li> } if(rootPage.ItemType == "PowerGeneration") { <li> <a class="toggle-megadropdown" data-dropdown-id="#megadropdown-02" href="#">@rootPage.MenuText</a> </li> } if(rootPage.ItemType == "OnAndOffroad") { <li> <a class="toggle-megadropdown" data-dropdown-id="#megadropdown-03" href="#">@rootPage.MenuText</a> </li> } if(rootPage.ItemType == "AboutNissens") { <li> <!--a href="/Default.aspx?ID=@rootPage.ID">@rootPage.MenuText</a--> <a class="toggle-megadropdown" data-dropdown-id="#megadropdown-04" href="#">@rootPage.MenuText</a> </li> } if(rootPage.ItemType == "ContactMenuItem") { <li> <a class="toggle-megadropdown" data-dropdown-id="#megadropdown-05" href="#">@rootPage.MenuText</a> </li> } } } </ul> </div> </div> <!--...mobile-megadropdown-nav #1 end--> <!--Variables used on megadropdown --> @{ var links = new Dictionary<string, string[]>(); var contactUsLink = ""; var contactUsName = ""; } <!--megadropdown #1 start...--> @{ Dictionary<string, List<Tuple<string, string, string>>> productOverview = new Dictionary<string, List<Tuple<string, string, string>>>(); @*Dictionary<string, string[]> links = new Dictionary<string, string[]>();*@ var backgroundImage = new string[3]; var rootPageID = 0; contactUsLink = string.Empty; contactUsName = string.Empty; var repo = ItemManager.Storage.Open("ProductGroup"); var groupingItems = repo.SelectByAreaId(Pageview.AreaID); foreach (var rootPage in navPages) { if(rootPage.ItemType == "Automotive") { var rootItem = ItemManager.Storage.GetById(rootPage.ItemType, rootPage.ItemId); var chosenColor = (rootItem["TextColorInHex"] as string) ?? string.Empty; var chosenHover = (rootItem["HoverColorInHex"] as string) ?? string.Empty; if(!string.IsNullOrWhiteSpace(chosenColor)) { color = chosenColor.StartsWith("#") ? chosenColor : "#" + chosenColor; } if(!string.IsNullOrWhiteSpace(chosenHover)) { hoverColor = chosenHover.StartsWith("#") ? chosenHover : "#" + chosenHover; } for (var i = 1; i <= 4; i++) { var link = rootItem["Link_" + i] as string; var linkName = rootItem["Link_" + i + "Name"] as string; var linkImage = rootItem["Link" + i + "Image"] as string; var linkTarget = rootItem["Link_" + i + "_OpenInNewWindow"]; var OpenInNewWindow = ""; if(linkTarget.ToString().ToLower() == "true") { OpenInNewWindow = "_blank"; } if (!string.IsNullOrEmpty(link)) { links.Add(i.ToString(), new[] {link, linkName, linkImage, OpenInNewWindow}); } } contactUsLink = (rootItem["ContactUsLink"] as string) ?? "/Default.aspx?ID=" + contactUsDefaultLink; contactUsName = (rootItem["ContactUs"] as string) ?? contactUsDefaultName; for (var i = 1; i <= 3; i++) { var backgroundImageItem = (rootItem["BackgroundImage" + i] as string) ?? string.Empty; backgroundImage[i - 1] = backgroundImageItem; } var pages = rootPage.Subpages; foreach(var subPage in pages) { if(subPage.ItemType == "ProductPage") { rootPageID = rootPage.ID; var id = subPage.ID; var name = subPage.MenuText; var link = "/Default.aspx?ID=" + id; var productCategory = ItemManager.Storage.GetById(subPage.ItemType, subPage.ItemId); string image = productCategory["Image"] as string; string groupingOb = (productCategory["Grouping"] as string) ?? string.Empty; var grouping = groupingItems.FirstOrDefault(g => g["Name"].ToString() == groupingOb); if (grouping != null) { var group = grouping["Label"].ToString(); if(!productOverview.ContainsKey(group)) { productOverview.Add(group, new List<Tuple<string, string, string>>()); } productOverview[group].Add(new Tuple<string, string, string>(name, link, image)); } } } } } } <div id="megadropdown-01" class="is-mega-dropdown"> <div class="container"> <div class="megadropdown-row automotive"> @{int j = 0;} @foreach(var dicti in productOverview) { <div class="megadropdown-col col-sm-4 col-xs-12" style="color: @color !important; background-image: url(@System.Web.HttpUtility.UrlPathEncode(backgroundImage[j]));"> <h3>@dicti.Key <button type="button"></button> </h3> <ul> @foreach(var item in dicti.Value) { <li> <a onmouseover='this.style.color="@hoverColor"' onmouseout='this.style.color="@color"' href="@item.Item2">@item.Item1</a> </li> } </ul> </div> j++; } @{ var backgroundImageLink = websiteItem["BackgroundImage"] as string; var backgroundImageLink1 = websiteItem["NavItem_5_Background_Image"] as string; } </div> <div class="megadropdown-row buttons"> @foreach(var link in links.Values){ <div class="col-one-fifth"> <a href="@link[0]" class="md-btn alt" style="background-image: url(@System.Web.HttpUtility.UrlPathEncode(link[2]));" target="@link[3]"> <span>@link[1]<span class="icon-arrow-line-right">@link[0]</span></span> </a> </div> } <div class="col-one-fifth col-five-fifth-xs"> <!-- <a href="@contactUsLink" class="md-btn contact-us"><span>@contactUsName<span class="icon-arrow-line-right"></span></span></a> --> <div class="md-btn contact-us"> <a href="http://webshop.nissens.com/" class="contact-item" target="_blank">@Translate("NissensWebshopNavigation","Product Catalogue & Webshop") <span class="icon-arrow-line-right"></span> </a> <a href="@contactUsLink" class="contact-item">@contactUsName <span class="icon-arrow-line-right"></span> </a> </div> </div> </div> </div> </div> <!--//megadropdown #1 end--> <!--megadropdown #2 start...--> <div id="megadropdown-02" class="is-mega-dropdown"> <div class="container"> <div class="megadropdown-row categories"> @{ links = new Dictionary<string, string[]>(); foreach (var rootPage in navPages) { if(rootPage.ItemType == "PowerGeneration") { var rootItem = ItemManager.Storage.GetById(rootPage.ItemType, rootPage.ItemId); for (var i = 1; i <= 4; i++) { var link = (rootItem["Link_" + i] as string) ?? string.Empty; var linkName = (rootItem["Link_" + i + "Name"] as string) ?? string.Empty; var linkImage = (rootItem["Link" + i + "Image"] as string) ?? string.Empty; var linkTarget = (rootItem["Link_" + i + "_OpenInNewWindow"]) ?? string.Empty; var OpenInNewWindow = ""; if(linkTarget.ToString().ToLower() == "true") { OpenInNewWindow = "_blank"; } if (!string.IsNullOrEmpty(link)) { links.Add(i.ToString(), new[] {link, linkName, linkImage, OpenInNewWindow}); } } contactUsLink = (rootItem["ContactUsLink"] as string) ?? "/Default.aspx?ID=" + contactUsDefaultLink; contactUsName = (rootItem["ContactUs"] as string) ?? contactUsDefaultName; var pages = rootPage.Subpages; foreach(var subPage in pages.OrderBy(p => p.Sort)) { if(subPage.ItemType == "MenuItem") { var id = subPage.ID; var name = subPage.MenuText; var link = "/Default.aspx?ID=" + id; var menuItem = ItemManager.Storage.GetById(subPage.ItemType, subPage.ItemId); string image = menuItem["Image"] as string; <div class="col-sm-4 col-xs-6"> <a href="@link" class="category-menu-btn"> <span class="h3">@name</span> <div class="image"> <img src="@image" alt=""> </div> </a> </div> } } } } } </div> <div class="megadropdown-row buttons"> @foreach(var link in links.Values){ <div class="col-one-fifth"> <a href="@link[0]" class="md-btn alt" style="background-image: url(@System.Web.HttpUtility.UrlPathEncode(link[2]));" target="@link[3]"> <span>@link[1]<span class="icon-arrow-line-right">@link[0]</span></span> </a> </div> } <div class="col-one-fifth col-five-fifth-xs"> <a href="@contactUsLink" class="md-btn contact-us"><span>@contactUsName<span class="icon-arrow-line-right"></span></span></a> </div> </div> </div> </div> <!--//megadropdown #2 end--> <!--megadropdown #3 start...--> <div id="megadropdown-03" class="is-mega-dropdown"> <div class="container"> <div class="megadropdown-row categories"> @{ links = new Dictionary<string, string[]>(); foreach (var rootPage in navPages) { if(rootPage.ItemType == "OnAndOffroad") { var rootItem = ItemManager.Storage.GetById(rootPage.ItemType, rootPage.ItemId); for (var i = 1; i <= 4; i++) { var link = (rootItem["Link_" + i] as string) ?? string.Empty; var linkName = (rootItem["Link_" + i + "Name"] as string) ?? string.Empty; var linkImage = (rootItem["Link" + i + "Image"] as string) ?? string.Empty; var linkTarget = (rootItem["Link_" + i + "_OpenInNewWindow"]) ?? string.Empty; var OpenInNewWindow = ""; if(linkTarget.ToString().ToLower() == "true") { OpenInNewWindow = "_blank"; } if (!string.IsNullOrEmpty(link)) { links.Add(i.ToString(), new[] {link, linkName, linkImage, OpenInNewWindow}); } } contactUsLink = (rootItem["ContactUsLink"] as string) ?? "/Default.aspx?ID=" + contactUsDefaultLink; contactUsName = (rootItem["ContactUs"] as string) ?? contactUsDefaultName; var pages = rootPage.Subpages; foreach(var subPage in pages.OrderBy(p => p.Sort)) { if(subPage.ItemType == "MenuItem") { var id = subPage.ID; var name = subPage.MenuText; var link = "/Default.aspx?ID=" + id; var productCategory = ItemManager.Storage.GetById(subPage.ItemType, subPage.ItemId); string image = productCategory["Image"] as string; <div class="col-one-fourth"> <a href="@link" class="category-menu-btn"> <span class="h3">@name</span> <div class="image"> <img src="@image" alt=""> </div> </a> </div> } } } } } </div> <div class="megadropdown-row buttons"> @foreach(var link in links.Values) { <div class="col-one-fifth"> <a href="@link[0]" class="md-btn alt" style="background-image: url(@System.Web.HttpUtility.UrlPathEncode(link[2]));" target="@link[3]"> <span>@link[1]<span class="icon-arrow-line-right">@link[0]</span></span> </a> </div> } <div class="col-one-fifth col-five-fifth-xs"> <a href="@contactUsLink" class="md-btn contact-us"><span>@contactUsName<span class="icon-arrow-line-right"></span></span></a> </div> </div> </div> </div> <!--//megadropdown #3 end--> <!--megadropdown #4 start...--> <div id="megadropdown-04" class="is-mega-dropdown"> <div class="container"> <div class="megadropdown-row categories"> @{ links = new Dictionary<string, string[]>(); foreach (var rootPage in navPages) { if(rootPage.ItemType == "AboutNissens") { var rootItem = ItemManager.Storage.GetById(rootPage.ItemType, rootPage.ItemId); for (var i = 1; i <= 4; i++) { var link = (rootItem["Link_" + i] as string) ?? string.Empty; var linkName = (rootItem["Link_" + i + "Name"] as string) ?? string.Empty; var linkImage = (rootItem["Link" + i + "Image"] as string) ?? string.Empty; var linkTarget = (rootItem["Link_" + i + "_OpenInNewWindow"]) ?? string.Empty; var OpenInNewWindow = ""; if(linkTarget.ToString().ToLower() == "true") { OpenInNewWindow = "_blank"; } if (!string.IsNullOrEmpty(link)) { links.Add(i.ToString(), new[] {link, linkName, linkImage, OpenInNewWindow}); } } contactUsLink = (rootItem["ContactUsLink"] as string) ?? "/Default.aspx?ID=" + contactUsDefaultLink; contactUsName = (rootItem["ContactUs"] as string) ?? contactUsDefaultName; var pages = rootPage.Subpages; foreach(var subPage in pages.OrderBy(p => p.Sort)) { if(subPage.ItemType == "MenuItem") { var id = subPage.ID; var name = subPage.MenuText; var link = "/Default.aspx?ID=" + id; var productCategory = ItemManager.Storage.GetById(subPage.ItemType, subPage.ItemId); string image = productCategory["Image"] as string; <div class="col-sm-4 col-xs-6"> <a href="@link" class="category-menu-btn"> <span class="h3">@name</span> <div class="image"> <img src="@image" alt=""> </div> </a> </div> } } } } } </div> </div> </div> <!--//megadropdown #4 end--> <!--megadropdown #5 start...--> <div id="megadropdown-05" class="is-mega-dropdown"> <div class="container"> <div class="megadropdown-row categories"> @{ links = new Dictionary<string, string[]>(); foreach (var rootPage in navPages) { if(rootPage.ItemType == "ContactMenuItem") { var pages = rootPage.Subpages; foreach(var subPage in pages.OrderBy(p => p.Sort)) { if(subPage.ItemType == "MenuItem") { var id = subPage.ID; var name = subPage.MenuText; var link = "/Default.aspx?ID=" + id; var productCategory = ItemManager.Storage.GetById(subPage.ItemType, subPage.ItemId); string image = productCategory["Image"] as string; <div class="col-sm-4 col-xs-6"> <a href="@link" class="category-menu-btn"> <span class="h3">@name</span> <div class="image"> <img src="@image" alt=""> </div> </a> </div> } /*<div class="col-one-fifth"> <a href="@link" class="category-menu-btn"> <span class="h3">@name</span> <div class="image"> <img src="@image" alt=""> </div> </a> </div>*/ } } } } </div> </div> </div> <!--//megadropdown #5 end--> <!--#megadropdown-search start...--> <div id="megadropdown-search" class="is-mega-dropdown"> <div class="container"> @{ var searchPageId = websiteItem["SearchResultPage"].ToString().Split('=').Last(); var searchCulture = Pageview.Area.get_Value("areaculture").ToString(); var searchPageLocal = GetPageForCulture(Dynamicweb.Base.ChkInteger(searchPageId), searchCulture); if (searchPageLocal == null) { searchPageLocal = Pageview.Page; } var placeholderText = Translate("SearchPlaceholder", "What are you looking for?"); } <form action="/Default.aspx"> <input type="hidden" value="@searchPageLocal.ID" name="ID"> <input type="hidden" value="@Pageview.AreaID" name="Context"> <input type="text" name="freetext" class="search" role="search" placeholder="@placeholderText" aria-label="Search"> <button type="submit"><span class="icon-arrow-line-right"></span></button> </form> </div> </div> <!--//#megadropdown-search end--> <!--#megadropdown-language start...--> <div id="megadropdown-language" class="is-mega-dropdown"> <div class="container"> <ul> @{ foreach (var lang in languageMenu) { var activeFlag = (currentFlag == lang.Item3) ? "on" : ""; <li class="@activeFlag"> <a href="@lang.Item2" class="country"> <span class="flag"><img src="@lang.Item3" alt=""></span> <span class="name">@lang.Item1</span> </a> </li> } } </ul> </div> </div> <!--//#megadropdown-language end--> </div> </nav> <!--#secondary-nav start...--> <nav id="secondary-nav"> <ul> @foreach(var paragraph in Paragraph.GetParagraphsByPageID(page.ID)) { if (paragraph.ItemType != "Paragraph_Menu_Item" || !paragraph.ShowParagraph) { continue; } <li> <a href="/Default.aspx?ID=@page.ID/#@paragraph.ID">@paragraph.Header</a> </li> } </ul> </nav> </header> } @using System.Web; @using Dynamicweb @{ var longCookie = HttpContext.Current.Request.Cookies["Heyday.NissensLanguagePicker"]; var hasExplicitLanguage = (HttpContext.Current.Request.Cookies["Heyday.LanguageDetected"] != null) ? true : HttpContext.Current.Request.Url.Query.Contains("explicitLanguage"); var areaIsMaster = Dynamicweb.Content.Area.GetAreaById(Pageview.AreaID).IsMaster; } @if(areaIsMaster && longCookie == null && !hasExplicitLanguage) { var cultureMaps = GetAreaCultureMap(); var languagesMenu = new List<Tuple<string, string, string>>(); foreach(var languageAreaId in cultureMaps.Keys.OrderBy(k => k)) { var languageArea = Dynamicweb.Frontend.Area.GetAreaById(languageAreaId); var culture = cultureMaps[languageAreaId]; var name = culture.NativeName; try { name = (culture.IsNeutralCulture) ? culture.NativeName : culture.Parent.NativeName; } catch{} //Setting TitleCase on the name string name = culture.TextInfo.ToTitleCase(name); var flag = areaLanguages.First(a => a.ID == languageAreaId).Flag32x32; string link; var langPage = GetPageForCulture(Pageview.ID, culture.Name); if (langPage != null) { link = "/Default.aspx?ID=" + langPage.ID; } else { var firstPageId = Dynamicweb.Frontend.Area.GetAreaById(languageAreaId).get_Value("areafirstactivepage"); link = "/Default.aspx?ID=" + firstPageId; } languagesMenu.Add(new Tuple<string, string, string>(name, link, flag)); } <div class="language-picker"> <div class="language-picker__content"> <div class="language-picker__inner-content"> <div class="language-picker__content-list"> @foreach(var language in languagesMenu.OrderBy(x => x.Item1).ToList()) { var flag = language.Item3; if (string.IsNullOrEmpty(flag)) { continue; } var lastIndexOf = flag.LastIndexOf('/'); if (lastIndexOf <= 0) { continue; } HttpContext.Current.Session["Heyday.LanguageDetected"] = true; <div class="language-picker__item"> <a href="#" data-href="@language.Item2"><img src="@flag" alt="@flag.Substring(lastIndexOf, flag.Length - lastIndexOf)">@language.Item1</a> </div> } </div> </div> </div> </div> } <main> <!--Module product...--> <section class="module-product"> <div class="hd-container"> <div class="row product-info"> <div class="col-sm-6"> <div class="module-gallery" data-show-items="1"> @{ var imageUrl = @GetString("Item.Image.Value"); } <div class="product-image"> <img class="lazyOwl" data-src="@imageUrl" alt=""> </div> </div> </div> <div class="col-sm-6"> <div class="module-text" data-read-more="false" data-read-more-text="More..." data-read-less-text="Close"> <!--NOTE: data-read-more="true" should be added via backend, if needed--> <strong>@GetString("Item.ParagraphHeader.Value")</strong> @GetString("Item.Headline") @*<ol class="breadcrumb"> <li><a href="#">Home</a></li> <li><a href="#">Library</a></li> <li class="active">Data</li> </ol>*@ <div class="text-block"> @GetString("Item.Text") </div> </div> </div> </div> <div class="row product-further-info"> <div class="col-sm-12"> @{ if (GetLoop("Item.GridOverview1").Any()) { var grid1 = GetLoop("Item.GridOverview1") .Select(l => Dynamicweb.Content.Items.ItemManager.Storage.GetById(l.GetString("Item.GridOverview1.SystemName"), l.GetString("Item.GridOverview1.Id"))); <div class="row title"> <div class="col-sm-12"> <h2 style="text-align: center"> <strong>@Translate("Gridoverview1", "Gridoverview1")</strong> </h2> </div> </div> @renderGridOverview(grid1, GetString("Item.NumberOfColumns1"), false) } if (GetLoop("Item.GridOverview2").Any()) { var grid2 = GetLoop("Item.GridOverview2") .Select(l => Dynamicweb.Content.Items.ItemManager.Storage.GetById(l.GetString("Item.GridOverview2.SystemName"), l.GetString("Item.GridOverview2.Id"))); <div class="row title"> <div class="col-sm-12"> <h2 style="text-align: center"> <strong>@Translate("Gridoverview2", "Gridoverview2")</strong> </h2> </div> </div> @renderGridOverview(grid2, GetString("Item.NumberOfColumns2"), false) } } @if (!string.IsNullOrWhiteSpace(@GetString("Item.TechnicalDetails.Value"))) { <div class="accordion"> <h4>@Translate("TechnicalDetailsOne", "Technical Details")</h4> <div class="txt"> <div class="inner-txt"> @GetString("Item.TechnicalDetails.Value") </div> </div> </div> } @{ // Children of the node var downloadItems = Dynamicweb.Content.Items.ItemManager.Storage.GetByParentPageId("Download", Pageview.ID).ToList(); // List of downloads defined on the page itself (page of "productCategory" itemtype) int donwloadLinksListId = GetInteger("Item.DownloadLinks.Value"); var downloadLinksEntries = Dynamicweb.Content.Items.ItemList.GetItemListById(donwloadLinksListId).Relations; var downloadLinks = downloadLinksEntries.Select(x => x as Dynamicweb.Content.Items.Item).ToList(); } @if (downloadItems.Any() || downloadLinks.Any()) { <div class="accordion"> <h4>@Translate("Download", "Download")</h4> <div class="txt greyColor"> <div class="inner-txt"> <ul> @if (downloadLinks.Any()) { foreach (var downloadLink in downloadLinks) { object name = string.Empty; object link = string.Empty; object image = string.Empty; object language = string.Empty; object openInNewTab = string.Empty; downloadLink.TryGetValue("Name", ref name); downloadLink.TryGetValue("Link", ref link); downloadLink.TryGetValue("Image", ref image); downloadLink.TryGetValue("Language", ref language); downloadLink.TryGetValue("OpenLinkInNewTab", ref openInNewTab); if (string.IsNullOrEmpty(link.ToString())) { link = "javascript:void(0);"; } string target = "_self"; if ((bool)openInNewTab) { target = "_blank"; } <li> <a href="@link" target="@(target)" class="download-item"> <div class="img"> <img data-src="@image" src="/Files/Templates/Designs/Nissens-website/images/blank.png" alt=""> </div> <div class="txt"> <p> @name <span class="language">@language</span> </p> </div> </a> </li> } } @foreach (var item in downloadItems) { object image = string.Empty; object name = string.Empty; object file = string.Empty; object language = string.Empty; item.TryGetValue("Image", ref image); item.TryGetValue("Name", ref name); item.TryGetValue("File", ref file); item.TryGetValue("Language", ref language); if (string.IsNullOrEmpty(file.ToString())) { file = "javascript:void(0);"; } <li> <a href="@file" class="download-item"> <div class="img"> <img data-src="@image" src="/Files/Templates/Designs/Nissens-website/images/blank.png" alt=""> </div> <div class="txt"> <p> @name <span class="language">@language</span> </p> </div> </a> </li> } </ul> </div> </div> </div> } </div> </div> </div> </section> <!--3D banner...--> @if (!string.IsNullOrWhiteSpace(GetString("Item.AnimationsItem"))) { <section class="module-3d-banner"> <img src="/Files/Templates/Designs/Nissens_website/Files/Templates/Designs/Nissens-website/images/banner-3d-reliability-performance-b.png" alt=""> </section> } <!--Hero banner...--> @if (!string.IsNullOrWhiteSpace(GetString("Item.ProductBenefits"))) { <section class="module-hero-banner" data-text-align="Center" data-size="Medium"> @{ imageUrl = @GetString("Item.ProductBenefits.Image.Value"); } <div class="col"> <div class="txt"> @GetString("Item.ProductBenefits.Headline.Value") @GetString("Item.ProductBenefits.Text.Value") <img src="@imageUrl" alt=""> </div> </div> </section> } <!--Text (Title + 1 col text)...--> @if (!string.IsNullOrWhiteSpace(GetString("Item.VideoLink"))) { <section class="section-grid bottom-line-white-gray" style="background-color: #e3e7ea;"> <!--+ left top--> <span class="plus-bg-left-top"></span> <div class="hd-container"> <div class="row"> <div class="col-sm-12"> <!--Module video (NOTE: .show-in-overlay should be added via backend)...--> @{ var videoUrl = @GetString("Item.VideoLink.VideoLink.Value"); var videoImage = videoUrl.Contains("youku") ? @GetString("Item.VideoLink.Image.Value") : ""; } <div class="module-video"> <div class="video-container"> <div class="video-player"></div> <a class="video-overlay" href="@videoUrl" style="background-image:url('@videoImage');"> <div> <span class="play-btn"><span class="icon-arrow-right"></span></span> <div class="title"> @GetString("Item.VideoLink.Headline.Value") <!-- <p class="duration">Duration @GetString("Item.VideoLink.Duration.Value")</p> --> </div> </div> </a> </div> </div> <!--//Module video--> </div> </div> </div> </section> if (videoUrl.Contains("youku")) { <script type="text/javascript" src="//player.youku.com/jsapi"></script> } } <!--Related Products - Spotboxes...--> @if (!string.IsNullOrWhiteSpace(GetString("Item.RelatedItems"))) { <section class="module-spotboxes"> <div class="hd-container"> <div class="row"> <div class="col-xs-12"> <h3>@Translate("RelatedProducts", "Related Products")</h3> </div> </div> <div class="row"> @foreach (var related in GetLoop("Item.RelatedItems")) { imageUrl = @related.GetString("Item.RelatedItems.Image.Value"); var linkUrl = @related.GetString("Item.RelatedItems.Url"); var teaserText = related.GetString("Item.RelatedItems.Text.Value"); teaserText = StripHTML(teaserText); <div class="col-xs-4"> <div class="module-spot related-product"> <a class="spot-image-container" href="@linkUrl"> <img src="@imageUrl" alt=""> </a> <div class="spot-text-container"> <a href="@linkUrl" class="hd-btn secondary inverted">@related.GetString("Item.RelatedItems.PageName")</a> <p>@Dynamicweb.Base.TeaserString(teaserText, 100, "...")</p> </div> </div> </div> } </div> </div> </section> } <!--Hero banner...--> @if (!string.IsNullOrWhiteSpace(GetString("Item.Banner"))) { imageUrl = @GetString("Item.Banner.Image.Value"); var linkUrl = @GetString("Item.Banner.Link.Value"); <section class="module-hero-banner bottom-line-white-blue" data-text-align="Center" data-size="Medium" style="color: white;"> <!--+ left top--> <span class="plus-bg-left-top"></span> <div class="col" style="background-image:url(@imageUrl);"> <div class="txt"> @GetString("Item.Banner.Headline.Value") @GetString("Item.Banner.Text.Value") <a href="@linkUrl" class="hd-btn">@GetString("Item.Banner.LinkText.Value")</a> </div> </div> </section> } </main> <!-- Start of HubSpot Embed Code --> <script type="text/javascript" id="hs-script-loader" async="" defer="" src="//js.hs-scripts.com/4486890.js"></script> <!-- End of HubSpot Embed Code --> <div id="fullpage-overlay"> <div class="content"> <iframe id='fullpage-player' src="about:blank"></iframe> <button id="close-fullpage-overlay" class="close-btn" type="button"><span class="icon-close"></span></button> </div> </div> @{ var areaMainPages = ((System.Collections.ArrayList)Pageview.Area.get_Value("AreaMainPages")).Cast<int>().Select(pid => Dynamicweb.Content.Page.GetPageById(pid)); } @if (!IsSecret()) { <footer id="bottom" class="hidden-print"> <div class="social-bar"> <a href="https://www.facebook.com/nissensautomotive/" target="_blank" title="Facebook" class="social-icon"> <span class="icon-facebook">Facebook</span> </a> @*Hide YouTube if site lang is chinese*@ @if (GetGlobalValue("Global:Area.LongLang") != "zh-CN") { <a href="https://www.youtube.com/user/NissensAS" target="_blank" title="YouTube" class="social-icon"> <span class="icon-youtube">Youtube</span> </a> } <a href="https://www.linkedin.com/company/20196" target="_blank" title="LinkedIn" class="social-icon"> <span class="icon-linkedin">LinkedIn</span> </a> </div> <div class="bg"></div> <div class="footer-container"> <div class="row"> <div> <a class="logo-white" href="/"> @{ @*var footerImage = @GetString("Item.Area.FooterImage.Value");*@ var footerImage = websiteItem["FooterImage"]; } <img src="@footerImage" alt=""> </a> </div> @{ var currentRegion = new System.Globalization.RegionInfo(GetAreaCultureMap()[Pageview.AreaID].LCID); var aboutPage = areaMainPages.FirstOrDefault(p => p.ItemType == "AboutNissens"); var divisions = Dynamicweb.Content.Items.ItemManager.Storage.GetByParentPageId("Department", aboutPage.ID); Dynamicweb.Content.Items.Item regionalDivision = null; foreach (var item in divisions) { var country = item["Country"] as string; if (!string.IsNullOrEmpty(country) && country == currentRegion.Name) { regionalDivision = item; break; } } if (regionalDivision == null) { regionalDivision = divisions.FirstOrDefault(); } if (regionalDivision != null) { var name = regionalDivision["Name"].ToString(); var address1 = regionalDivision["Address_1"].ToString(); var address2 = regionalDivision["Address_2"].ToString(); var zip = regionalDivision["ZipCode"].ToString(); var city = regionalDivision["City"].ToString(); var phone = regionalDivision["Phone"].ToString(); var phoneLink = "tel:" + phone; var fax = regionalDivision["Fax"].ToString(); var email = regionalDivision["Email"].ToString(); var emailLink = "mailto:" + email; var newLink = regionalDivision["Links"].ToString(); <div> <h4 class="company-name">@name</h4> <p> <span>@address1</span><br> @if (!string.IsNullOrEmpty(address2)) { <span>@address2</span><br> } @if (!string.IsNullOrEmpty(city)) { <span>@zip @city</span><br> } @if (!string.IsNullOrEmpty(phone)) { <span>Tel.: @phone</span><br> } @if (!string.IsNullOrEmpty(fax)) { <span>Fax: @fax</span><br> } @if (!string.IsNullOrEmpty(email)) { <span><a href="@emailLink">E-mail: @email</a></span> } </p> <div class="nissen-links"> @if (!string.IsNullOrEmpty(newLink)) { <span>@newLink</span> } </div> </div> <div style="margin-top:61px;"> @{ //Legal Disclaimer var disclaimerPage = areaMainPages.FirstOrDefault(p => p.ItemType == "LegalDisclaimer"); if (disclaimerPage != null) { var disclaimerItem = Dynamicweb.Content.Items.ItemManager.Storage.GetById(disclaimerPage.ItemType, disclaimerPage.ItemId); if (disclaimerItem != null) { <p class="LegalDisclaimer" style="margin: 0;"> <a href="/Default.aspx?ID=@disclaimerPage.ID" class="hd-btn tertiary">@disclaimerItem["FooterText"]</a> </p> } } //Term and Conditions var termsAndConditions = areaMainPages.FirstOrDefault(p => p.ItemType == "TermsAndConditions"); if (termsAndConditions != null) { var termsAndConditionsItem = Dynamicweb.Content.Items.ItemManager.Storage.GetById(termsAndConditions.ItemType, termsAndConditions.ItemId); if (termsAndConditionsItem != null) { var automotiveDownload = termsAndConditionsItem["TermsAndConditions_AutomotiveLink"]; if (automotiveDownload != null && !string.IsNullOrWhiteSpace(termsAndConditionsItem["TermsAndConditions_AutomotiveText"].ToString())) { <p class="LegalDisclaimer" style="margin: 0;"> <a href="@automotiveDownload" download="" class="hd-btn tertiary">@termsAndConditionsItem["TermsAndConditions_AutomotiveText"]</a> </p> } var coolingSolutionsDownload = termsAndConditionsItem["TermsAndConditions_Cooling_SolutionsLink"]; if (coolingSolutionsDownload != null && !string.IsNullOrWhiteSpace(termsAndConditionsItem["TermsAndConditions_Cooling_SolutionsText"].ToString())) { <p class="LegalDisclaimer" style="margin: 0;"> <a href="@coolingSolutionsDownload" download="" class="hd-btn tertiary">@termsAndConditionsItem["TermsAndConditions_Cooling_SolutionsText"]</a> </p> } } } //Data privacy policy var datapolicyPage = areaMainPages.FirstOrDefault(p => p.ItemType == "Data_Privacy_Policy"); if (datapolicyPage != null) { var datapolicyItem = Dynamicweb.Content.Items.ItemManager.Storage.GetById(datapolicyPage.ItemType, datapolicyPage.ItemId); if (datapolicyItem != null) { <p class="LegalDisclaimer" style="margin: 0;"> <a style="margin: 0; padding-bottom: 0;" href="/Default.aspx?ID=@datapolicyPage.ID" class="hd-btn tertiary">@datapolicyItem["FooterText"]</a> </p> <br> @datapolicyItem["ExtraField"]; } } } </div> } } <!--div> @foreach (var p in areaMainPages) { var rootPage = p; if(rootPage.ItemType == "AboutNissens") { <a href="/Default.aspx?ID=@p.ID"><h4>@rootPage.MenuText</h4></a> <ul> @foreach(var paragraph in Dynamicweb.Content.Paragraph.GetParagraphsByPageID(p.ID)) { //Husk lige ændre så der kommer et link ind <li><a href="/Default.aspx?ID=@p.ID/#@paragraph.ID">@paragraph.Header</a></li> } </ul> } } </div--> <div class="col-shop"> @* <a href="#" class="hd-btn newsletter" style="display: none;">Sign up for Newsletter</a> <h4>@Translate("Division","Division")</h4> <ul> @{ foreach (var p in areaMainPages) { var rootPage = p; if(rootPage.ItemType == "Automotive" || rootPage.ItemType == "PowerGeneration" || rootPage.ItemType == "OnAndOffroad") { <li> </li><li><a href="/Default.aspx?ID=@p.ID">@rootPage.MenuText</a></li> } } } </ul> *@ @{ var automotivePage = areaMainPages.FirstOrDefault(p => p.ItemType == "Automotive"); var automotivePageId = automotivePage != null ? automotivePage.ID : 0; if (Pageview.ID == automotivePageId || Dynamicweb.Content.Page.GetPageById(Pageview.ID).ParentPageID == automotivePageId) { <a href="http://webshop.nissens.com/" class="hd-btn tertiary">@Translate("NissensWebshopFooter", "Product Catalogue & Webshop")</a> } } </div> </div> </div> </footer> } @if(HttpContext.Current.Request.Cookies["NissensCookieDisclaimer"] == null) { var disclaimerPage = ((System.Collections.ArrayList)Pageview.Area.get_Value("AreaMainPages")).Cast<int>().Select(pid => Dynamicweb.Content.Page.GetPageById(pid)).FirstOrDefault(p => p.ItemType == "LegalDisclaimer"); <div id="cookieDisclaimer"> <div class="container"> <div class="row"> <div class="col-sm-8"> <p> @Translate("CookieDisclaimer", "We use cookies on this website. If you proceed on our website, you accept this.") @if (disclaimerPage != null) { <a style="text-decoration: underline;" href="/Default.aspx?ID=@disclaimerPage.ID">@Translate("CookieDisclaimerReadMoreLink", "You can read more about cookies here.")</a> } </p> </div> <div class="col-sm-4"> <button type="button" class="hd-btn primary-color ok">@Translate("CookieDisclaimerOKBtn", "OK")</button> </div> </div> </div> </div> } <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/jquery/jquery.min.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/polyfills/jquery.placeholder.min.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/polyfills/matchMedia.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/polyfills/matchMedia.addListener.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/polyfills/polyfills.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/enquire.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/gsap/TweenMax.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/gsap/ScrollMagic.min.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/gsap/animation.gsap.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/gsap/ScrollToPlugin.min.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/fastclick.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/lazy-loading-xt/jquery.lazyloadxt.min.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/owl-carousel/owl.carousel.min.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/lib/js.cookie.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/ground/ground.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/cookieDisclaimer.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/module/navigation/top.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/module/banner/hero.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/module/gallery/gallery.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/module/text/text.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/module/video/video.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/module/product/product.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/module/spot/spot.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/module/contact/contact.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/module/animation/animation.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/module/oilfinder/oilfinder.js?@cacheBust"></script> <script src="/Files/Templates/Designs/Nissens_website/./scripts/module/languagePicker/languagePicker.js?@cacheBust"></script> </body> </html>