Exception in template (Designs/Nissens-website/_parsed/index.parsed.cshtml): System.ArgumentNullException: Value cannot be null.
Parameter name: source
   at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
   at CompiledRazorTemplates.Dynamic.eeeafdedeaa.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 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; } } @using System.Web; @if (!IsSecret()) { var languageDetected = HttpContext.Current.Session["Heyday.LanguageDetected"]; if (languageDetected == null) { var request = HttpContext.Current.Request; var isDownloadPage = false; var masterAreaId = GetMasterAreaId(); var mitem = masterAreaId == 0 ? Pageview.Area.Item : Dynamicweb.Frontend.Area.GetAreaById(masterAreaId).Item; var formStringId = (mitem != null) ? (mitem["FormDownloadPage"] ?? string.Empty).ToString() : string.Empty; if(!string.IsNullOrEmpty(formStringId)) { var formId = formStringId.Split('=')[1]; var parameterId = request.QueryString["ID"]; isDownloadPage = formId == parameterId; } var languages = request.UserLanguages; if (languages.Any() && !isDownloadPage) { var userLanguage = languages.First(); userLanguage = userLanguage.Split(';').First(); var culturePage = GetCurrentPageForCulture(userLanguage); if (culturePage != null) { HttpContext.Current.Session["Heyday.LanguageDetected"] = true; HttpContext.Current.Response.Redirect("/Default.aspx?ID=" + culturePage.ID); } } } } @{ var cacheBust = "v=3"; } <head> <script> (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'); </script> <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"> <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="theme-color" content="#ffffff"> @GetValue("Stylesheets") @GetValue("Javascripts") </head> <body> @using Dynamicweb.Content; @using Dynamicweb.Content.Items; @using System; @using System.Collections; @using System.Collections.Generic; @using System.Globalization; @{ 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; } languageMenu.Add(new Tuple<string, string, string>(name, link, flag)); } 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"> @{ foreach (var rootPage in navPages) { string currentPageStyle = null; string markedClassName = "on"; if(rootPage.ItemType == "Automotive") { if (page.ID == rootPage.ID || page.ParentPageID == rootPage.ID) { currentPageStyle = markedClassName; } <li> <a class="toggle-megadropdown @currentPageStyle" data-dropdown-id="#megadropdown-01" href="#">@rootPage.MenuText</a> </li> } 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++; } <div class="megadropdown-col col-sm-4 col-xs-12" style="color: #FFF !important; background-image: url(Files/Images/Nissens/Website/Auto/webshopheader2.jpg);"> <h3>E-Commerce Solutions <button type="button"></button> </h3> <ul> <li> <a onmouseover="this.style.color=&quot;#02afef&quot;" onmouseout="this.style.color=&quot;#FFF&quot;" href="http://webshop.nissens.com/" target="_blank">@Translate("NissensWebshopNavigation","Product Catalogue & Webshop")</a> </li> </ul> </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 #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-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 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> } <main> <div id="content-block-01">@GetValue("DwContent(contentblock01)")</div> </main> <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.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; <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> @{ //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 style="margin: 0; padding-bottom: 0;" 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 download = @termsAndConditionsItem["LinkToFileToDownload"]; <p class="LegalDisclaimer"> <a href="@download" download="" class="hd-btn tertiary" style="text-align:left;">@termsAndConditionsItem["Text"]</a> </p> } } } </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> } <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/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/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> </body> </html>