Error executing template "Designs/TwenteBranding/_parsed/EventArticle.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_e36b52d3442f4378acc122e2c268b1f6.Execute() in D:\inetpub\wwwroot\www.twente.com\Files\Templates\Designs\TwenteBranding\_parsed\EventArticle.parsed.cshtml:line 347
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.b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 @using TwenteBranding.Repository.Helpers 3 4 @{ 5 Title("Master view model template"); 6 Description("Master view model template"); 7 var currentPageView = Dynamicweb.Frontend.PageView.Current(); 8 var contentLanguage = currentPageView.GlobalTags.GetTagByName("Global:Area.Lang").Value; 9 var scheme = currentPageView.GlobalTags.GetTagByName("Global:Request.Scheme").Value; 10 var host = currentPageView.GlobalTags.GetTagByName("Global:Request.Host").Value; 11 var requestHost = string.Format("{0}://{1}", scheme, host); 12 var metaDescription = Model.Description; 13 var metaKeywords = Model.Keywords; 14 15 var appJs = FileHelper.GetFilenameWithTimeStamp("/Files/Templates/Designs/TwenteBranding/js/app.min.js"); 16 var appCss = FileHelper.GetFilenameWithTimeStamp("/Files/Templates/Designs/TwenteBranding/css/main.min.css"); 17 18 19 <html lang="@contentLanguage"> 20 <head> 21 <title>@Model.Title</title> 22 @if (!string.IsNullOrWhiteSpace(metaDescription)) 23 { 24 <meta name="description" content="@metaDescription"/> 25 } 26 @if (!string.IsNullOrWhiteSpace(metaKeywords)) 27 { 28 <meta name="keywords" content="@metaKeywords"/> 29 } 30 <meta http-equiv="content-language" content='@contentLanguage'/> 31 <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 32 <meta http-equiv="imagetoolbar" content="no"/> 33 <meta http-equiv="x-dns-prefetch-control" content="on"/> 34 <meta http-equiv="x-ua-compatible" content="ie=edge"/> 35 <meta name="viewport" content="width=device-width,initial-scale=1"> 36 <meta name="application-name" content="innovadis.com"/> 37 <meta name="author" content="Innovadis BV, Enschede"/> 38 <meta name="copyright" content='Innovadis BV, Enschede, @DateTime.Now.Year'/> 39 <meta name="web_author" content="Innovadis BV, Enschede"/> 40 <link rel="dns-prefetch" href='@requestHost'/> 41 <link rel="icon" href="/favicon.ico" type="image/x-icon"/> 42 <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/> 43 <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" type="text/css" rel="stylesheet"/> 44 <link rel="stylesheet" type="text/css" href="@appCss"/> 45 <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Ubuntu:300i,400,500,700&display=swap" rel="stylesheet"> 46 @{ var gaHeadCode = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Analytics.GoogleAnalyticsTrackingCode); 47 if (!string.IsNullOrWhiteSpace(gaHeadCode)) 48 { 49 <script> 50 (function (i, s, o, g, r, a, m) { 51 i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { 52 (i[r].q = i[r].q || []).push(arguments) 53 }, i[r].l = 1 * new Date(); a = s.createElement(o), 54 m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) 55 })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); 56 57 ga('create', '@gaHeadCode', 'auto'); 58 ga('send', 'pageview'); 59 </script> 60 } 61 } 62 @{ var gtmHeadCode = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Analytics.GoogleTagManagerTrackingCode); 63 if (!string.IsNullOrWhiteSpace(gtmHeadCode)) 64 { 65 <script> 66 (function (w, d, s, l, i) { 67 w[l] = w[l] || []; w[l].push({ 68 'gtm.start': 69 new Date().getTime(), event: 'gtm.js' 70 }); var f = d.getElementsByTagName(s)[0], 71 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 72 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 73 })(window, document, 'script', 'dataLayer', '@gtmHeadCode');</script> 74 } 75 } 76 @RenderSnippet("HeadSection") 77 78 @* Print alternate links and content-language meta tags *@ 79 @LanguageHelper.GetMasterLanguageTags(Model.ID) 80 @{ var gtmBodyCode = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Analytics.GoogleTagManagerTrackingCode); 81 if (!string.IsNullOrWhiteSpace(gtmBodyCode)) 82 { 83 var gtmUrl = string.Format("https://www.googletagmanager.com/ns.html?id={0}", gtmBodyCode); 84 <noscript> 85 <iframe src="@gtmUrl" height="0" width="0" style="display:none;visibility:hidden"></iframe> 86 </noscript> 87 } 88 } 89 @{ 90 var trengoKey = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Trengo.Key); 91 if (!string.IsNullOrWhiteSpace(trengoKey)) 92 { 93 <script type="text/javascript"> 94 window.Trengo = window.Trengo || {}; 95 window.Trengo.key = "@trengoKey"; 96 97 (function(d, script, t) { 98 script = d.createElement('script'); 99 script.type = 'text/javascript'; 100 script.async = true; 101 script.src = 'https://static.widget.trengo.eu/embed.js'; 102 d.getElementsByTagName('head')[0].appendChild(script); 103 }(document)); 104 105 </script> 106 } 107 } 108 @{ 109 var hotjarKey = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Hotjar.Key); 110 if (!string.IsNullOrWhiteSpace(hotjarKey)) 111 { 112 <!-- Hotjar Tracking Code --> 113 <script> 114 (function(h,o,t,j,a,r){ 115 h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; 116 h._hjSettings={hjid:@hotjarKey,hjsv:6}; 117 a=o.getElementsByTagName('head')[0]; 118 r=o.createElement('script');r.async=1; 119 r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; 120 a.appendChild(r); 121 })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv='); 122 </script> 123 } 124 } 125 </head> 126 <body> 127 <main class="twentebranding-container"> 128 @using Dynamicweb.Content 129 @using Dynamicweb.Ecommerce.International 130 @using TwenteBranding.Repository.Helpers 131 @using Page = System.Web.UI.Page 132 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 133 @{ 134 var websiteLanguages = Model.Area.Languages; 135 List<Dynamicweb.Content.Page> topNavigationPages = null; 136 137 int topNavigationFolderId = GetPageIdByNavigationTag("TopNavigation"); 138 if (topNavigationFolderId > 0) 139 { 140 var pageService = new Dynamicweb.Content.PageService(); 141 var topNavigationPageList = pageService.GetPagesByParentID(topNavigationFolderId); 142 if (topNavigationPageList != null && topNavigationPageList.Any()) 143 { 144 topNavigationPages = topNavigationPageList.Where(p => p.Active).ToList(); 145 } 146 } 147 148 var homelinkImage = IconHelper.GetSvgPath("twente", "logo/"); 149 150 <div id="homelink"> 151 <a href="/" target="_top" title="@string.Format(" {0}: {1}", Translate("LinkTitlePrefix", "Navigeer naar" ), Translate("Homelink_Title", "De homepage" )).JsEncode()"><img src="@homelinkImage" alt="@Translate(" Homelink_ImageAlt", "Image met het Twentse Ros die onclick naar de homepge navigeert" )" /></a> 152 </div> 153 154 var searchResultsPageId = AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.PageIds.SearchResults); 155 156 // Top navigation Snippet 157 @SnippetStart("TopNavigation") 158 159 <div class="top-navigation"> 160 @if (topNavigationPages != null && topNavigationPages.Any()) 161 { 162 <ul class="pages"> 163 @foreach (var topNavigationPage in topNavigationPages) 164 { 165 var topNavigationPageName = topNavigationPage.GetDisplayName(); 166 var topNavigationPageTitle = string.Format("{0}: {1}", Translate("LinkTitlePrefix", "Navigeer naar"), topNavigationPageName).JsEncode(); 167 <li><a href="@string.Format("/Default.aspx?ID={0}", topNavigationPage.ID)" title="@topNavigationPageTitle" target="_top">@topNavigationPageName</a></li> 168 } 169 </ul> 170 } 171 172 @if (websiteLanguages != null && websiteLanguages.Any()) 173 { 174 <ul class="languages"> 175 @{ 176 var pageService = new PageService(); 177 var languagePages = pageService.GetLanguagePages(Model.ID); 178 179 foreach (var language in Model.Area.Languages) 180 { 181 var lang = language.Culture.Split('-')[0]; 182 var link = ""; 183 var listClass = language.IsCurrent ? "active" : ""; 184 var langTitle = string.Format("{0}: {1}", Translate("LinkTitlePrefix", "Navigeer naar"), language.Name).JsEncode(); 185 186 if (language.IsMaster && !language.IsCurrent) 187 { 188 var masterAreaPage = pageService.GetPagesByAreaID(1).SingleOrDefault(p => p.GetLanguageVersion(Model.Area.ID) != null && p.GetLanguageVersion(Model.Area.ID).ID.Equals(Model.ID)); 189 if (masterAreaPage != null) 190 { 191 link = string.Format("/Default.aspx?ID={0}", masterAreaPage.ID); 192 } 193 } 194 else if (language.IsCurrent) 195 { 196 link = "javascript:void(0);"; 197 } 198 else 199 { 200 foreach (var languagePage in languagePages) 201 { 202 var languageAreaId = language.ID; 203 if (languageAreaId == languagePage.AreaId) 204 { 205 link = string.Format("/Default.aspx?ID={0}", languagePage.ID); 206 } 207 } 208 } 209 210 //TODO: querystring? 211 212 <li class="@listClass" title="@langTitle"><a href="@link" target="_top">@lang</a></li> 213 } 214 } 215 </ul> 216 } 217 </div> 218 219 @SnippetEnd("TopNavigation") 220 221 // navigation SM 222 <div id="header_mobile" class="d-block d-md-none" data-hometext="@Translate("Navigation_HomeText", "Home")"> 223 <div class="header-mobile-icons"> 224 <a id="mobile-menu-button" class="icon-color--gray-4 icon--hamburger menu-icon"></a> 225 <a id="mobile-search-button" class="icon-color--gray-4 icon--search menu-icon"></a> 226 <a id="mobile-close-button" class="icon-color--gray-4 icon--cross menu-icon"></a> 227 </div> 228 <nav id="mobile-nav" class="navigation-mobile"> 229 @RenderNavigation(new { StartLevel = 1, EndLevel = 2, Template = "LIClean-mobile.xslt", Expandmode = "All" }) 230 <div class="mobile-topnavigation"> 231 @RenderSnippet("TopNavigation") 232 </div> 233 </nav> 234 <div id="mobile-navigation-submenu"></div> 235 236 <div id="mobile-search" class="search-mobile"> 237 @if (!string.IsNullOrWhiteSpace(searchResultsPageId)) 238 { 239 var searchResultUrl = string.Format("/Default.aspx?ID={0}", searchResultsPageId); 240 <div id="searchFormMobile" data-target="@searchResultUrl"> 241 <div class="top-search"> 242 <div class="input-group"> 243 <input type="text" class="form-control" name="q" id="q" placeholder="@Translate(" Searchbar_Placeholder", "Zoeken" )" aria-label="@Translate(" Searchbar_AriaLabel", "Zoeken" )"> 244 <div class="input-group-append"> 245 <button class="btn icon--search icon-color--gray-4 icon-size--x1 search-button-mobile" type="button" aria-label="search"></button> 246 </div> 247 </div> 248 </div> 249 </div> 250 @SnippetStart("JavascriptBottom") 251 <script> 252 $(document).ready(function () { 253 $(".search-button-mobile, #searchFormMobile").off("click").on("click", function () { 254 SearchHelper.SearchMobile(); 255 }); 256 $("#q, #searchFormMobile").keypress(function (e) { 257 if (e.which == 13) { 258 SearchHelper.SearchMobile(); 259 return false; 260 } 261 }); 262 }); 263 </script> 264 @SnippetEnd("JavascriptBottom") 265 266 } 267 </div> 268 </div> 269 270 // navigation MD+ 271 <div id="header" class="d-none d-md-block"> 272 <div class="container"> 273 274 @RenderSnippet("TopNavigation") 275 276 <nav id="navigation" data-hometext="@Translate("Navigation_HomeText", "Home")"> 277 @RenderNavigation(new { StartLevel = 1, EndLevel = 2, Template = "LIClean.xslt", Expandmode = "All" }) 278 </nav> 279 280 @if (!string.IsNullOrWhiteSpace(searchResultsPageId)) 281 { 282 var searchResultUrl = string.Format("/Default.aspx?ID={0}", searchResultsPageId); 283 <div id="searchForm" data-target="@searchResultUrl"> 284 <div class="top-search"> 285 <div class="input-group"> 286 <input type="text" class="form-control" name="q" id="q" placeholder="@Translate(" Searchbar_Placeholder", "Zoeken" )" aria-label="@Translate(" Searchbar_AriaLabel", "Zoeken" )"> 287 <div class="input-group-append"> 288 <button class="btn icon--search icon-color--gray-4 icon-size--x1 search-button" type="button" aria-label="search"></button> 289 </div> 290 </div> 291 </div> 292 </div> 293 294 @SnippetStart("JavascriptBottom") 295 <script> 296 $(document).ready(function () { 297 $(".search-button, #searchForm").off("click").on("click", function () { 298 SearchHelper.Search(); 299 }); 300 $("#q, #searchForm").keypress(function (e) { 301 if (e.which == 13) { 302 SearchHelper.Search(); 303 return false; 304 } 305 }); 306 }); 307 </script> 308 @SnippetEnd("JavascriptBottom") 309 } 310 </div> 311 <div id="navigation-submenu"></div> 312 </div> 313 } 314 <main> 315 @using Dynamicweb.Core 316 @using TwenteBranding.Repository.Helpers 317 @using TwenteBranding.Models.Constants 318 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 319 @Description("View model template for an event article") 320 321 @{ 322 var pService = new Dynamicweb.Content.PageService(); 323 var iService = new Dynamicweb.Content.ItemService(); 324 var pageView = Dynamicweb.Frontend.PageView.Current(); 325 var culture = pageView.GlobalTags.GetTagByName("Global:Area.LongLang").Value; 326 var itemPageId = pageView.ID; 327 var sidebar = pService.GetPageByNavigationTag(Model.Area.ID, StringConstants.NavigationTags.EventArticleSidebar); 328 329 var item = ItemHelper.GetTwenteBrandingItemForPage(Model.ItemId, itemPageId.ToString(), culture, pService, iService); 330 if (item != null) 331 { 332 var hashtag = item.MainHashtag.IsNotNullOrEmpty() ? string.Format("#{0}", item.MainHashtag) : string.Format("#{0}", item.MainHashtagEnglish); 333 334 var goalName = item.GoalName; 335 var background = goalName.FixNameForClass(); 336 var goalType = item.GoalType; 337 var gradientCss = item.GoalGradientCss; 338 var goalIconHeader = item.GoalIconHeader; 339 340 var title = Model.Item.GetString("Title"); 341 var introduction = Model.Item.GetString("Text"); 342 343 var headerImage = ""; 344 345 if (Model.Item.Fields.Where(x => x.SystemName.Contains("Image")).Count() > 0) 346 { 347 headerImage = Model.Item.GetFile("ImageLarge").Path; 348 if (string.IsNullOrWhiteSpace(headerImage)) 349 { 350 headerImage = Model.Item.GetFile("ImageWide").Path; 351 if (string.IsNullOrWhiteSpace(headerImage)) 352 { 353 headerImage = Model.Item.GetString("Image"); 354 } 355 } 356 headerImage = $"/Admin/Public/GetImage.ashx?Image={headerImage}&Format=webp&Width=700&Height=-1&Quality=100&Crop=0&t=2"; 357 } 358 359 var fontColor = item.HeaderFontColor; 360 var eventWhen = item.EventPeriodDatesOnly; 361 var eventTime = item.EventPeriodTimesOnly; 362 var eventOrganizer = item.EventOrganizer; 363 var eventLocation = item.EventLocation; 364 365 <div class="main-container"> 366 <div class="page-title article-title background--@background"> 367 <div class="container"> 368 <div class="grid header-grid"> 369 <div class="title"> 370 <h1 class="font-color--white">@title</h1> 371 @if (!string.IsNullOrWhiteSpace(introduction)) 372 { 373 <div class="sub-header">@introduction</div> 374 } 375 <div class="read-full-article font-color--white">@Translate("EventArticle_Read_Entire_Article", "Lees hieronder meer")<div class="icon--arrow-down">&nbsp;</div></div> 376 377 </div> 378 <div class="image"><img alt="global goal icon" src="@goalIconHeader" /></div> 379 </div> 380 </div> 381 </div> 382 <div class="page-content container"> 383 <div class="grid detail-grid-container"> 384 <div class="content"> 385 <div class="top"> 386 @if (!string.IsNullOrWhiteSpace(headerImage)) 387 { 388 <div class="header-image" style="background: url(@headerImage)"> 389 <div class="@gradientCss"></div> 390 </div> 391 } 392 393 <div class="event-article-details"> 394 <h3 class="event-details-title info">@Translate("EventArticle_Title", "Event details")</h3> 395 <div class="grid cols-2 event-details-content"> 396 <div class="left"> 397 <div> 398 @Translate("EventArticle_When", "Wanneer"): 399 </div> 400 <div>@eventWhen</div> 401 <div> 402 @Translate("EventArticle_Time", "Tijd"): 403 </div> 404 <div>@eventTime</div> 405 <div> 406 @Translate("EventArticle_Organizer", "Organisator"): 407 </div> 408 <div>@eventOrganizer</div> 409 </div> 410 <div class="right"> 411 <div> 412 @Translate("EventArticle_Location", "Locatie"): 413 </div> 414 <div>@eventLocation.NewlineToBr()</div> 415 </div> 416 </div> 417 </div> 418 </div> 419 @Model.Placeholder("Content") 420 421 </div> 422 423 @{ 424 if (sidebar != null) 425 { 426 <div class="sidebar"> 427 @RenderPageContent(sidebar.ID) 428 </div> 429 } 430 } 431 432 @if (Model.Placeholder("Bottom").Any()) 433 { 434 <div class="bottom"> 435 @Model.Placeholder("Bottom") 436 </div> 437 } 438 439 </div> 440 </div> 441 </div> 442 } 443 else 444 { 445 <div>No-Item</div> 446 } 447 } 448 </main> 449 @using Dynamicweb.Frontend 450 @using TwenteBranding.Models.Constants 451 @using TwenteBranding.Repository.Helpers 452 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 453 454 @{ 455 var hashTags = AreaHelper.GetFooterHashTags(Model); 456 var hashTagsTitleField = Model.Area.Item.GetField(StringConstants.ItemInstanceType.FooterTagsTitle).GetValue(); 457 var hashTagsTitle = hashTagsTitleField == null ? "" : hashTagsTitleField.ToString(); 458 if (hashTags.Count > 0) 459 { 460 <div class="background--gray-1"> 461 462 <div class="hashtags-container container"> 463 @{ 464 if (!string.IsNullOrEmpty(hashTagsTitle)) 465 { 466 <div class="title"> 467 @hashTagsTitle 468 </div> 469 } 470 } 471 <div class="hashtags font-color--twente-red"> 472 @foreach (var tag in hashTags) 473 { 474 <a href="@SearchEngineFriendlyURLs.GetFriendlyUrl(tag.ID)">#@tag.MenuText</a> 475 } 476 </div> 477 </div> 478 </div> 479 } 480 } 481 482 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 483 <footer class="background--twente-red"> 484 <div class="container"> 485 <div class="social-media-icon-container"> 486 @using TwenteBranding.Repository.Helpers 487 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 488 489 @if (Model.Area.Item != null) 490 { 491 <ul> 492 @foreach (var field in Model.Area.Item.Fields.Where(f => f.SystemName.StartsWith("Sm_"))) 493 { 494 if (!string.IsNullOrEmpty(field.GetString())) 495 { 496 <li> 497 <a rel="noopener" aria-label="@field.Name.JsEncode()" href="@field.GetString()" title="@field.Name.JsEncode()" target="_blank"> 498 <div class="social-media-icon icon--@field.SystemName.ToLower() icon-size--x2"></div> 499 </a> 500 </li> 501 } 502 } 503 </ul> 504 } 505 </div> 506 <div class="footer-link-container"> 507 @{ 508 List<Dynamicweb.Content.Page> footerNavigationPages = null; 509 int footerNavigationFolderId = GetPageIdByNavigationTag(TwenteBranding.Models.Constants.StringConstants.NavigationTags.FooterNavigation); 510 if (footerNavigationFolderId > 0) 511 { 512 var pageService = new Dynamicweb.Content.PageService(); 513 var footerNavigationPageList = pageService.GetPagesByParentID(footerNavigationFolderId); 514 if (footerNavigationPageList != null && footerNavigationPageList.Any()) 515 { 516 footerNavigationPages = footerNavigationPageList.Where(p => p.Active).ToList(); 517 if (footerNavigationPages != null && footerNavigationPages.Any()) 518 { 519 var footerLinkCounter = 1; 520 foreach (var footerNavigationPage in footerNavigationPages) 521 { 522 var footerNavigationPageName = footerNavigationPage.GetDisplayName(); 523 var footerNavigationPageTitle = string.Format("{0}: {1}", Translate("LinkTitlePrefix", "Navigeer naar"), footerNavigationPageName).JsEncode(); 524 var footerNavigationPageLink = string.Format("/Default.aspx?ID={0}", footerNavigationPage.ID); 525 526 if (footerNavigationPages.Count() == footerLinkCounter) 527 { 528 var copyRight = string.Format(Translate("Footer_CopyRight", "&copy; {0} Twente Branding"), DateTime.Now.Year); 529 530 <div class="footer-link-wrapper"> 531 <div class="footer-link"> 532 <a href="@footerNavigationPageLink" title="@footerNavigationPageTitle">@footerNavigationPageName</a> 533 </div> 534 <div class="footer-link"><span>@copyRight</span></div> 535 </div> 536 } 537 else 538 { 539 <div class="footer-link"> 540 <a href="@footerNavigationPageLink" title="@footerNavigationPageTitle">@footerNavigationPageName</a> 541 </div> 542 } 543 footerLinkCounter++; 544 } 545 } 546 } 547 } 548 } 549 </div> 550 </div> 551 </footer> 552 553 </main> 554 <aside> 555 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 556 @using Dynamicweb.Core 557 @using TwenteBranding.Repository.Helpers 558 @using System.Linq; 559 @using TwenteBranding.Models.ViewModels 560 561 @{ 562 var newsletterSubscriptionModalPageId = GetPageIdByNavigationTag("NewsletterSubscriptionModal"); 563 var jobAlertSubscriptionModalPageId = GetPageIdByNavigationTag("JobAlertSubscriptionModal"); 564 var jobOffersPageId = GetPageIdByNavigationTag("JobOffers"); 565 var jobOfferParentPageId = Dynamicweb.Frontend.PageView.Current().Page.ParentPageId; 566 var utmCampaign = System.Web.HttpContext.Current.Request.QueryString.Get("utm_campaign"); 567 var mainHashtagModal = ""; 568 569 // Specific pages which must not show a subscription modal (jobalert/newsletter) 570 var twenteLeeftPageId = GetPageIdByNavigationTag("MOT_TwenteLeeft"); 571 var jobAlertSubscription = GetPageIdByNavigationTag("JobAlertSubscription"); 572 var pageIdsWithoutModal = new List<int> { twenteLeeftPageId, jobAlertSubscription }; 573 574 // Get the item for the current page 575 TwenteBrandingItemModel pItem = null; 576 if (Model.ItemId != "1") //Item with ID 1 gives error 577 { 578 pItem = ItemHelper.GetTwenteBrandingItemForPage( 579 Model.ItemId, 580 Dynamicweb.Frontend.PageView.Current().ID.ToString(), 581 Dynamicweb.Frontend.PageView.Current().GlobalTags.GetTagByName("Global:Area.LongLang").Value 582 ); 583 } 584 585 if (pItem != null) 586 { 587 // Get main hashtag of the current page item 588 var mainHashtagId = pItem.MainHashtagIds.FirstOrDefault(); 589 if (!string.IsNullOrEmpty(mainHashtagId)) 590 { 591 var hashtagItem = Dynamicweb.Content.Items.Item.GetItemById(TwenteBranding.Models.Constants.StringConstants.ItemInstanceType.Hashtag, mainHashtagId); 592 mainHashtagModal = $"{ItemHelper.GetItemValue<string>(hashtagItem, TwenteBranding.Models.Constants.StringConstants.CustomItemTypes.BaseArticle.Title)}"; 593 } 594 } 595 596 // Dont show a modal on the following pages 597 if (pageIdsWithoutModal.Contains(Model.ID) || mainHashtagModal == "talent") 598 { 599 //do noting 600 } 601 else 602 { 603 // Show modal with link to vacancysubscription page on vacancy page and pages with #talent hashtag 604 if ((Model.ID == jobOffersPageId || jobOfferParentPageId == jobOffersPageId) 605 && jobAlertSubscriptionModalPageId > 0) 606 { 607 @RenderPageContent(jobAlertSubscriptionModalPageId) 608 } 609 // If the jobalert modal pageId has a value and utmCampaing matches the specified value 610 else if (jobAlertSubscriptionModalPageId > 0 && utmCampaign == "Remarketing vacaturebank") 611 { 612 @RenderPageContent(jobAlertSubscriptionModalPageId) 613 } 614 // Else if the newsletter pageId has a value, show the newsletter subscription modal 615 else if (newsletterSubscriptionModalPageId > 0) 616 { 617 @RenderPageContent(newsletterSubscriptionModalPageId) 618 } 619 } 620 } 621 </aside> 622 <script rel="prefetch" src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> 623 <script acync rel="prefetch" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script> 624 <script rel="prefetch" type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.lazy/1.7.9/jquery.lazy.min.js"></script> 625 <script rel="prefetch" type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.lazy/1.7.9/jquery.lazy.plugins.min.js"></script> 626 627 <script src="@appJs"></script> 628 @RenderSnippet("JavascriptBottom") 629 </body> 630 </html> 631 }