Error executing template "Designs/Website2021/_parsed/Page.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_bc0a405504534ffb975fab5cd18d18b2.Execute() in D:\dynamicweb.net\Solutions\SkaberTrang\eamv.cloud.dyanmicweb-cms.com\Files\Templates\Designs\Website2021\_parsed\Page.parsed.cshtml:line 358
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 @Title("Standard Page") 3 @Description("Template for a standard page") 4 @using Dynamicweb.Environment 5 6 @{ 7 string designBasePath = Pageview.Layout.File.Location; 8 string libBasePath = designBasePath + "lib/"; 9 10 //Tjekker på om det er en lokal installation. 11 bool isLocalSpecial = System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority).IndexOf("https://localhost:") == 0; 12 bool isLocal = isLocalSpecial || System.Web.HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) == "http://eamv.local.dynamicweb.dk"; 13 14 var searchPage = Dynamicweb.Services.Pages.GetPageByNavigationTag(Pageview.AreaID, "searchresult"); 15 int qualityPageAreaID = isLocal ? 3 : 2; 16 17 } 18 <!DOCTYPE html> 19 <html lang="@Pageview.Area.CultureInfo.TwoLetterISOLanguageName"> 20 <head> 21 <meta charset="utf-8"> 22 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 23 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> 24 <meta name="description" content="@Model.Description" /> 25 <meta name="keywords" content="@Model.Keywords" /> 26 <meta name="format-detection" content="telephone=no"> 27 28 <!-- Fav Icon --> 29 @{ 30 string faviconpath = "/Files/Images/Website/System/Fav/"; 31 } 32 33 <link rel="apple-touch-icon" sizes="180x180" href="@(faviconpath)apple-touch-icon.png"> 34 <link rel="icon" type="image/png" sizes="32x32" href="@(faviconpath)favicon-32x32.png"> 35 <link rel="icon" type="image/png" sizes="16x16" href="@(faviconpath)favicon-16x16.png"> 36 @*<link rel="manifest" href="@(faviconpath)site.webmanifest">*@ 37 <link rel="mask-icon" href="@(faviconpath)safari-pinned-tab.svg" color="#ff9528"> 38 <link rel="shortcut icon" href="@(faviconpath)favicon.ico"> 39 <meta name="msapplication-TileColor" content="#ffffff"> 40 <meta name="msapplication-config" content="@(faviconpath)browserconfig.xml"> 41 <meta name="theme-color" content="#ffffff"> 42 43 @* Hack kun for Louises bærbar - LLA *@ 44 @if (isLocalSpecial) { 45 <base href="https://localhost:44314/"> 46 } 47 48 @Model.MetaTags 49 <title>@Model.Title</title> 50 <link href="https://customer.cludo.com/css/templates/v2.1/essentials/cludo-search.min.css" async type="text/css" rel="stylesheet"> 51 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> 52 <link href="@(designBasePath)css/style.min.css?v=20220517" rel="stylesheet" type="text/css" media="screen,print" /> 53 <link async rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous" /> 54 @*<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">*@ 55 56 57 58 59 60 @* -------------------------------------------------------------------------------------------------- *@ 61 @* NUVÆRENDE ---------------------------------------------------------------------------------------- *@ 62 @* 63 <script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="83a915b6-41ea-4c63-b6e0-c219bff073f2" data-blockingmode="auto" type="text/javascript"></script> 64 65 @if (!isLocal) { 66 if (Model.Area.ID == qualityPageAreaID) { 67 68 <script> 69 (function (w, d, s, l, i) { 70 w[l] = w[l] || []; w[l].push({ 71 'gtm.start': 72 new Date().getTime(), event: 'gtm.js' 73 }); var f = d.getElementsByTagName(s)[0], 74 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 75 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 76 })(window, document, 'script', 'dataLayer', 'GTM-W9L9LXG'); 77 </script> 78 79 } else { 80 81 <script> 82 (function (w, d, s, l, i) { 83 w[l] = w[l] || []; w[l].push({ 84 'gtm.start': 85 new Date().getTime(), event: 'gtm.js' 86 }); var f = d.getElementsByTagName(s)[0], 87 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 88 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 89 })(window, document, 'script', 'dataLayer', 'GTM-MC4FJFL'); 90 </script> 91 92 } 93 }*@ 94 @* /NUVÆRENDE *@ 95 @* -------------------------------------------------------------------------------------------------- *@ 96 97 98 99 100 @* -------------------------------------------------------------------------------------------------- *@ 101 @* NY - MED COOKIEBOT HALLØJ *@ 102 <!-- Google Consent Mode --> 103 <script data-cookieconsent="ignore"> 104 window.dataLayer = window.dataLayer || []; 105 function gtag() { 106 dataLayer.push(arguments) 107 } 108 gtag("consent", "default", { 109 ad_personalization: "denied", 110 ad_storage: "denied", 111 ad_user_data: "denied", 112 analytics_storage: "denied", 113 functionality_storage: "denied", 114 personalization_storage: "denied", 115 security_storage: "granted", 116 wait_for_update: 500 117 }); 118 gtag("set", "ads_data_redaction", true); 119 gtag("set", "url_passthrough", true); 120 </script> 121 <!-- End Google Consent Mode--> 122 123 @if (!isLocal) { 124 if (Model.Area.ID == qualityPageAreaID) { 125 126 <!-- Google Tag Manager --> 127 <script data-cookieconsent="ignore"> 128 (function (w, d, s, l, i) { 129 w[l] = w[l] || []; w[l].push({ 130 'gtm.start': 131 new Date().getTime(), event: 'gtm.js' 132 }); var f = d.getElementsByTagName(s)[0], 133 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 134 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 135 })(window, document, 'script', 'dataLayer', 'GTM-W9L9LXG'); 136 </script> 137 <!-- End Google Tag Manager --> 138 139 } else { 140 141 <!-- Google Tag Manager --> 142 <script data-cookieconsent="ignore"> 143 (function (w, d, s, l, i) { 144 w[l] = w[l] || []; w[l].push({ 145 'gtm.start': 146 new Date().getTime(), event: 'gtm.js' 147 }); var f = d.getElementsByTagName(s)[0], 148 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 149 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 150 })(window, document, 'script', 'dataLayer', 'GTM-MC4FJFL'); 151 </script> 152 <!-- End Google Tag Manager --> 153 } 154 } 155 156 <script id="Cookiebot" src="https://consent.cookiebot.com/uc.js" data-cbid="83a915b6-41ea-4c63-b6e0-c219bff073f2" data-blockingmode="auto" type="text/javascript" data-consentmode-defaults="disabled"></script> 157 158 159 @* / NY - MED COOKIEBOT HALLØJ *@ 160 @* -------------------------------------------------------------------------------------------------- *@ 161 162 </head> 163 164 <body> 165 166 @* -- -- -- -- -- MOBILE NAV -- -- -- -- -- *@ 167 <div class="container-fluid"> 168 <div class="floatcontainer"> 169 <div class="inner"> 170 <button type="button" class="btn-open" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> 171 <div> 172 <div class="nav-icon"> 173 <div></div> 174 </div> 175 </div> 176 </button> 177 </div> 178 </div> 179 </div> 180 181 <div class="zeynep-overlay"></div> 182 183 <div class="zeynep" style="transform: translateX(-295px);"> 184 185 <div class="golden-buzz"> 186 @{ 187 string searchInputValue = "" + Dynamicweb.Context.Current.Request.QueryString.Get("Search"); 188 } 189 @if (searchPage != null) { 190 <div class="container"> 191 <form action="/default.aspx" class="w-100"> 192 <input type="hidden" name="Id" value="@searchPage.ID" /> 193 <div class="g-0 row"> 194 <div class="col-10"> 195 <input type="text" name="search" class="w-100 h-100 text-center" value="@searchInputValue" aria-label="Search" id="mobile-search" placeholder="Indtast dit søgeord her" /> 196 </div> 197 <div class="col-2 text-right"> 198 <button type="submit" id="mobile-searchButton" class="btn btn-primary"> 199 @Skabertrang.Helpers.Icons.Search 200 </button> 201 </div> 202 </div> 203 </form> 204 </div> 205 } 206 </div> 207 208 <div class="main-nav"> 209 @RenderNavigation(new { 210 startlevel = 1, 211 endlevel = 99, 212 template = "TopBarNav-Mobile.xslt", 213 expandmode = "All", 214 parentid = 0, 215 areaid = Pageview.AreaID, 216 includemode = "All" 217 }) 218 </div> 219 220 @* FOR LIVE: parentid = 5 *@ 221 @* FOR LOCAL: parentid = 8 *@ 222 @* FOR KVALITET: parentid = 144 *@ 223 <div class="service-nav"> 224 @if (Model.Area.ID == qualityPageAreaID) { 225 /* EAMV KVALITETS SITE */ 226 @RenderNavigation(new { 227 startlevel = 1, 228 endlevel = 99, 229 template = "TopBarNav-Mobile.xslt", 230 expandmode = "All", 231 parentid = 144, 232 areaid = Pageview.AreaID, 233 includemode = "All", 234 }) 235 } else { 236 @RenderNavigation(new { 237 startlevel = 1, 238 endlevel = 99, 239 template = "TopBarNav-Mobile.xslt", 240 expandmode = "All", 241 parentid = 5, 242 areaid = Pageview.AreaID, 243 includemode = "All", 244 }) 245 } 246 </div> 247 </div> 248 249 <div class="zeynep-overlay zeynep-overlay-under"></div> 250 @* -- -- -- -- -- /MOBILE NAV -- -- -- -- -- *@ 251 252 @if (Model.Area.Item.GetDateTime("WarningEnabledTo") > DateTime.Now && !string.IsNullOrWhiteSpace(Model.Area.Item.GetString("WarningText"))) { 253 int bannerClosedDays = 1; 254 if (Model.Area.Item.GetInt32("WarningCookieClosedDays") > 0) { 255 bannerClosedDays = Model.Area.Item.GetInt32("WarningCookieClosedDays"); 256 } 257 <aside class="breaking-banner" data-banner-close-days="@bannerClosedDays"> 258 <div class="container"> 259 <div class="d-inline-block"> 260 @Model.Area.Item.GetString("WarningText") 261 </div> 262 <div class="float-end breaking-banner-close"> 263 <svg aria-hidden="true" focusable="false" data-prefix="fal" data-icon="times" class="svg-inline--fa fa-times fa-w-10" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path fill="currentColor" d="M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"></path></svg> 264 </div> 265 </div> 266 </aside> 267 } 268 269 <header id="top"> 270 <a id="skip" href="/Default.aspx?ID=@(Model.ID)#main-content">@Translate("Spring hovednavigationen over")</a> 271 <nav class="navbar navbar-expand-md top-nav"> 272 <div class="container"> 273 <a href="/" class="page-logo" title="@Translate("Gå til forsiden")"> 274 @if (Model.Area.ID == qualityPageAreaID) { 275 /* EAMV KVALITETS SITE */ 276 @Skabertrang.Helpers.Icons.LogoQualitySite 277 } else { 278 @Skabertrang.Helpers.Icons.Logo 279 } 280 </a> 281 282 <div id="mymenu" class="collapse navbar-collapse w-100 mb-auto top-nav"> 283 @{ 284 var navigationSettingsTopNav = new Dynamicweb.Frontend.Navigation.NavigationSettings() { 285 StartLevel = 2, 286 StopLevel = 3, 287 ExpandMode = Dynamicweb.Frontend.Navigation.ExpandMode.All, 288 RootNavigationTag = "topbarnav" 289 }; 290 } 291 @RenderTopNavigationNodes(GetNavigation(navigationSettingsTopNav).Nodes) 292 </div> 293 </div> 294 </nav> 295 296 <div class="main-nav navbar navbar-expand-md"> 297 <div class="container"> 298 <div class="navbar-collapse collapse"> 299 @{ 300 var navigationSettingsMainNav = new Dynamicweb.Frontend.Navigation.NavigationSettings() { 301 StartLevel = 1, 302 StopLevel = 2, 303 ExpandMode = Dynamicweb.Frontend.Navigation.ExpandMode.All 304 }; 305 } 306 @RenderMainNavigationRootNodes(GetNavigation(navigationSettingsMainNav).Nodes) 307 308 @if (searchPage != null) { 309 <div class="ml-auto"> 310 <a href="/Default.aspx?ID=@searchPage.ID" class="float-end" title="Search page"> 311 <div class="search-iconbox float-end"> 312 @Skabertrang.Helpers.Icons.Search 313 </div> 314 </a> 315 </div> 316 } 317 </div> 318 </div> 319 </div> 320 </header> 321 322 323 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 324 325 326 @{ 327 // DW Hacks :) Do not remove! 328 // @Model.Placeholder("spots", "Spots", "sort:2") 329 Skabertrang.Items.Content.Page pageItem = new Skabertrang.Items.Content.Page(); 330 if (Model.ItemType == "Page" && Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId) != null) { 331 pageItem = Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId).ToCodeFirstItem<Skabertrang.Items.Content.Page>(); 332 } else if (Model.ItemType == "OpenHouse" && Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId) != null) { 333 pageItem = Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId).ToCodeFirstItem<Skabertrang.Items.Content.OpenHouse>(); 334 } else if (Model.ItemType == "Event" && Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId) != null) { 335 pageItem = Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId).ToCodeFirstItem<Skabertrang.Items.Content.Event>(); 336 } else if (Model.ItemType == "Article" && Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId) != null) { 337 pageItem = Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId).ToCodeFirstItem<Skabertrang.Items.Content.Article>(); 338 } else if (Model.ItemType == "PageExtra" && Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId) != null) { 339 pageItem = Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId).ToCodeFirstItem<Skabertrang.Items.Content.PageExtra>(); 340 } 341 //else if (Model.ItemType == "PageTop" && Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId) != null) 342 //{ 343 // pageItem = Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId).ToCodeFirstItem<Samn.Items.PageTop>(); 344 //} 345 //else if (Model.ItemType == "PageSelfService" && Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId) != null) 346 //{ 347 // pageItem = Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId).ToCodeFirstItem<Samn.Items.PageSelfService>(); 348 //} 349 ////Overstående gør at det fx er muligt at kalde thisPageItem.Header og få en typestærk version af overskriften. 350 351 string rightColumnContent = Model.Placeholder("spots"); 352 bool showRightColumn = !string.IsNullOrWhiteSpace(rightColumnContent); 353 354 string currentPageIcon = ""; 355 if (Model.ItemType == "TopPage") { 356 currentPageIcon = Model.Item.GetList("Icon").SelectedValue; 357 } 358 var pageBannerImageItem = Model.Item.GetItem("BannerImage"); 359 } 360 @if (Model.ItemType != "Article") { 361 <div class="pagebanner-wrapper"> 362 @if (pageBannerImageItem != null) { 363 var pageBannerImage = pageBannerImageItem.GetFile("File"); 364 if (pageBannerImage != null) { 365 string pageBannerImagePath = "/Admin/Public/GetImage.ashx?Image=" + pageBannerImage.PathUrlEncoded + "&Width=1920&Height=350&DoNotUpscale=false&Crop=7&format=webp&Quality=85"; 366 if (pageBannerImage.HasFocalPoint()) { 367 pageBannerImagePath += "&" + pageBannerImage.GetFocalPointParameters(); 368 } 369 <img src="@pageBannerImagePath" alt="@pageBannerImageItem.GetString("Alt")" title="@pageBannerImageItem.GetString("Title")" class="img-fluid w-100" /> 370 } 371 } 372 </div> 373 } 374 375 @functions{ 376 public string DateTextHelper(DateTime date) { 377 string startDateText = date.Date == DateTime.Today ? "i dag" : date.Date == DateTime.Today.AddDays(-1) ? "i går" : date.Date == DateTime.Today.AddDays(1) ? "i morgen" : "d. "+date.ToString("d. MMM YYYY"); 378 return ""; 379 } 380 } 381 382 <main> 383 <div class="container"> 384 @{ 385 var topPage = Dynamicweb.Services.Pages.GetPage(Model.TopPage.ID); 386 int navStartlevel = 1; 387 if (topPage.IsFolder) { 388 navStartlevel++; 389 } 390 var navigationSettingsBreadcrumb = new Dynamicweb.Frontend.Navigation.NavigationSettings() { 391 StartLevel = navStartlevel, 392 StopLevel = 10, 393 ExpandMode = Dynamicweb.Frontend.Navigation.ExpandMode.PathOnly 394 }; 395 } 396 @if (Model.ItemType == "Article") { 397 @Navigation.RenderNavigation("Navigation/BreadcrumbArticles.cshtml", navigationSettingsBreadcrumb) 398 } else { 399 @Navigation.RenderNavigation("Navigation/Breadcrumb.cshtml", navigationSettingsBreadcrumb) 400 } 401 402 403 404 <div id="main-content" class="standard-page-text"> 405 406 @*<h2>Om EAMV</h2>*@ 407 <div class="row"> 408 <div class="col-12"> 409 @if (!string.IsNullOrWhiteSpace(pageItem.Heading)) { 410 411 <h1>@pageItem.Heading</h1> 412 } 413 </div> 414 415 <div class="col-12"> 416 <div class="row"> 417 <div class="col standard-page-text-paragraph"> 418 <div class="row"> 419 @if (Model.ItemType == "Event" || Model.ItemType == "Article" && Dynamicweb.Services.Items.GetItem(Model.ItemType, Model.ItemId) != null) { 420 DateTime eventStartDateTime = Model.Item.GetDateTime("DateAndTime"); 421 if (eventStartDateTime != DateTime.MinValue) { 422 <p> 423 @if (Model.ItemType == "Event") { 424 DateTime eventEndDateTime = Model.Item.GetDateTime("EndDateAndTime"); 425 string startDateText = eventStartDateTime.ToString("d. MMM yyyy"); 426 string endDateText = eventEndDateTime.ToString("d. MMM yyyy"); 427 string startTimeText = eventStartDateTime.TimeOfDay != TimeSpan.Zero ? eventStartDateTime.ToString("kl. HH.mm") : ""; 428 string endTimeText = eventEndDateTime.TimeOfDay != TimeSpan.Zero ? eventEndDateTime.ToString("kl. HH.mm") : ""; 429 430 string dateText = ""; 431 432 if(eventEndDateTime > eventStartDateTime) { 433 //Slut tidspunkt er sat, ellers antages slut er = start. 434 if(DateTime.Now > eventEndDateTime) { 435 //Eventet er overstået. 436 437 if (eventEndDateTime.Date == eventStartDateTime.Date) { 438 //Enkelt dags 439 if (eventStartDateTime.Date == DateTime.Now.Date) { 440 //I dag 441 dateText = "Arrangementet blev holdt i dag"; 442 } else if(eventStartDateTime.Date == DateTime.Now.Date.AddDays(-1)) { 443 //I går 444 dateText = "Arrangementet blev holdt i går"; 445 } else { 446 //Flere dage siden 447 dateText = "Arrangementet blev holdt d. " + startDateText; 448 } 449 } else { 450 //Flere dags. 451 if (eventEndDateTime.Date == DateTime.Now.Date) { 452 // Sluttede i dag 453 if(eventStartDateTime == DateTime.Now.AddDays(-1)) { 454 //Startede i går 455 dateText = "Arrangementet blev holdt fra i går til i dag"; 456 } else { 457 //Startede før i går 458 dateText = "Arrangementet blev holdt fra d. "+ startDateText + " til i dag"; 459 } 460 } else if (eventEndDateTime.Date == DateTime.Now.Date.AddDays(-1)) { 461 //Sluttede i går 462 dateText = "Arrangementet blev holdt fra d. " + startDateText + " til i går"; 463 } else { 464 //Sluttede for flere dage siden 465 dateText = "Arrangementet blev holdt fra d. "+ startDateText + " til "+ endDateText; 466 } 467 } 468 469 } else if(DateTime.Now < eventEndDateTime && DateTime.Now > eventStartDateTime) { 470 //Eventet er igang 471 472 if (eventEndDateTime.Date == eventStartDateTime.Date) { 473 //Enkelt dags 474 //Kan kun være i dag. 475 dateText = "Arrangementet startede i dag " + startTimeText + " og er færdig " + endTimeText; 476 } else { 477 //Flere dags. 478 if(eventStartDateTime.Date == DateTime.Now.Date) { 479 //Eventet startede i dag og slutter i fremtiden. 480 dateText = "Arrangementet startede i dag " + startTimeText; 481 } else if(eventStartDateTime.Date == DateTime.Now.Date.AddDays(-1)) { 482 //Eventet startede i går og slutter i dag eller i fremtiden. 483 dateText = "Arrangementet startede i går"; 484 } else { 485 //Eventet startede før i går og slutter i dag eller i fremtiden. 486 dateText = "Arrangementet startede d. " + startDateText; 487 } 488 if (eventEndDateTime.Date == DateTime.Now.Date) { 489 //Eventet startede før i dag og slutter i dag. 490 dateText += " og er færdig i dag " + endTimeText; 491 } else if (eventEndDateTime.Date == DateTime.Now.Date.AddDays(1)) { 492 //Eventet startede i dag eller før slutter i morgen. 493 dateText += " og slutter i morgen " + endTimeText; 494 } else { 495 //Eventet startede i dag eller før og slutter senere end i morgen. 496 dateText += " og slutter d. " + endDateText + " " + endTimeText; 497 } 498 } 499 } else { 500 501 if (eventEndDateTime.Date == eventStartDateTime.Date) { 502 //Enkelt dags 503 if(eventStartDateTime == DateTime.Now) { 504 //Starter og slutter senere i dag. 505 dateText = "Arrangementet holdes i dag " + startTimeText + " til " + eventEndDateTime.ToString("HH.mm"); 506 } else if(eventStartDateTime == DateTime.Now.AddDays(1)) { 507 dateText = "Arrangementet holdes i morgen " + startTimeText + " til " + eventEndDateTime.ToString("HH.mm"); 508 } else { 509 dateText = "Arrangementet holdes d." + startDateText + " " + startTimeText + " til " + eventEndDateTime.ToString("HH.mm"); 510 } 511 } else { 512 //Flere dags. 513 if (eventStartDateTime == DateTime.Now) { 514 //Starter i dag og slutter senere. 515 dateText = "Arrangementet starter i dag " + startTimeText; 516 517 } else if (eventStartDateTime == DateTime.Now.AddDays(1)) { 518 //Starter i morgen og slutter senere. 519 dateText = "Arrangementet starter i morgen " + startTimeText; 520 } else { 521 dateText = "Arrangementet starter d. "+startDateText +" "+ startTimeText; 522 } 523 if (eventEndDateTime == DateTime.Now.AddDays(1)) { 524 //Starter i dag og slutter i morgen 525 dateText += " og slutter i morgen " + endTimeText; 526 } else { 527 dateText += " og slutter d. " + endDateText + " " + endTimeText; 528 //Starter i dag og slutter på et senere tidspunkt 529 } 530 531 } 532 //Eventet starter senere 533 } 534 } else { 535 if (DateTime.Now.Date == eventStartDateTime.Date) { 536 if(DateTime.Now > eventStartDateTime) { 537 //Startede i dag før nu 538 dateText = "Arrangementet startede i dag " + startTimeText; 539 } else { 540 //Starter senere i dag 541 dateText = "Arrangementet holdes i dag " + startTimeText; 542 } 543 } else if(DateTime.Now.Date > eventStartDateTime.Date) { 544 //Er før i dag. 545 if(DateTime.Now.AddDays(-1).Date == eventStartDateTime.Date) { 546 //I går 547 dateText = "Arrangementet blev holdt igår"; 548 } else { 549 //før end i går 550 dateText = "Arrangementet blev holdt d. " + startDateText; 551 } 552 553 } else { 554 //Sker efter i dag 555 if (DateTime.Now.AddDays(1).Date == eventStartDateTime.Date) { 556 //I morgen 557 dateText = "Arrangementet holdes i morgen " + startTimeText; 558 } else { 559 //Efter i morgen 560 dateText = "Arrangementet holdes d. "+startDateText+ " " + startTimeText; 561 } 562 } 563 } 564 <span class="event-date"> 565 @dateText 566 </span> 567 568 } else if (Model.ItemType == "Article") { 569 <span class="event-date"> 570 @Model.Item.GetDateTime("DateAndTime").ToString("dd. MMM yyyy") 571 </span> 572 } 573 </p> 574 } 575 } 576 577 @if (!string.IsNullOrWhiteSpace(pageItem.Intro)) { 578 <p class="page-intro">@pageItem.Intro</p> 579 } 580 581 @if (!string.IsNullOrWhiteSpace(pageItem.Text)) { 582 <article class="editor"> 583 584 @*@if (!string.IsNullOrWhiteSpace(pageItem.Summary)) 585 { 586 <p class="intro-text">@pageItem.Summary</p> 587 }*@ 588 @if (!string.IsNullOrWhiteSpace(pageItem.Text)) { 589 @pageItem.Text 590 } 591 </article> 592 } 593 594 @Model.Placeholder("content", "Indhold", "default:true;sort:1") 595 </div> 596 </div> 597 598 @if (showRightColumn) { 599 <aside class="col-12 col-md-4 offset-md-0 col-lg-4 offset-lg-0 col-xl-3 offset-xl-1"> 600 601 <div class="spot-container mt-0"> 602 <div class="row"> 603 @rightColumnContent 604 </div> 605 </div> 606 607 </aside> 608 } 609 610 </div> 611 </div> 612 613 </div> 614 </div> 615 616 617 </div> 618 <!-- QUOTE boxes --> 619 @if (Model.ItemType == "PageExtra" && Model.Item.GetBoolean("ShowQuotes")) { 620 var quotes = Dynamicweb.Services.Paragraphs.GetParagraphsByItemTypes(new[] { "Quote" }).Where(x => x.ShowParagraph && x.Page.AreaId == Model.Area.ID && x.Item.ToCodeFirstItem<Skabertrang.Items.Content.Quote>().RelatedExtraPages != null && x.Item.ToCodeFirstItem<Skabertrang.Items.Content.Quote>().RelatedExtraPages.Split(',').Contains(Model.Item.Id)).OrderBy(x => Guid.NewGuid()).Take(3); 621 if (quotes.Any()) { 622 623 <div class="quotebox-wrapper quotebox-wrapper-with-img-bg py-5 mt-4"> 624 <div class="container"> 625 <div class="row justify-content-evenly"> 626 @foreach (var quote in quotes) { 627 Skabertrang.Items.Content.Quote quoteItem = quote.Item.ToCodeFirstItem<Skabertrang.Items.Content.Quote>(); 628 <div class="col-12 col-lg-4 quotebox mb-5"> 629 <div class="quotebox-text h-100"> 630 <h4>@quoteItem.Heading</h4> 631 @quoteItem.Text 632 <p class="quoteby">@quoteItem.Byline</p> 633 </div> 634 </div> 635 } 636 </div> 637 </div> 638 </div> 639 } 640 } 641 642 </main> 643 644 645 646 <footer> 647 <div class="container clearfix"> 648 <div class="write-us float-start"> 649 <a href="/Default.aspx?ID=9" title="@Translate("Gå til Kontakt os")">@Translate("Skriv til os")</a> 650 </div> 651 @{ 652 var toToplink = ""; 653 if (Model.ID == 1) { 654 toToplink = "#top"; 655 } else { 656 toToplink = "/Default.aspx?ID=" + Model.ID + "#top"; 657 } 658 } 659 <a href="@toToplink" title="Scroll til toppen"> 660 <div class="tothetop float-end"> 661 @Skabertrang.Helpers.Icons.ArrowUp 662 </div> 663 </a> 664 </div> 665 <div class="container-fluid main-footer"> 666 <div class="container"> 667 <div class="row"> 668 <div class="col-12 footer-logowrapper"> 669 <a href="/" class="" title="Gå til forsiden"> 670 @if (Model.Area.ID == qualityPageAreaID) { 671 /* EAMV KVALITETS SITE */ 672 @Skabertrang.Helpers.Icons.LogoQualitySite 673 } else { 674 @Skabertrang.Helpers.Icons.Logo 675 } 676 </a> 677 </div> 678 </div> 679 <div class="row"> 680 <div class="col-12 col-sm-6 col-md-6 col-lg-2"> 681 <h3>@Model.Area.Item.GetString("CompanyName")</h3> 682 @if (!string.IsNullOrWhiteSpace(Model.Area.Item.GetString("CompanyAddress"))) { 683 <div class="footer-adress"> 684 <a href="https://www.google.com/maps/search/?api=1&query=Gl.%20Landevej%202%207400%20Herning" target="_blank" rel="noopener"> 685 @Model.Area.Item.GetString("CompanyAddress") 686 <br /> 687 @Model.Area.Item.GetString("CompanyZipAndCity") 688 </a> 689 </div> 690 } 691 <div class="footer-info"> 692 @if (!string.IsNullOrWhiteSpace(Model.Area.Item.GetString("CompanyPhone"))) { 693 <a href="tel:@Model.Area.Item.GetString("CompanyPhone").Replace(" ", "")"> 694 @Translate("Tlf"). @Model.Area.Item.GetString("CompanyPhone") 695 </a> 696 } 697 <br /> 698 @if (!string.IsNullOrWhiteSpace(Model.Area.Item.GetString("CompanyEmail"))) { 699 <a href="mailto:@Model.Area.Item.GetString("CompanyEmail")"> 700 @Model.Area.Item.GetString("CompanyEmail") 701 </a> 702 } 703 </div> 704 </div> 705 706 <div class="col-12 col-sm-6 col-md-6 col-lg-2"> 707 @if (!string.IsNullOrWhiteSpace(Model.Area.Item.GetString("SecondCompanyName"))) { 708 <h3>@Model.Area.Item.GetString("SecondCompanyName")</h3> 709 } 710 @if (!string.IsNullOrWhiteSpace(Model.Area.Item.GetString("SecondCompanyAddress"))) { 711 <div class="footer-adress"> 712 <a href="https://www.google.com/maps/search/?api=1&query=Vald.%20Poulsens%20Vej%204%207500%20Holstebro" target="_blank" rel="noopener"> 713 @Model.Area.Item.GetString("SecondCompanyAddress") 714 <br /> 715 @Model.Area.Item.GetString("SecondCompanyZipAndCity") 716 </a> 717 </div> 718 } 719 <div class="footer-info"> 720 @if (!string.IsNullOrWhiteSpace(Model.Area.Item.GetString("SecondCompanyPhone"))) { 721 <a href="tel:@Model.Area.Item.GetString("SecondCompanyPhone").Replace(" ", "")"> 722 @Translate("Tlf"). @Model.Area.Item.GetString("SecondCompanyPhone") 723 </a> 724 } 725 <br /> 726 @if (!string.IsNullOrWhiteSpace(Model.Area.Item.GetString("SecondCompanyEmail"))) { 727 <a href="mailto:@Model.Area.Item.GetString("SecondCompanyEmail")"> 728 @Model.Area.Item.GetString("SecondCompanyEmail") 729 </a> 730 } 731 </div> 732 </div> 733 734 <div class="col-12 offset-0 col-md-12 offset-md-0 offset-lg-2 col-lg-3"> 735 <h3>@Model.Area.Item.GetString("SiteMapFirstColumnHeading")</h3> 736 <div class="footer-links"> 737 @foreach (var i in Model.Area.Item.GetItems("SiteMap")) { 738 string footerLinkClass = "footer-link"; 739 if (i.GetBoolean("NewTab")) { 740 footerLinkClass += "\" target=\"_blank\" rel=\"noopener"; 741 } 742 <a href="@i.GetString("Url")" class="@footerLinkClass"> 743 @i.GetString("LinkText") 744 </a> 745 } 746 </div> 747 </div> 748 749 <div class="col-12 col-md-12 col-lg-3"> 750 @{ 751 string companyLinkedin = Model.Area.Item.GetString("LinkedIn"); 752 string companyFacebook = Model.Area.Item.GetString("Facebook"); 753 string companyInstagram = Model.Area.Item.GetString("Instagram"); 754 string companyTwitter = Model.Area.Item.GetString("Twitter"); 755 string companyYouTube = Model.Area.Item.GetString("Youtube"); 756 } 757 @if (!string.IsNullOrWhiteSpace(companyLinkedin) || !string.IsNullOrWhiteSpace(companyFacebook) || !string.IsNullOrWhiteSpace(companyInstagram) || !string.IsNullOrWhiteSpace(companyTwitter) || !string.IsNullOrWhiteSpace(companyYouTube)) { 758 <h3>@Translate("Følg med")</h3> 759 <div class="footer-follow"> 760 @Model.Area.Item.GetString("SocialText") 761 <div class="sociallinkbox"> 762 @if (!string.IsNullOrWhiteSpace(companyLinkedin)) { 763 <a href="@companyLinkedin" target="_blank" rel="noopener"> 764 <span class="visually-hidden">@Translate("Gå til") @Translate("LinkedIn")</span> 765 <i class="fab fa-linkedin-in"></i> 766 </a> 767 } 768 @if (!string.IsNullOrWhiteSpace(companyFacebook)) { 769 <a href="@companyFacebook" target="_blank" rel="noopener"> 770 <span class="visually-hidden">@Translate("Gå til") @Translate("Facebook")</span> 771 <i class="fab fa-facebook"></i> 772 </a> 773 } 774 @if (!string.IsNullOrWhiteSpace(companyInstagram)) { 775 <a href="@companyInstagram" target="_blank" rel="noopener"> 776 <span class="visually-hidden">@Translate("Gå til") @Translate("Instagram")</span> 777 <i class="fab fa-instagram"></i> 778 </a> 779 } 780 @if (!string.IsNullOrWhiteSpace(companyTwitter)) { 781 <a href="@companyTwitter" target="_blank" rel="noopener"> 782 <span class="visually-hidden">@Translate("Gå til") @Translate("Twitter")</span> 783 <i class="fab fa-twitter"></i> 784 </a> 785 } 786 @if (!string.IsNullOrWhiteSpace(companyYouTube)) { 787 <a href="@companyYouTube" target="_blank" rel="noopener"> 788 <span class="visually-hidden">@Translate("Gå til") @Translate("YouTube")</span> 789 <i class="fab fa-youtube"></i> 790 </a> 791 } 792 </div> 793 </div> 794 } 795 </div> 796 </div> 797 @Model.Area.Item.GetString("FooterText") 798 </div> 799 </div> 800 </footer> 801 802 <script type="text/javascript" data-cookieconsent="ignore" src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script> 803 <script type="text/javascript" data-cookieconsent="ignore" src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script> 804 <script type="text/javascript" data-cookieconsent="ignore" src="https://cdn.jsdelivr.net/npm/handlebars@latest/dist/handlebars.js"></script> 805 806 <script type="text/javascript" defer data-cookieconsent="ignore" src="@(designBasePath + "js/script.min.js?v=20")"></script> 807 <script type="text/javascript" data-cookieconsent="ignore" src="~/Files/Templates/Designs/Website2021/js/zeynep.js"></script> 808 @RenderSnippet("PageJS") 809 @RenderSnippet("ParagraphJS") 810 <script data-cookieconsent="ignore" type="text/javascript" src="https://customer.cludo.com/scripts/bundles/search-script.min.js"></script> 811 <script type="text/javascript" data-cookieconsent="ignore"> 812 var CludoSearch; 813 (function () { 814 var cludoSettings = { 815 customerId: 3132, 816 engineId: 13350, 817 searchUrl: 'https://www.eamv.dk/soegeresultat', 818 language: 'dk', 819 searchInputs: ['cludo-search-form'], 820 template: 'InlineBasic', 821 hideSearchFilters: true, 822 focusOnResultsAfterSearch: true, 823 type: 'inline' 824 }; 825 CludoSearch = new Cludo(cludoSettings); 826 CludoSearch.init(); 827 })(); 828 </script> 829 830 831 </body> 832 </html> 833 834 @helper RenderTopNavigationNodes(IEnumerable<Dynamicweb.Frontend.Navigation.NavigationTreeNodeViewModel> nodes) 835 { 836 <ul class="navbar-nav ms-auto"> 837 @foreach (Dynamicweb.Frontend.Navigation.NavigationTreeNodeViewModel node in nodes) { 838 string navItemClass = "nav-item"; 839 string navLinkClass = "nav-link"; 840 if (node.InPath) { 841 //navItemClass += " inpath"; 842 navLinkClass += " inpath"; 843 } 844 if (node.IsActive) { 845 //navItemClass += " active"; 846 navLinkClass += " active"; 847 } 848 849 if (!node.Nodes.Any()) { 850 <li class="@navItemClass"> 851 <a class="@navLinkClass" href="@node.Link">@node.Name</a> 852 </li> 853 } else { 854 navLinkClass += " dropdown-toggle"; 855 navItemClass += " dropdown"; 856 <li class="@navItemClass"> 857 <a href="#" id="dropdown-@node.PageId" class="@navLinkClass" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> 858 @node.Name 859 </a> 860 <ul class="dropdown-menu" aria-labelledby="dropdown-@node.PageId"> 861 @foreach (var i in node.Nodes) { 862 <li> 863 <a class="dropdown-item" href="@i.Link">@i.Name</a> 864 </li> 865 } 866 </ul> 867 </li> 868 } 869 } 870 </ul> 871 } 872 873 @helper RenderMainNavigationRootNodes(IEnumerable<Dynamicweb.Frontend.Navigation.NavigationTreeNodeViewModel> nodes) 874 { 875 <ul class="nav navbar-nav w-100"> 876 @foreach (Dynamicweb.Frontend.Navigation.NavigationTreeNodeViewModel node in nodes) { 877 string navItemClass = "nav-item"; 878 string navLinkClass = "nav-link"; 879 if (node.InPath) { 880 //navItemClass += " inpath"; 881 navLinkClass += " inpath"; 882 } 883 if (node.IsActive) { 884 //navItemClass += " active"; 885 navLinkClass += " active"; 886 } 887 if (!node.Nodes.Any()) { 888 <li class="@navItemClass"> 889 <a class="nav-link" href="@node.Link">@node.Name</a> 890 </li> 891 } else { 892 navLinkClass += " dropdown-toggle"; 893 navItemClass += ""; 894 <li class="@navItemClass"> 895 <a href="#" id="dropdown-@node.PageId" class="@navLinkClass" data-toggle="dropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"> 896 @node.Name 897 </a> 898 <div class="dropdown-menu main-nav-mega-content w-100" aria-labelledby="dropdown-@node.PageId"> 899 <div class="container"> 900 <div class="row"> 901 @foreach (var i in node.Nodes) { 902 string subNavLinkClass = "dropdown-item"; 903 if (i.InPath) { 904 subNavLinkClass += " inpath"; 905 } 906 if (i.IsActive) { 907 subNavLinkClass += " active"; 908 } 909 var subPage = Dynamicweb.Services.Pages.GetPage(i.PageId); 910 string subPageSummary = subPage.Item != null ? "" + subPage.Item["Summary"] : ""; 911 //string subPageName = i.Name.Replace(", ", " / ").Replace(" og ", " / "); 912 <div class="nav-item col-12 col-md-6 col-lg-6 mb-4"> 913 <a class="@subNavLinkClass h-100" href="@i.Link"> 914 @i.Name 915 @if (!string.IsNullOrWhiteSpace(subPageSummary)) { 916 <p class="">@subPageSummary</p> 917 } 918 </a> 919 </div> 920 } 921 </div> 922 </div> 923 </div> 924 </li> 925 } 926 } 927 </ul> 928 } 929