Exception in template (Designs/Designa/_parsed/FinancingNew.parsed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.edfeafdfed.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, DynamicViewBag viewBag, String cacheName)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()
@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Content @using Dynamicweb @using Dynamicweb.Content @using Dynamicweb.Data @using System.Data @{ var dsStores = Database.CreateDataSet(string.Format("SELECT PageId, PageMenuText FROM Page WHERE PageItemType = 'Store' AND PageAreaId = {0} ORDER BY PageMenuText ASC", GetInteger("DwAreaID"))); var dsDKStoresWithoutFaroeIslands = Database.CreateDataSet("SELECT PageId, PageMenuText FROM Page WHERE PageItemType = 'Store' AND PageAreaId = 1 AND PageId != 166 AND PageId != 167 ORDER BY PageMenuText ASC"); var pageServiceFooter = new PageService(); var dsSettingsFooter = Database.CreateDataSet(string.Format("SELECT PageId, PageMenuText FROM Page WHERE PageItemType = 'Settings' AND PageAreaId = {0}", GetInteger("DwAreaID"))); Dynamicweb.Content.Page settingsNodeFooter = null; if (dsSettingsFooter != null && dsSettingsFooter.Tables.Count > 0 && dsSettingsFooter.Tables[0].Rows.Count > 0) { settingsNodeFooter = pageServiceFooter.GetPage(int.Parse(dsSettingsFooter.Tables[0].Rows[0]["PageId"].ToString())); } else { return; } object headerScripts = null; settingsNodeFooter.Item.TryGetValue("Header_Scripts", ref headerScripts); headerScripts = headerScripts != null && !string.IsNullOrWhiteSpace(headerScripts.ToString()) ? headerScripts.ToString() : string.Empty; object openingBodyScripts = null; settingsNodeFooter.Item.TryGetValue("Opening_Body_Scripts", ref openingBodyScripts); openingBodyScripts = openingBodyScripts != null && !string.IsNullOrWhiteSpace(openingBodyScripts.ToString()) ? openingBodyScripts.ToString() : string.Empty; } <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <!-- Mobile Web-app fullscreen --> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="mobile-web-app-capable" content="yes"> @if (System.Web.HttpContext.Current.Request.Url.ToString().Contains(".dw.") || System.Web.HttpContext.Current.Request.Url.ToString().Contains(".inet-design.")) { <meta name="robots" content="noindex, nofollow"> } <meta property="og:image:secure_url" content='@(System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + GetValue("Item.MetaImage"))'> <meta property="og:image" content='@(System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + GetValue("Item.MetaImage"))'> <!-- Meta tags --> <meta name="author" content=""> <link rel="icon" href="/Files/Templates/Designs/Designa/assets/images/favicon.ico"> <!--Title--> <title>@GetValue("Title")</title> @GetValue("MetaTags") @GetValue("CopyRightNotice") <!--CSS bundle --> <link rel="stylesheet" media="all" href="/Files/Templates/Designs/Designa/css/bootstrap.css"> <link rel="stylesheet" media="all" href="/Files/Templates/Designs/Designa/css/animate.css"> <link rel="stylesheet" media="all" href="/Files/Templates/Designs/Designa/css/fonts.css"> <link rel="stylesheet" media="all" href="/Files/Templates/Designs/Designa/css/owl.carousel.css"> <link rel="stylesheet" media="all" href="/Files/Templates/Designs/Designa/css/magnific-popup.css"> <link rel="stylesheet" media="all" href="/Files/Templates/Designs/Designa/css/theme.css?v=3.33"> <link rel="stylesheet" media="all" href="/Files/Templates/Designs/Designa/css/linear-icons.css"> <link rel="stylesheet" media="all" href="/Files/Templates/Designs/Designa/css/designa-icons.css"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <!--JS files--> <script src="/Files/Templates/Designs/Designa/js/jquery.min.js"></script> <script src="/Files/Templates/Designs/Designa/js/bootstrap.js"></script> <script src="/Files/Templates/Designs/Designa/js/owl.carousel.js"></script> <script src="/Files/Templates/Designs/Designa/js/grid.slider.js"></script> <script src="/Files/Templates/Designs/Designa/js/jquery.magnific-popup.js"></script> <script src="/Files/Templates/Designs/Designa/js/jquery.ui.js"></script> <script src="/Files/Templates/Designs/Designa/js/jquery.cookie.js"></script> <script src="/Files/Templates/Designs/Designa/js/bigtext.js"></script> <script src="/Files/Templates/Designs/Designa/js/jquery.wow.js"></script> <script src="/Files/Templates/Designs/Designa/js/iframeResizer.min.js"></script> <script src="/Files/Templates/Designs/Designa/js/main.js?v=2.3"></script> <script src="https://player.vimeo.com/api/player.js"></script> @RenderSnippet("StyleSheet") @RenderSnippet("JavaScript") @headerScripts.ToString() @GetValue("Stylesheets") @GetValue("Javascripts") </head> <body> @openingBodyScripts.ToString() <div class="wrapper"> @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Content @using Dynamicweb @using System @using Dynamicweb.Data @using System.Data @{ var searchPlaceholder1 = Translate("Search.Placeholder", "Søg..."); var dsSettings = Database.CreateDataSet(string.Format("SELECT PageId, PageMenuText FROM Page WHERE PageItemType = 'Settings' AND PageAreaId = {0}", GetInteger("DwAreaID"))); var pageServiceNavigation = new PageService(); Dynamicweb.Content.Page settingsNode = null; if (dsSettings != null && dsSettings.Tables.Count > 0 && dsSettings.Tables[0].Rows.Count > 0) { settingsNode = pageServiceNavigation.GetPage(int.Parse(dsSettings.Tables[0].Rows[0]["PageId"].ToString())); } else { return; } <!-- ==== Header ==== --> object logo = null; settingsNode.Item.TryGetValue("Logo", ref logo); logo = logo != null && !string.IsNullOrWhiteSpace(logo.ToString()) ? logo.ToString() : "/Files/Templates/Designs/Designa/assets/images/logo-header.svg"; object headerLinks = null; settingsNode.Item.TryGetValue("HeaderLinks", ref headerLinks); var dsHeaderLinks = Database.CreateDataSet(string.Format("SELECT * FROM ItemListRelation itr JOIN ItemType_Link it on it.Id = itr.ItemListRelationItemId WHERE ItemListRelationItemListId = {0} ORDER BY SORT", headerLinks)); object storesLink = null; settingsNode.Item.TryGetValue("StoresLink", ref storesLink); storesLink = storesLink != null && !string.IsNullOrWhiteSpace(storesLink.ToString()) ? storesLink.ToString() : string.Empty; string findButikLabel = Translate("Navigation.FindButik", "Find butik"); object bookingLink = null; settingsNode.Item.TryGetValue("BookAMeetingPage", ref bookingLink); bookingLink = bookingLink != null && !string.IsNullOrWhiteSpace(bookingLink.ToString()) ? bookingLink.ToString() : string.Empty; string bookingLinkLabel = Translate("Navigation.BookMeeting", "Book møde"); object measuringLink = null; settingsNode.Item.TryGetValue("FreeMeasuringPage", ref measuringLink); measuringLink = measuringLink != null && !string.IsNullOrWhiteSpace(measuringLink.ToString()) ? measuringLink.ToString() : string.Empty; string measuringLinkLabel = Translate("Navigation.FreeMeasuring", "Gratis opmåling"); object hideFreeMeasuringMenuItem = null; settingsNode.Item.TryGetValue("HideFreeMeasuringMenuItem", ref hideFreeMeasuringMenuItem); <!-- ==== Main menu ==== --> object mainMenuItems = null; settingsNode.Item.TryGetValue("MenuItems", ref mainMenuItems); var dsMainMenuItems = Database.CreateDataSet(string.Format("SELECT * FROM ItemListRelation itr JOIN ItemType_RecursiveLinks it on it.Id = itr.ItemListRelationItemId WHERE ItemListRelationItemListId = {0} AND Standalone = 0 ORDER BY SORT", mainMenuItems)); var dsStandaloneMenuItems = Database.CreateDataSet(string.Format("SELECT * FROM ItemListRelation itr JOIN ItemType_RecursiveLinks it on it.Id = itr.ItemListRelationItemId WHERE ItemListRelationItemListId = {0} AND Standalone = 1 ORDER BY SORT", mainMenuItems)); } <!-- ==================== Navigation ==================== --> <nav class="navigation sticky-top"> <div class="nav-overlay"></div> <div class="container no-padding-right"> <div class="d-flex align-items-center"> <div class="logo"> <a href="/"><img src="@logo" width="140" height="21" alt="Designa Logo"></a> </div> <div class="main-nav"> @if (dsHeaderLinks != null && dsHeaderLinks.Tables.Count > 0 && dsHeaderLinks.Tables[0].Rows.Count > 0) { <ul class="d-none d-lg-block"> @foreach (DataRow headerLinkRow in dsHeaderLinks.Tables[0].Rows) { var linkUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(headerLinkRow["Target"].ToString()); <li><a href="@linkUrl">@headerLinkRow["DisplayName"].ToString()</a></li> } </ul> } </div> <div class="top-nav flex-grow-1 text-right"> <ul class="icons-margin-bottom"> <li><a href="@storesLink" class="btn"><span class="dicon dicon-map-pin" data-title="@findButikLabel"></span> <span class="d-none d-xl-inline"><span class="butik-link">@findButikLabel</span></span></a></li> <li class="d-xl-none"><a href="@bookingLink" class="btn mobile-no-outline"><span class="dicon dicon-meeting" data-title="@bookingLinkLabel"></span> <span class="d-none d-xl-inline"><span>@bookingLinkLabel</span></span></a></li> <li class="d-none d-xl-inline"><a href="@bookingLink" class="btn btn-outline-dark mobile-no-outline"><span class="dicon dicon-meeting" data-title="@bookingLinkLabel"></span> <span class="d-none d-xl-inline"><span>@bookingLinkLabel</span></span></a></li> @if(hideFreeMeasuringMenuItem !=null && !(bool)hideFreeMeasuringMenuItem) { <li class="d-none d-xl-inline"><a href="@measuringLink" class="btn btn-outline-dark"><span class="dicon dicon-home" data-title="@measuringLinkLabel"></span> <span>@measuringLinkLabel</span></a></li> } <li class="search-trigger d-none d-xl-inline"><a href="javascript:void(0)" class="btn"><span class="dicon dicon-search"></span></a></li> <li class="menu-trigger"><a class="btn" style="padding-left: 5px;"><span class="dicon dicon-hamburger" data-title="Menu"></span></a></li> </ul> </div> <!-- === Dropdown navigation ===--> <div class="dropdown-nav"> <div class="dropdown-scroll"> <div class="logo"> <a href="/"><img src="@logo" width="140" height="21" alt="Designa Logo"></a> </div> <span class="close-menu"><i class="icon icon-cross"></i></span> <div class="mobile-search"> <div class="search-wrapper"> <div class="search"> <i class="search-icon search-icon-left dicon dicon-search"></i> <input id="search-input" type="text" class="search-input form-control" name="name" autocomplete="off" value="" placeholder="@searchPlaceholder1"> </div> </div> </div> <div class="main-nav"> @if (dsHeaderLinks != null && dsHeaderLinks.Tables.Count > 0 && dsHeaderLinks.Tables[0].Rows.Count > 0) { <ul> @foreach (DataRow headerLinkRow in dsHeaderLinks.Tables[0].Rows) { var linkUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(headerLinkRow["Target"].ToString()); <li><a href="@linkUrl">@headerLinkRow["DisplayName"].ToString()</a></li> } </ul> } </div> @if (dsMainMenuItems != null && dsMainMenuItems.Tables.Count > 0 && dsMainMenuItems.Tables[0].Rows.Count > 0) { <ul class="multi-menu"> @foreach (DataRow menuItemRow in dsMainMenuItems.Tables[0].Rows) { var menuItemUrl = (menuItemRow["Target"].ToString().StartsWith("/Files/") || menuItemRow["Target"].ToString().StartsWith("http")) ? menuItemRow["Target"].ToString() : Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(menuItemRow["Target"].ToString()); string menuItemNewTab = bool.Parse(menuItemRow["NewTab"].ToString()) ? "_blank" : string.Empty; var dsMenuSubItems = Database.CreateDataSet(string.Format("SELECT * FROM ItemListRelation itr JOIN ItemType_RecursiveLinks it on it.Id = itr.ItemListRelationItemId WHERE ItemListRelationItemListId = {0} ORDER BY SORT", menuItemRow["MenuItems"].ToString())); <li> <a target="@menuItemNewTab" href="@menuItemUrl">@menuItemRow["DisplayName"].ToString()</a> @if (dsMenuSubItems != null && dsMenuSubItems.Tables.Count > 0 && dsMenuSubItems.Tables[0].Rows.Count > 0) { <span class="open-dropdown"> <i class="icon icon-chevron-down"></i> </span> <ul> @foreach (DataRow subMenuRow in dsMenuSubItems.Tables[0].Rows) { var subMenuItemUrl = (subMenuRow["Target"].ToString().StartsWith("/Files/") || subMenuRow["Target"].ToString().StartsWith("http")) ? subMenuRow["Target"].ToString() : Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(subMenuRow["Target"].ToString()); string submenuItemNewTab = bool.Parse(subMenuRow["NewTab"].ToString()) ? "_blank" : string.Empty; var dsMenuSubSubItems = Database.CreateDataSet(string.Format("SELECT * FROM ItemListRelation itr JOIN ItemType_RecursiveLinks it on it.Id = itr.ItemListRelationItemId WHERE ItemListRelationItemListId = {0} ORDER BY SORT", subMenuRow["MenuItems"].ToString())); <li> <a target="@submenuItemNewTab" href="@subMenuItemUrl">@subMenuRow["DisplayName"].ToString()</a> @if (dsMenuSubSubItems != null && dsMenuSubSubItems.Tables.Count > 0 && dsMenuSubSubItems.Tables[0].Rows.Count > 0) { <span class="open-dropdown"> <i class="icon icon-chevron-down"></i> </span> <ul> @foreach (DataRow subsubMenuRow in dsMenuSubSubItems.Tables[0].Rows) { var subsubMenuItemUrl = (subsubMenuRow["Target"].ToString().StartsWith("/Files/") || subsubMenuRow["Target"].ToString().StartsWith("http")) ? subsubMenuRow["Target"].ToString() : Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(subsubMenuRow["Target"].ToString()); string subsbumenuItemNewTab = bool.Parse(subsubMenuRow["NewTab"].ToString()) ? "_blank" : string.Empty; var dsThirdLevelMenuItems = Database.CreateDataSet(string.Format("SELECT * FROM ItemListRelation itr JOIN ItemType_RecursiveLinks it on it.Id = itr.ItemListRelationItemId WHERE ItemListRelationItemListId = {0} ORDER BY SORT", subsubMenuRow["MenuItems"].ToString())); <li><a target="@subsbumenuItemNewTab" href="@subsubMenuItemUrl">@subsubMenuRow["DisplayName"].ToString()</a></li> } </ul> } </li> } </ul> } </li> } </ul> } @if (dsStandaloneMenuItems != null && dsStandaloneMenuItems.Tables.Count > 0 && dsStandaloneMenuItems.Tables[0].Rows.Count > 0) { <ul> @foreach (DataRow standaloneRow in dsStandaloneMenuItems.Tables[0].Rows) { var standaloneItemUrl = (standaloneRow["Target"].ToString().StartsWith("/Files/") || standaloneRow["Target"].ToString().StartsWith("http")) ? standaloneRow["Target"].ToString() : Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(standaloneRow["Target"].ToString()); string standaloneItemNewTab = bool.Parse(standaloneRow["NewTab"].ToString()) ? "_blank" : string.Empty; <li><a target="@standaloneItemNewTab" href="@standaloneItemUrl">@standaloneRow["DisplayName"].ToString()</a></li> } </ul> } <div class="mobile-links"> <a href="@storesLink" class="btn btn-primary btn-block"><span class="dicon dicon-map-pin mobile-icon"></span> @findButikLabel</a> <a href="@bookingLink" class="btn btn-primary btn-block"><span class="dicon dicon-meeting mobile-icon"></span> @bookingLinkLabel</a> @if (hideFreeMeasuringMenuItem != null && !(bool)hideFreeMeasuringMenuItem) { <a href="@measuringLink" class="btn btn-primary btn-block"><span class="dicon dicon-home"></span> @measuringLinkLabel</a> } </div> </div> </div> <!-- === Search ===--> <div class="search-wrapper"> <div class="search"> <i class="search-icon search-icon-left dicon dicon-search"></i> <input id="search-input" type="text" class="search-input form-control" name="name" autocomplete="off" value="" placeholder="@searchPlaceholder1"> <i class="search-icon search-icon-right icon icon-cross"></i> </div> <!--Search results--> @*<div class="search-results"> <strong>Søger du:</strong> <ul> <li><a href="#">Nærmeste butik</a></li> <li><a href="#">Samlevejledninger</a></li> <li><a href="#">Kataloger</a></li> <li><a href="#">Bestil opmåling</a></li> </ul> </div>*@ </div> </div> </div> </nav> <script type="text/javascript"> $(function () { $(".search-input").on('keypress', function (event) { if (event.which == 13) { event.preventDefault(); var languageId = '@GetInteger("DwAreaID")'; if (languageId === String(1)) { location.href = "/Search?q=" + $(this).val(); } else if (languageId === String(2)) { location.href = "https://www.designakjoekken.no/search?q=" + $(this).val(); } } }); }); </script> @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System.Text.RegularExpressions @using Dynamicweb.Data @using System.Web @{ var videoId = GetValue("Item.Video"); var financingInfo = GetValue("Item.FinancingInfo"); var infoCollection = GetLoop("Item.FinancingInfo"); var financingLink = GetValue("Item.FinancingLink"); var mediaType = GetValue("Item.MediaType"); var financingStores = Database.CreateDataSet("SELECT * FROM ItemType_Store where FinancingID is not null and FinancingID <> ''"); } <section class="section-clean section-inner"> <div class="container"> <div class="content-box financing"> <header> <h1 class="title">@GetValue("Item.Title")</h1> @*<h4>@GetValue("Item.Subtitle")</h4>*@ </header> @if(!string.IsNullOrWhiteSpace(mediaType.ToString())) { <div class="video"> <div class="row"> <div class="col-md-12"> @if(mediaType.ToString() == "video") { <div class="embed-responsive embed-responsive-16by9"> @videoId @*<iframe class="embed-responsive-item" src="https://player.vimeo.com/video/@videoId" width="640" height="360" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>*@ </div> } else if (mediaType.ToString() == "image") { <img class="w-100" src='@GetValue("Item.Image")'> } </div> </div> </div> } <div class="box-fields shadow-lg"> <div class="row row-clean align-items-center"> <div class="col-md-12"> <div class="header-title"> <h2>@GetValue("Item.BoxTitle")</h2> <h4>@GetValue("Item.BoxSubtitle")</h4> </div> </div> <div class="col-lg-4"> <div class="item item-arrow"> <div class="text"> <div><span class="number number-lg number-primary">1</span></div> <div> <span class="title">@GetValue("Item.BoxItem_1")</span></div> </div> </div> </div> <div class="col-lg-4"> <div class="item item-arrow"> <div class="text"> <div><span class="number number-lg number-primary">2</span></div> <div><span class="title">@GetValue("Item.BoxItem_2")</span></div> </div> </div> </div> <div class="col-lg-4"> <div class="item"> <div class="text"> <div><span class="number number-lg number-primary">3</span></div> <div><span class="title">@GetValue("Item.BoxItem_3")</span></div> </div> </div> </div> </div> </div> <div class="financing-info"> <div class="row"> <div class="col-md-12"> @GetValue("Item.FinancingContent") </div> <div class="col-md-6"> <div class="row"> @if (financingStores != null && financingStores.Tables.Count > 0 && financingStores.Tables[0].Rows.Count > 0) { <div class="col-md-6"> <div class="dropdown clearfix mt-4"> <span class="text-center d-block">@Translate("Financing.StoresText", "Text on dropdown")</span> <a class="btn btn-light btn-block dropdown-toggle butikdropdownlink" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span> @Translate("Footer.SelectStore", "Vælg butik…") </span> </a> <div class="dropdown-menu dropdown-menu-scroll w-100" aria-labelledby="butikdropdown"> @foreach (DataRow storeRow in financingStores.Tables[0].Rows) { var storeId = storeRow["FinancingID"].ToString(); var storePage = pageServiceFooter.GetPage(int.Parse(storeId)); <a class="dropdown-item dropdown-item-store" data-storeid="@storeId">@storeRow["Name"].ToString()</a> } </div> </div> </div> } @if (infoCollection != null) { <div class="col-md-6"> <div class="dropdown clearfix mt-4"> <span class="text-center d-block">@Translate("Financing.RatePaymentText", "Text on dropdown")</span> <a class="btn btn-light btn-block dropdown-toggle rates-dropdown" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <span> @Translate("Financing.SelectRatePaymentDropdown", "Text on dropdown") </span> </a> <div class="dropdown-menu dropdown-menu-scroll w-100" aria-labelledby="butikdropdown"> @foreach (var item in infoCollection) { <a class="dropdown-item dropdown-item-rates" data-item='@item.GetValue("Item.FinancingInfo.NumberOfRates")'>@item.GetValue("Item.FinancingInfo.NumberOfRates") @item.GetValue("Item.FinancingInfo.Text")</a> } </div> </div> </div> } @if (financingStores != null && infoCollection != null) { <div class="lg-button col-md-6 mt-5 w-100"> <a target="_blank" id="finance-target" href="javascript:void(0);" class="btn btn-primary finance-target w-100"><span>@Translate("Financing.ButtonText", "Text on button")</span></a> </div> } </div> </div> <div class="col-md-12 financing-info"> @GetValue("Item.FinancingTableContent") </div> </div> </div> </div> </div> </section> <script type="text/javascript"> $(function () { var store = null; var rate = null; $(".dropdown-item-store").on('click', function () { $(".butikdropdownlink").text($(this).text()).attr("financing-id", $(this).attr("data-storeid")); store = $(this).attr("data-storeid"); rate = $(".rates-dropdown").attr("rate-item"); UpdateString(store, rate); }); $(".dropdown-item-rates").on('click', function () { $(".rates-dropdown").text($(this).text()).attr("rate-item", $(this).attr("data-item")); store = $(".butikdropdownlink").attr("financing-id"); rate = $(this).attr("data-item"); UpdateString(store, rate); }); $(".finance-target").on('click', function () { if (!$(".rates-dropdown").attr("rate-item") || $(".rates-dropdown").attr("rate-item") == "" || !$(".butikdropdownlink").attr("financing-id") || $(".butikdropdownlink").attr("financing-id") == "") { alert("Select options from both dropdowns!"); event.preventDefault(); } }); if ($(window).width() < 1200) { $('.financing-info table').wrap('<div class="table-responsive"></div>'); } if (!String.format) { String.format = function (format) { var args = Array.prototype.slice.call(arguments, 1); return format.replace(/{(\d+)}/g, function (match, number) { return typeof args[number] != 'undefined' ? args[number] : match ; }); }; } UpdateString = function (store, rate) { var financingLink = String.format('@financingLink', store, rate); $(".finance-target").attr("href", financingLink); }; }); </script> @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Content @using Dynamicweb @using System @using Dynamicweb.Data @using System.Data @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using Dynamicweb.Content @using Dynamicweb @using Dynamicweb.Data @helper NavSettings() { var searchPlaceholder1 = Translate("Search.Placeholder", "Søg..."); var dsSettings = Database.CreateDataSet(string.Format("SELECT PageId, PageMenuText FROM Page WHERE PageItemType = 'Settings' AND PageAreaId = {0}", GetInteger("DwAreaID"))); var pageServiceNavigation = new PageService(); Dynamicweb.Content.Page settingsNode = null; if (dsSettings != null && dsSettings.Tables.Count > 0 && dsSettings.Tables[0].Rows.Count > 0) { settingsNode = pageServiceNavigation.GetPage(int.Parse(dsSettings.Tables[0].Rows[0]["PageId"].ToString())); } else { return; } <!-- ==== Header ==== --> object storesLink = null; settingsNode.Item.TryGetValue("StoresLink", ref storesLink); storesLink = storesLink != null && !string.IsNullOrWhiteSpace(storesLink.ToString()) ? storesLink.ToString() : string.Empty; string findButikLabel = Translate("Navigation.FindButik", "Find butik"); object bookingLink = null; settingsNode.Item.TryGetValue("BookAMeetingPage", ref bookingLink); bookingLink = bookingLink != null && !string.IsNullOrWhiteSpace(bookingLink.ToString()) ? bookingLink.ToString() : string.Empty; string bookingLinkLabel = Translate("Navigation.BookMeeting", "Book møde"); object measuringLink = null; settingsNode.Item.TryGetValue("FreeMeasuringPage", ref measuringLink); measuringLink = measuringLink != null && !string.IsNullOrWhiteSpace(measuringLink.ToString()) ? measuringLink.ToString() : string.Empty; string measuringLinkLabel = Translate("Navigation.FreeMeasuring", "Gratis opmåling"); object hideFreeMeasuringMenuItem = null; settingsNode.Item.TryGetValue("HideFreeMeasuringMenuItem", ref hideFreeMeasuringMenuItem); <div class="mobile-links"> <a href="@storesLink" class="btn btn-primary btn-block d-block d-sm-none"><span class="dicon dicon-map-pin"></span> @findButikLabel</a> <a href="@bookingLink" class="btn btn-primary btn-block d-block d-sm-none"><span class="dicon dicon-meeting"></span> @bookingLinkLabel</a> @if (hideFreeMeasuringMenuItem != null && !(bool)hideFreeMeasuringMenuItem) { <a href="@measuringLink" class="btn btn-primary btn-block d-block d-sm-none"><span class="dicon dicon-home"></span> @measuringLinkLabel</a> } </div> } <!-- ==================== Footer ==================== --> @{ // Data Table object instance for stores are not needed here as these have been implemented in the main template. The trade off is to loose template design time intelli sense. DataTable dtAreas = Database.CreateDataTable("SELECT DISTINCT AreaId, AreaName FROM Area"); string areaName = GetString("DwAreaName"); string storeCookieName = string.Format("store-{0}", areaName); string facebookTitle = Translate("Footer.Facebook", "Facebook"); string instagramTitle = Translate("Footer.Instagram", "Instagram"); string linkedinTitle = Translate("Footer.Linkedin", "LinkedIn"); object footerLogo = null; settingsNodeFooter.Item.TryGetValue("FooterLogo", ref footerLogo); footerLogo = footerLogo != null && !string.IsNullOrWhiteSpace(footerLogo.ToString()) ? footerLogo.ToString() : "/Files/Templates/Designs/Designa/assets/images/logo-footer.svg"; object footerItems = null; settingsNodeFooter.Item.TryGetValue("FooterItems", ref footerItems); var dsFooterItems = Database.CreateDataSet(string.Format("SELECT * FROM ItemListRelation itr JOIN ItemType_RecursiveLinks it on it.Id = itr.ItemListRelationItemId WHERE ItemListRelationItemListId = {0} ORDER BY SORT", footerItems)); object footerLinks = null; settingsNodeFooter.Item.TryGetValue("FooterLinks", ref footerLinks); var dsFooterLinks = Database.CreateDataSet(string.Format("SELECT * FROM ItemListRelation itr JOIN ItemType_Link it on it.Id = itr.ItemListRelationItemId WHERE ItemListRelationItemListId = {0} ORDER BY SORT", footerLinks)); object facebook = null; settingsNodeFooter.Item.TryGetValue("Facebook", ref facebook); facebook = facebook != null && !string.IsNullOrWhiteSpace(facebook.ToString()) ? facebook.ToString() : string.Empty; object instagram = null; settingsNodeFooter.Item.TryGetValue("Instagram", ref instagram); instagram = instagram != null && !string.IsNullOrWhiteSpace(instagram.ToString()) ? instagram.ToString() : string.Empty; object linkedin = null; settingsNodeFooter.Item.TryGetValue("Linkedin", ref linkedin); linkedin = linkedin != null && !string.IsNullOrWhiteSpace(linkedin.ToString()) ? linkedin.ToString() : string.Empty; object findStoreHeader = null; settingsNodeFooter.Item.TryGetValue("FindStoreHeader", ref findStoreHeader); findStoreHeader = findStoreHeader != null && !string.IsNullOrWhiteSpace(findStoreHeader.ToString()) ? findStoreHeader.ToString() : string.Empty; object findStoreText = null; settingsNodeFooter.Item.TryGetValue("FindStoreText", ref findStoreText); findStoreText = findStoreText != null && !string.IsNullOrWhiteSpace(findStoreText.ToString()) ? findStoreText.ToString() : string.Empty; } <footer> <div class="links"> <div class="container"> <div class="footer-mobile-links"> @NavSettings() </div> <div class="d-block d-sm-none">&nbsp;</div> <div class="row"> <!--Left--> <div class="col-md-2 d-none d-md-flex"> <div class="logo"> <img src="@footerLogo" alt="Footer Logo" width="120" height="36"> </div> </div> <!--Right--> <div class="col-md-10"> <div class="row row-clean"> @if (dsFooterItems != null && dsFooterItems.Tables.Count > 0 && dsFooterItems.Tables[0].Rows.Count > 0) { foreach (DataRow footerItemRow in dsFooterItems.Tables[0].Rows) { var footerItemUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(footerItemRow["Target"].ToString()); var footerItemTarget = bool.Parse(footerItemRow["NewTab"].ToString()) ? "_blank" : string.Empty; var dsFooterItemSubItems = Database.CreateDataSet(string.Format("SELECT * FROM ItemListRelation itr JOIN ItemType_RecursiveLinks it on it.Id = itr.ItemListRelationItemId WHERE ItemListRelationItemListId = {0} ORDER BY SORT", footerItemRow["MenuItems"].ToString())); <div class="col-md-3 d-none d-md-block footer-padding"> <p><a href="@footerItemUrl" target="@footerItemTarget"><strong>@footerItemRow["DisplayName"].ToString()</strong></a></p> @if (dsFooterItemSubItems != null && dsFooterItemSubItems.Tables.Count > 0 && dsFooterItemSubItems.Tables[0].Rows.Count > 0) { <ul> @foreach (DataRow footerItemSubRow in dsFooterItemSubItems.Tables[0].Rows) { var footerItemSubRowUrl = (footerItemSubRow["Target"].ToString().StartsWith("/Files/") || footerItemSubRow["Target"].ToString().StartsWith("http")) ? footerItemSubRow["Target"].ToString() : Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(footerItemSubRow["Target"].ToString()); string footerItemSubRowTarget = bool.Parse(footerItemSubRow["NewTab"].ToString()) ? "_blank" : string.Empty; <li><a target="@footerItemSubRowTarget" href="@footerItemSubRowUrl">@footerItemSubRow["DisplayName"]</a></li> } </ul> } </div> } } <div id="store-footer-dynamic-section" class="col-md-3"> <p><strong>@findStoreHeader</strong></p> <p>@findStoreText</p> <div class="dropdown"> <button class="btn btn-light dropdown-toggle text-left" type="button" id="butikdropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> @Translate("Footer.SelectStore", "Vælg butik…") </button> @if (dsStores != null && dsStores.Tables.Count > 0 && dsStores.Tables[0].Rows.Count > 0) { <div class="dropdown-menu dropdown-menu-scroll" aria-labelledby="butikdropdown"> @foreach (DataRow storeRow in dsStores.Tables[0].Rows) { var storeId = storeRow["PageId"].ToString(); <a class="dropdown-item" data-storeid="@storeId">@storeRow["PageMenuText"].ToString()</a> } </div> } </div> </div> @if (dsStores != null && dsStores.Tables.Count > 0 && dsStores.Tables[0].Rows.Count > 0) { foreach (DataRow mainStoreRow in dsStores.Tables[0].Rows) { var storeNode = pageServiceFooter.GetPage(int.Parse(mainStoreRow["PageId"].ToString())); object storeName = null; storeNode.Item.TryGetValue("Name", ref storeName); object street = null; storeNode.Item.TryGetValue("Street", ref street); object zip = null; storeNode.Item.TryGetValue("Zip", ref zip); object city = null; storeNode.Item.TryGetValue("City", ref city); object phone = null; storeNode.Item.TryGetValue("Phone", ref phone); object shortWorkingHours = null; storeNode.Item.TryGetValue("ShortWorkingHours", ref shortWorkingHours); var dsShortWorkingHours = Database.CreateDataSet(string.Format("SELECT * FROM ItemListRelation itr JOIN ItemType_NameValues it on it.Id = itr.ItemListRelationItemId WHERE ItemListRelationItemListId = {0} ORDER BY SORT", shortWorkingHours != null ? shortWorkingHours : "0")); var storeUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(int.Parse(mainStoreRow["PageId"].ToString())); var mainStoreId = mainStoreRow["PageId"].ToString(); <div id="store-footer-@mainStoreId" class="store-details col-md-3" style="display:none"> <p><strong id="store-name-and-address">@(storeName != null && !string.IsNullOrWhiteSpace(storeName.ToString()) ? storeName.ToString() : string.Empty)</strong> </p> <p> @(street != null && !string.IsNullOrWhiteSpace(street.ToString()) ? street.ToString() : string.Empty) <br> @(string.Format("{0} {1}", zip != null && !string.IsNullOrWhiteSpace(zip.ToString()) ? zip.ToString() : string.Empty, city != null && !string.IsNullOrWhiteSpace(city.ToString()) ? city.ToString() : string.Empty)) <br> @(phone != null && !string.IsNullOrWhiteSpace(phone.ToString()) ? "<i class='icon icon-phone-handset'></i> " + phone.ToString() : string.Empty) </p> @if (dsShortWorkingHours != null && dsShortWorkingHours.Tables.Count > 0 && dsShortWorkingHours.Tables[0].Rows.Count == 2) { <strong class="text-capitalize">@Translate("Stores.WorkingHoursLabel", "Åbningstider")</strong> <div class="row"> <div class="col-xl-6">@dsShortWorkingHours.Tables[0].Rows[0]["Name"].ToString()</div> <div class="col-xl-6">@dsShortWorkingHours.Tables[0].Rows[0]["Value"].ToString()</div> </div> <div class="row"> <div class="col-xl-6">@dsShortWorkingHours.Tables[0].Rows[1]["Name"].ToString()</div> <div class="col-xl-6">@dsShortWorkingHours.Tables[0].Rows[1]["Value"].ToString()</div> </div> } <p> <p> </p> <div class="row footer-row"> <div class="btn-group d-lg-block"><a href="@storeUrl" class="btn btn-dark btn-sm footer-button"><i class="dicon dicon-map-pin"></i> &nbsp; @Translate("GoToStore", "Gå til butik")</a></div> <div class="btn-group"> <div class="dropdown"> <button class="btn btn-light dropdown-toggle btn-sm footer-button" type="button" id="butikdropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> @Translate("SelectStore", "Skift butik…") </button> @if (dsStores != null && dsStores.Tables.Count > 0 && dsStores.Tables[0].Rows.Count > 0) { <div class="dropdown-menu dropdown-menu-scroll" aria-labelledby="butikdropdown"> @foreach (DataRow storeRow in dsStores.Tables[0].Rows) { var storeId = storeRow["PageId"].ToString(); <a class="dropdown-item" data-storeid="@storeId">@storeRow["PageMenuText"].ToString()</a> } </div> } </div> </div> </div> <p> </div> } } </div> </div> </div> <!--/row--> </div> <!--/container--> </div> <!--/links--> <div class="footer-end"> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="row row-clean"> @if (dsFooterLinks != null && dsFooterLinks.Tables.Count > 0 && dsFooterLinks.Tables[0].Rows.Count > 0) { <div class="col-md-6 col-9"> <ul> @foreach (DataRow footerLinkRow in dsFooterLinks.Tables[0].Rows) { var footerLinkRowUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(footerLinkRow["Target"].ToString()); var footerLinkRowTarget = bool.Parse(footerLinkRow["NewTab"].ToString()) ? "_blank" : string.Empty; <li><a class="links-mobile" target="@footerLinkRowTarget" href="@footerLinkRowUrl">@footerLinkRow["DisplayName"].ToString()</a></li> } </ul> </div> <div class="col-md-3 col-3"> <ul> @if (!string.IsNullOrWhiteSpace(facebook.ToString())) { <li><a class="media-mobile" target="_blank" href="@facebook.ToString()" title="@facebookTitle"><i class="dicon dicon-facebook"></i></a></li> } @if (!string.IsNullOrWhiteSpace(instagram.ToString())) { <li><a class="media-mobile" target="_blank" href="@instagram.ToString()" title="@instagramTitle"><i class="dicon dicon-instagram"></i></a></li> } @if (!string.IsNullOrWhiteSpace(linkedin.ToString())) { <li><a class="media-mobile" target="_blank" href="@linkedin.ToString()" title="@linkedinTitle"><i class="dicon dicon-linkedin"></i></a></li> } </ul> </div> <div class="d-block d-sm-none">&nbsp;</div> <div class="col-md-3"> <div class="dropdown"> <button class='btn btn-link dropdown-toggle btn-flag @(areaName == "Dansk" ? "danish" : "norway")' type="button" id="langdropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> @areaName </button> @{ if (dtAreas != null && dtAreas.Rows.Count > 0) { <div class="dropdown-menu" aria-labelledby="langdropdown"> @foreach (DataRow areaRow in dtAreas.Rows) { DataTable dtFrontPage = Database.CreateDataTable(string.Format("select top 1 p.PageId, p.PageMenuText, a.AreaId, a.AreaName from Page p join area a on a.AreaId = p.PageAreaId where PageAreaId = {0} order by PageId ", areaRow["AreaId"].ToString())); if (dtFrontPage != null && dtFrontPage.Rows.Count > 0) { var pageName = dtFrontPage.Rows[0]["AreaName"].ToString(); var pageUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(int.Parse(dtFrontPage.Rows[0]["PageId"].ToString())); @*if (pageName.ToLower() != areaName.ToLower()) { <a class="dropdown-item" href="@pageUrl">@pageName</a> }*@ // hardcoded link to old norwegian website until we are ready to publish it on DW if (pageName.ToLower() == "dansk") { <a class="dropdown-item" href="http://www.designa.dk/">@pageName</a> } else { <a class="dropdown-item" href="http://www.designakjoekken.no/">@pageName</a> } } } </div> } } </div> </div> } </div> </div> </div> </div> </div> </footer> <script> $(document).ready(function () { var storecookie = $.cookie('@storeCookieName') if (storecookie != undefined && storecookie != '') { $("#store-dynamic-section").hide(); $("#store-footer-dynamic-section").hide(); $("#store-footer-" + storecookie).show(); $("#store-" + storecookie).show(); } $(".dropdown-item").click(function () { $(".store-details").hide(); var storeId = $(this).data('storeid'); $.cookie('@storeCookieName', storeId, { expires: 365, path: '/' }); $("#store-dynamic-section").hide(); $("#store-footer-dynamic-section").hide(); $("#store-" + storeId).show(); $("#store-footer-" + storeId).show(); }) }); </script> </div> <script type="application/ld+json"> { "@@context" : "http://schema.org", "@@type" : "Organization", "legalName" : "Designa", "url" : "https://www.designa.dk/", "logo" : "https://www.designa.dk/Files/Templates/Designs/Designa/assets/images/logo-header.svg", "sameAs" : [ "https://www.facebook.com/DESIGNAKoekken/", "https://www.instagram.com/designakitchen/"] } </script> </body> </html>