Exception in template (Designs/Designa/_parsed/ContactCategory.parsed.cshtml): System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near the keyword 'ORDER'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at Dynamicweb.Data.Database.CreateDataSet(IDbDataAdapter dataAdapter, Boolean withSchema)
at Dynamicweb.Data.Database.CreateDataSet(String sql, IDbConnection connection, IDbTransaction transaction, Boolean withSchema, Dictionary`2 sqlParams)
at Dynamicweb.Data.Database.CreateDataSet(String sql)
at CompiledRazorTemplates.Dynamic.eabbbcbbdb.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()
ClientConnectionId:cdcf2734-6199-48ea-b1b6-2181b63231de
Error Number:156,State:1,Class:15
@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.AbsoluteUri.Contains("dw.inet-design.dk")) { <meta name="robots" content="noindex, nofollow"> } <!-- 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.2"></script> <script src="/Files/Templates/Designs/Designa/js/formMeeting.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", "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("find-butik", "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("book-a-meeting", "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("free-measuring", "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.Data @{ var pageservice = new PageService(); var articles = pageservice.GetPagesByParentID(GetInteger("DwPageID")); var currentPage = pageservice.GetPage(GetInteger("DwPageID")); var currentPageUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(currentPage.ID); } <section class="section-clean section-inner contact"> <div class="container"> <div class="content-box blog"> <header> <h1 class="title">@GetValue("Item.Title")</h1> <h4>@GetValue("Item.Subtitle")</h4> <div class="text text-wrap">@GetValue("Item.Description")</div> <div class="contact-nav"> <p><strong>@Translate("erhverv-contact-subtitle", "Kontakt din nermeste afdeling")</strong></p> @foreach (var article in articles) { var departments = pageservice.GetPagesByParentID(article.ID); object title = null; article.Item.TryGetValue("Title", ref title); <div class="row"> <div class="col-md-2"> @title: </div> <div class="col-md-8"> @foreach (var department in departments) { object depTitle = null; department.Item.TryGetValue("Title", ref depTitle); <a href="@currentPageUrl#@department.ID" title="@department.ID" class="btn-scroll">@depTitle</a> } </div> </div> } </div> </header> <div class="row"> @foreach (var article in articles) { var departments = pageservice.GetPagesByParentID(article.ID); object title = null; article.Item.TryGetValue("Title", ref title); object description = null; article.Item.TryGetValue("Description", ref description); var articleUrl = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(article.ID); <div class="col-lg-12" id="@article.ID"> <h2 class="group-title">@title</h2> <p>@description</p> @foreach (var department in departments) { var employees = pageservice.GetPagesByParentID(department.ID); object depTitle = null; department.Item.TryGetValue("Title", ref depTitle); object employeeTitle = null; department.Item.TryGetValue("EmployeeTitle", ref employeeTitle); object deps = null; department.Item.TryGetValue("Departments", ref deps); var dsDepartments = Database.CreateDataSet(string.Format("SELECT * FROM ItemListRelation itr JOIN ItemType_ContactItem it on it.Id = itr.ItemListRelationItemId WHERE ItemListRelationItemListId = {0} ORDER BY SORT", deps)); <h4 id="@department.ID">@depTitle</h4> if (dsDepartments != null && dsDepartments.Tables.Count > 0 && dsDepartments.Tables[0].Rows.Count > 0) { <div class="row"> @foreach (DataRow departmentRow in dsDepartments.Tables[0].Rows) { var email = departmentRow["Email"].ToString(); <div class="col-md-6"> <strong>@departmentRow["Title"].ToString()</strong> <div class="row"> <div class="col-md-6"> @departmentRow["Address"].ToString() </div> <div class="col-md-6"> @departmentRow["Phone"].ToString() <br> <a href="mailto:@email">@email</a> </div> </div> </div> } </div> } <div class="find-store find-store-contact"> <strong class="text-uppercase">@employeeTitle</strong> @if (employees.Count() > 0) { <div class="user-cards"> <div class="row"> @foreach (var employee in employees) { if (employee.Item.SystemName != "Employee") { continue; } object employeeImage = null; employee.Item.TryGetValue("Image", ref employeeImage); object firstname = null; employee.Item.TryGetValue("Firstname", ref firstname); object lastname = null; employee.Item.TryGetValue("Lastname", ref lastname); object position = null; employee.Item.TryGetValue("Position", ref position); object phone = null; employee.Item.TryGetValue("Phone", ref phone); object email = null; employee.Item.TryGetValue("Email", ref email); <div class="col-md-3"> <article> <div class="image"> <img src="/Admin/Public/GetImage.ashx?image=@employeeImage.ToString()&width=360&height=280&crop=5&compression=90" alt="Image name"> </div> <div class="text"> <p><strong>@(string.Format("{0} {1}", firstname != null && !string.IsNullOrWhiteSpace(firstname.ToString()) ? firstname.ToString() : string.Empty, lastname != null && !string.IsNullOrWhiteSpace(lastname.ToString()) ? lastname.ToString() : string.Empty))</strong></p> <p class="light">@(position != null && !string.IsNullOrWhiteSpace(position.ToString()) ? position.ToString() : string.Empty)</p> <p><a href="tel: @(phone != null && !string.IsNullOrWhiteSpace(phone.ToString()) ? phone.ToString() : string.Empty)">@(phone != null && !string.IsNullOrWhiteSpace(phone.ToString()) ? phone.ToString() : string.Empty)</a></p> <p><a class="anchor" href="mailto: @(email != null && !string.IsNullOrWhiteSpace(email.ToString()) ? email.ToString() : string.Empty)">@(email != null && !string.IsNullOrWhiteSpace(email.ToString()) ? email.ToString() : string.Empty)</a></p> </div> </article> </div> } </div> </div> } </div> } </div> } </div> <!--/row--> </div> </div> </section> <script type="text/javascript"> $(function () { DESIGNA.Layout.initAutoHeightCard(); var btnscr = $('.btn-scroll'); btnscr.on('click', function (e) { e.preventDefault(); var $this = $(this); var id = $this.attr("title") $('html,body').animate({ scrollTop: $("#" + id).offset().top - 80 }, 1000); return false; }); }); </script> <div id="content">@GetValue("DwContent(content)")</div> @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", "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("find-butik", "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("book-a-meeting", "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("free-measuring", "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("Facebook", "Facebook"); string instagramTitle = Translate("Instagram", "Instagram"); string linkedinTitle = Translate("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("select-butik", "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("working-hours-label", "Å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("go-to-store-page", "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("select-store", "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>