Error executing template "Designs/TwenteBranding/_parsed/JobOfferArticle.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at Dynamicweb.Content.ItemService.GetItemByPageId(Int32 pageId, Boolean draft, DateTime previewDate)
at CompiledRazorTemplates.Dynamic.RazorEngine_03e211566e4c4b5ebe8b682591f99cec.Execute() in D:\inetpub\wwwroot\www.twente.com\Files\Templates\Designs\TwenteBranding\_parsed\JobOfferArticle.parsed.cshtml:line 513
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 @using TwenteBranding.Repository.Helpers 3 @using TwenteBranding.Models.Constants 4 @using TwenteBranding.Models.Items.Pages 5 @using Dynamicweb.Frontend 6 @{ 7 Title("Master view model template"); 8 Description("Master view model template"); 9 var currentPageView = Dynamicweb.Frontend.PageView.Current(); 10 var contentLanguage = currentPageView.GlobalTags.GetTagByName("Global:Area.Lang").Value; 11 var scheme = currentPageView.GlobalTags.GetTagByName("Global:Request.Scheme").Value; 12 var host = currentPageView.GlobalTags.GetTagByName("Global:Request.Host").Value; 13 var requestHost = string.Format("{0}://{1}", scheme, host); 14 var metaDescription = Model.Description; 15 var metaKeywords = Model.Keywords; 16 var homepage = Dynamicweb.Services.Pages.GetPageByNavigationTag(Model.Area.ID, StringConstants.NavigationTags.Homepage); 17 var homepageUrl = SearchEngineFriendlyURLs.GetFriendlyUrl(homepage.ID); 18 var appJs = FileHelper.GetFilenameWithTimeStamp("/Files/static/twentebranding/main.js"); 19 var appCss = FileHelper.GetFilenameWithTimeStamp("/Files/static/twentebranding/main.css"); 20 var customJs = FileHelper.GetFilenameWithTimeStamp("/Files/static/twentebranding/custom.js"); 21 var showMainNavigation = true; // default show main navigation 22 if (Equals(Model.ItemType, nameof(CampaignPage)) && !Model.Item.GetBoolean("ShowMainMenu")) { showMainNavigation = false; } // campaign page items have option to show main navigation, where the default is hide 23 if (Equals(Model.ItemType, nameof(MiniWebsitePage)) && Model.Item.GetBoolean("HideMainMenu")) { showMainNavigation = false; } // mini website page items have option to hide main navigation, where the default is show 24 <html lang="@contentLanguage"> 25 <head> 26 <title>@Model.Title</title> 27 @if (!string.IsNullOrWhiteSpace(metaDescription)) 28 { 29 <meta name="description" content="@metaDescription" /> 30 } 31 @if (!string.IsNullOrWhiteSpace(metaKeywords)) 32 { 33 <meta name="keywords" content="@metaKeywords" /> 34 } 35 <meta http-equiv="content-language" content='@contentLanguage' /> 36 <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 37 <meta http-equiv="imagetoolbar" content="no" /> 38 <meta http-equiv="x-dns-prefetch-control" content="on" /> 39 <meta http-equiv="x-ua-compatible" content="ie=edge" /> 40 <meta name="viewport" content="width=device-width,initial-scale=1"> 41 <meta name="application-name" content="innovadis.com" /> 42 <meta name="author" content="Innovadis BV, Enschede" /> 43 <meta name="copyright" content='Innovadis BV, Enschede, @DateTime.Now.Year' /> 44 <meta name="web_author" content="Innovadis BV, Enschede" /> 45 <link rel="dns-prefetch" href='@requestHost' /> 46 <link rel="icon" href="/favicon.ico" type="image/x-icon" /> 47 <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> 48 <link rel="stylesheet" type="text/css" href="@appCss" /> 49 <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Ubuntu:300i,400,500,700&display=swap" 50 rel="stylesheet"> 51 <script rel="prefetch" src="https://cdn.jsdelivr.net/jquery/2.2.4/jquery.min.js" 52 integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> 53 <script acync rel="prefetch" 54 src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script> 55 <script rel="prefetch" type="text/javascript" 56 src="//cdnjs.cloudflare.com/ajax/libs/jquery.lazy/1.7.9/jquery.lazy.min.js"></script> 57 <script rel="prefetch" type="text/javascript" 58 src="//cdnjs.cloudflare.com/ajax/libs/jquery.lazy/1.7.9/jquery.lazy.plugins.min.js"></script> 59 @{ var gaHeadCode = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Analytics.GoogleAnalyticsTrackingCode); 60 if (!string.IsNullOrWhiteSpace(gaHeadCode)) 61 { 62 <script> 63 (function (i, s, o, g, r, a, m) { 64 i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { 65 (i[r].q = i[r].q || []).push(arguments) 66 }, i[r].l = 1 * new Date(); a = s.createElement(o), 67 m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) 68 })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); 69 70 ga('create', '@gaHeadCode', 'auto'); 71 ga('send', 'pageview'); 72 </script> 73 } 74 } 75 @{ var gtmHeadCode = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Analytics.GoogleTagManagerTrackingCode); 76 if (!string.IsNullOrWhiteSpace(gtmHeadCode)) 77 { 78 <script> 79 (function (w, d, s, l, i) { 80 w[l] = w[l] || []; w[l].push({ 81 'gtm.start': 82 new Date().getTime(), event: 'gtm.js' 83 }); var f = d.getElementsByTagName(s)[0], 84 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 85 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 86 })(window, document, 'script', 'dataLayer', '@gtmHeadCode');</script> 87 } 88 } 89 @RenderSnippet("HeadSection") 90 @* Print alternate links and content-language meta tags *@ 91 @LanguageHelper.GetMasterLanguageTags(Model.ID) 92 @{ var gtmBodyCode = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Analytics.GoogleTagManagerTrackingCode); 93 if (!string.IsNullOrWhiteSpace(gtmBodyCode)) 94 { 95 var gtmUrl = string.Format("https://www.googletagmanager.com/ns.html?id={0}", gtmBodyCode); 96 <noscript> 97 <iframe src="@gtmUrl" height="0" width="0" style="display:none;visibility:hidden"></iframe> 98 </noscript> 99 } 100 } 101 @*@{ 102 var trengoKey = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Trengo.Key); 103 if (!string.IsNullOrWhiteSpace(trengoKey)) 104 { 105 <script type="text/javascript"> 106 window.Trengo = window.Trengo || {}; 107 window.Trengo.key = "@trengoKey"; 108 109 //TWB-802 - hide the message container 110 window.Trengo.on_ready = function () { 111 $(".message-container", $('iframe.trengo-vue-iframe').contents()).hide(); 112 }; 113 114 (function(d, script, t) { 115 script = d.createElement('script'); 116 script.type = 'text/javascript'; 117 script.async = true; 118 script.src = 'https://static.widget.trengo.eu/embed.js'; 119 d.getElementsByTagName('head')[0].appendChild(script); 120 }(document)); 121 122 </script> 123 } 124 }*@ 125 @{ 126 var hotjarKey = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Hotjar.Key); 127 if (!string.IsNullOrWhiteSpace(hotjarKey)) 128 { 129 <!-- Hotjar Tracking Code --> 130 <script> 131 (function(h,o,t,j,a,r){ 132 h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; 133 h._hjSettings={hjid:@hotjarKey,hjsv:6}; 134 a=o.getElementsByTagName('head')[0]; 135 r=o.createElement('script');r.async=1; 136 r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; 137 a.appendChild(r); 138 })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv='); 139 </script> 140 } 141 } 142 <script> 143 window.STORE_DATA = { 144 googleMapsApiToken: "@AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.GoogleMaps.GoogleMapsApiToken)" 145 } 146 </script> 147 </head> 148 <body> 149 <div id='app'> 150 @if (showMainNavigation) 151 { 152 <text> 153 @using Dynamicweb.Frontend; 154 @using Dynamicweb.Frontend.Navigation; 155 @using Dynamicweb.Security.Permissions; 156 @using TwenteBranding.Repository.Helpers; 157 @using Dynamicweb.Security.UserManagement; 158 159 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 160 @{ 161 List<Dynamicweb.Content.Page> topNavigationPages = null; 162 var areaId = Dynamicweb.Frontend.PageView.Current().AreaID; 163 var topNavigationFolderId = GetPageIdByNavigationTag("TopNavigation"); 164 var searchResultsPageId = AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.PageIds.SearchResults); 165 var searchUrl = $"/Default.aspx?ID={searchResultsPageId}"; 166 var languagePages = Dynamicweb.Services.Pages.GetLanguagePages(Model.ID); 167 var navigationModel = Navigation.GetNavigationViewModel(new NavigationSettings { StartLevel = 1, StopLevel = 1, ExpandMode = ExpandMode.All }); 168 var masterAreaPage = Dynamicweb.Services.Pages.GetPagesByAreaID(1).SingleOrDefault(page => page.GetLanguageVersion(Model.Area.ID) != null && page.GetLanguageVersion(Model.Area.ID).ID.Equals(Model.ID)); 169 var loginPageId = Dynamicweb.Services.Pages.GetPageByNavigationTag(areaId, TwenteBranding.Models.Constants.StringConstants.NavigationTags.LoginPage)?.ID ?? 0; 170 var logoffPageId = Dynamicweb.Services.Pages.GetPageByNavigationTag(areaId, TwenteBranding.Models.Constants.StringConstants.NavigationTags.LogoffPage)?.ID ?? 0; 171 var myTwentePageId = Dynamicweb.Services.Pages.GetPageByNavigationTag(areaId, TwenteBranding.Models.Constants.StringConstants.NavigationTags.MyTwentePage)?.ID ?? 0; 172 var profilePageId = Dynamicweb.Services.Pages.GetPageByNavigationTag(areaId, TwenteBranding.Models.Constants.StringConstants.NavigationTags.CompanyProfile)?.ID ?? 0; 173 var cartPageId = Dynamicweb.Services.Pages.GetPageByNavigationTag(areaId, TwenteBranding.Models.Constants.StringConstants.NavigationTags.Cart)?.ID ?? 0; 174 var cartPartnerProductsPageId = Dynamicweb.Services.Pages.GetPageByNavigationTag(areaId, TwenteBranding.Models.Constants.StringConstants.NavigationTags.CartPartnerProducts)?.ID ?? 0; 175 var matchmakerPageId = Dynamicweb.Services.Pages.GetPageByNavigationTag(areaId, TwenteBranding.Models.Constants.StringConstants.NavigationTags.TwentseMatchMakerPage)?.ID ?? 0; 176 177 if (topNavigationFolderId > 0) 178 { 179 var topNavigationPageList = Dynamicweb.Services.Pages.GetPagesByParentID(topNavigationFolderId); 180 if (topNavigationPageList != null && topNavigationPageList.Any()) 181 { 182 topNavigationPages = topNavigationPageList.Where(p => p.Active).ToList(); 183 } 184 } 185 186 var extranetPageIds = new List<int>(); 187 extranetPageIds.Add(logoffPageId); 188 extranetPageIds.Add(matchmakerPageId); 189 190 <header class="navigation-header"> 191 <div class="navigation-header__container container"> 192 193 <div class="navigation-header__top-bar"> 194 @if (topNavigationPages != null && topNavigationPages.Any()) 195 { 196 foreach (var topNavigationPage in topNavigationPages) 197 { 198 // NOTE: For login-, logoff- and profilepage permissions have been configured in the CMS. But sometimes the links appear when they should not. 199 // Therefore some lame continues have been added to force them not to render when they shouldn't 200 201 // Preventing us from rendering the login page link when the user is already logged in 202 if (Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn() && 203 Equals(topNavigationPage.ID, loginPageId)) 204 { 205 continue; 206 } 207 208 // Preventing us from rendering the extranet content when the user is not logged in 209 if (!Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn() && 210 extranetPageIds.Contains(topNavigationPage.ID)) 211 { 212 continue; 213 } 214 215 var topNavigationPageName = topNavigationPage.GetDisplayName(); 216 var topNavigationPageTitle = $"{Translate("LinkTitlePrefix", "Navigeer naar")}: {topNavigationPageName}".JsEncode(); 217 var subPages = Dynamicweb.Services.Pages.GetPagesByParentID(topNavigationPage.ID); 218 <div class="navigation-header__top-bar__item"> 219 @if (topNavigationPage.Allowclick) 220 { 221 <a href="@SearchEngineFriendlyURLs.GetFriendlyUrl(topNavigationPage.ID)" 222 title="@topNavigationPageTitle" target="_top"> 223 @topNavigationPageName 224 </a> 225 } 226 else 227 { 228 <span title="@topNavigationPageTitle" target="_top"> 229 @topNavigationPageName 230 </span> 231 } 232 @if (subPages.Any()) 233 { 234 <div class="navigation-header__top-bar__item__subnav"> 235 @foreach (var subPage in subPages) 236 { 237 238 // Preventing us from rendering the extranet content when the user is not logged in 239 if (!Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn() && 240 extranetPageIds.Contains(subPage.ID)) 241 { 242 continue; 243 } 244 245 var topNavigationSubpageName = subPage.GetDisplayName(); 246 var topNavigationSubpageTitle = $"{Translate("LinkTitlePrefix", "Navigeer naar")}: {topNavigationSubpageName}".JsEncode(); 247 <a href="@SearchEngineFriendlyURLs.GetFriendlyUrl(subPage.ID)" 248 title="@topNavigationSubpageTitle" target="_top">@topNavigationSubpageName</a> 249 } 250 </div> 251 } 252 </div> 253 254 } 255 } 256 257 @foreach (var language in Model.Area.Languages) 258 { 259 var lang = language.Culture.Split('-')[0]; 260 var link = ""; 261 var listClass = language.IsCurrent ? "active" : ""; 262 var langTitle = language.IsCurrent ? string.Empty : $"{Translate("LinkTitlePrefix", "Navigeer naar")}: {language.Name.ToUpper()}".JsEncode(); 263 var flag = $"<img src=\"/Admin/Public/GetImage.ashx?Image=/Admin/Images/Flags/flag_{language.Culture.Split('-')[1].ToLower()}.png&Crop=0&Format=webP&Height=20&Width=20&Quality=90\" border=\"0\" alt=\"{langTitle}\" />"; 264 265 if (language.IsMaster && !language.IsCurrent) 266 { 267 if (masterAreaPage != null) 268 { 269 link = SearchEngineFriendlyURLs.GetFriendlyUrl(masterAreaPage.ID); 270 } 271 } 272 else if (language.IsCurrent) 273 { 274 link = "javascript:void(0);"; 275 } 276 else 277 { 278 foreach (var languagePage in languagePages) 279 { 280 var languageAreaId = language.ID; 281 if (languageAreaId == languagePage.AreaId) 282 { 283 link = SearchEngineFriendlyURLs.GetFriendlyUrl(languagePage.ID); 284 } 285 } 286 } 287 <div class="navigation-header__top-bar__item language @listClass"><a title="@langTitle" href="@link" target="_top">@flag</a></div> 288 } 289 @if (cartPageId > 0 && cartPartnerProductsPageId > 0) 290 { 291 <a href="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(cartPartnerProductsPageId)" class="cart-pp-link hidden"><span class="icon icon--cart icon-color--white"></span></a> 292 <a href="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(cartPageId)" class="cart-link hidden"><span class="icon icon--cart icon-color--white"></span></a> 293 <span class="cart-selector hidden" onclick="EcomHelper.ShowCartSelectorModal();"><span class="icon icon--cart icon-color--white"></span></span> 294 } 295 </div> 296 297 <div class="navigation-header__menu"> 298 <a class="navigation-header__logo" href="@homepageUrl"> 299 <img src="/Files/Templates/Designs/TwenteBranding/Images/logo/LogoTwenteRGB.svg" alt="Twente Logo"> 300 </a> 301 <div class="navigation-header__menu__items"> 302 @foreach (var node in navigationModel.Nodes) 303 { 304 <a href="@node.Link" class="navigation-header__menu__items__item button button--white-border">@node.Name</a> 305 } 306 </div> 307 <div class="navigation-header__menu__langselector hidden"> 308 @foreach (var language in Model.Area.Languages) 309 { 310 var lang = language.Culture.Split('-')[0]; 311 var link = ""; 312 var listClass = language.IsCurrent ? "active" : ""; 313 var langTitle = $"{Translate("LinkTitlePrefix", "Navigeer naar")}: {language.Name}".JsEncode(); 314 var flag = $"<img src=\"/Admin/Public/GetImage.ashx?Image=/Admin/Images/Flags/flag_{language.Culture.Split('-')[1].ToLower()}.png&Crop=0&Format=webP&Height=32&Width=32&Quality=90\" border=\"0\" alt=\"{langTitle}\" />"; 315 if (language.IsMaster && !language.IsCurrent) 316 { 317 if (masterAreaPage != null) 318 { 319 link = SearchEngineFriendlyURLs.GetFriendlyUrl(masterAreaPage.ID); 320 } 321 } 322 else if (language.IsCurrent) 323 { 324 link = "javascript:void(0);"; 325 } 326 else 327 { 328 foreach (var languagePage in languagePages) 329 { 330 var languageAreaId = language.ID; 331 if (languageAreaId == languagePage.AreaId) 332 { 333 link = SearchEngineFriendlyURLs.GetFriendlyUrl(languagePage.ID); 334 } 335 } 336 } 337 <a class="mobile-menu__items__footer__item mobile-menu__items__footer__item--lang button @listClass" title="@langTitle" href="@link" target="_top">@flag</a> 338 } 339 @if (cartPageId > 0 && cartPartnerProductsPageId > 0) 340 { 341 <a href="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(cartPartnerProductsPageId)" class="cart-pp-link hidden"><span class="icon icon--cart icon-color--white"></span></a> 342 <a href="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(cartPageId)" class="cart-link hidden"><span class="icon icon--cart icon-color--white"></span></a> 343 <span class="cart-selector hidden" onclick="EcomHelper.ShowCartSelectorModal();"><span class="icon icon--cart icon-color--white"></span></span> 344 } 345 </div> 346 <div class="navigation-header__menu__search"> 347 <search-form search-url="@searchUrl" placeholder-text="@Translate("searchTwente", "Doorzoek Twente.com")"></search-form> 348 </div> 349 <mobile-menu close-button-text="@Translate("Close", "Sluit")"> 350 <template v-slot:default> 351 @foreach (var node in navigationModel.Nodes) 352 { 353 <a href="@node.Link" class="mobile-menu__items__button button button--white-border">@node.Name</a> 354 } 355 <search-form search-url="@searchUrl" placeholder-text="@Translate("searchTwente", "Doorzoek Twente.com")"></search-form> 356 </template> 357 <template v-slot:footer> 358 @if (topNavigationPages != null && topNavigationPages.Any()) 359 { 360 foreach (var topNavigationPage in topNavigationPages) 361 { 362 363 // Preventing us from rendering the login page link when the user is already logged in 364 if (Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn() && 365 Equals(topNavigationPage.ID, loginPageId)) 366 { 367 continue; 368 } 369 370 // Preventing us from rendering the extranet content when the user is not logged in 371 if (!Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn() && 372 extranetPageIds.Contains(topNavigationPage.ID)) 373 { 374 continue; 375 } 376 377 var topNavigationPageName = topNavigationPage.GetDisplayName(); 378 var topNavigationPageTitle = $"{Translate("LinkTitlePrefix", "Navigeer naar")}: {topNavigationPageName}".JsEncode(); 379 var topNavigationPageSubPages = Dynamicweb.Services.Pages.GetPagesByParentID(topNavigationPage.ID); 380 <div class="mobile-menu__items__footer__item"> 381 @if (topNavigationPage.Allowclick) 382 { 383 <a href="@SearchEngineFriendlyURLs.GetFriendlyUrl(topNavigationPage.ID)" 384 title="@topNavigationPageTitle" target="_top" class="mobile-menu__items__button button button--white-border"> 385 @topNavigationPageName 386 </a> 387 } 388 else 389 { 390 <div title="@topNavigationPageTitle" target="_top" class="mobile-menu__items__title"> 391 @topNavigationPageName 392 </div> 393 } 394 @if (topNavigationPageSubPages.Any()) 395 { 396 foreach (var subPage in topNavigationPageSubPages) 397 { 398 // Preventing us from rendering the extranet content when the user is not logged in 399 if (!Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn() && 400 extranetPageIds.Contains(subPage.ID)) 401 { 402 continue; 403 } 404 405 var topNavigationSubpageName = subPage.GetDisplayName(); 406 var topNavigationSubpageTitle = $"{Translate("LinkTitlePrefix", "Navigeer naar")}: {topNavigationSubpageName}".JsEncode(); 407 <a href="@SearchEngineFriendlyURLs.GetFriendlyUrl(subPage.ID)" 408 title="@topNavigationSubpageTitle" target="_top" class="mobile-menu__items__button button button--white-border">@topNavigationSubpageName</a> 409 } 410 } 411 </div> 412 } 413 } 414 415 </template> 416 </mobile-menu> 417 </div> 418 419 <div id="select-cart-modal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"> 420 <div class="modal-dialog" role="document"> 421 <div class="modal-content"> 422 <div class="modal-header"> 423 <h2>@Translate("CartSelector_Title", "Welke producten wilt u afrekenen?")</h2> 424 </div> 425 <div class="modal-body"> 426 @Translate("CartSelector_Text", "Voor onze partner producten en onze webshop producten hebben wij afzonderlijke afhandelingen, daarom vragen wij u deze apart van elkaar af te rekenen.") 427 <a href="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(cartPartnerProductsPageId)" class="text-button twente-red">@Translate("CartSelector_PartnerProductsLinkText", "Partner producten afrekenen")<div class="icon--arrow-right"></div></a> 428 <a href="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(cartPageId)" class="text-button twente-red">@Translate("CartSelector_WebshopProductsLinkText", "Webshop producten afrekenen")<div class="icon--arrow-right"></div></a> 429 </div> 430 </div> 431 </div> 432 </div> 433 </div> 434 <hr /> 435 </header> 436 } 437 438 </text> 439 } 440 <main> 441 @using Dynamicweb.Core 442 @using Dynamicweb.Frontend 443 @using TwenteBranding.Models.Constants 444 @using TwenteBranding.Repository.Helpers 445 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 446 @Description("View model template for a job offer page") 447 448 @{ 449 var pageView = PageView.Current(); 450 var culture = pageView.GlobalTags.GetTagByName("Global:Area.LongLang").Value; 451 var itemPageId = pageView.ID; 452 var sidebar = Dynamicweb.Services.Pages.GetPageByNavigationTag(Model.Area.ID, StringConstants.NavigationTags.JobOfferArticleSidebar); 453 var item = ItemHelper.GetTwenteBrandingItemForPage(Model.ItemId, itemPageId.ToString(), culture, false); 454 455 if (item != null) 456 { 457 var hashtag = item.MainHashtag.IsNotNullOrEmpty() ? string.Format("#{0}", item.MainHashtag) : string.Format("#{0}", item.MainHashtagEnglish); 458 var goalName = item.GoalName; 459 var background = goalName.FixNameForClass(); 460 var goalIcon = item.GoalIcon; 461 var goalType = item.InstanceType; 462 var gradientCss = item.GoalGradientClass; 463 var fontColor = item.HeaderFontColor; 464 var title = Model.Item.GetString("Title"); 465 var proposal = Model.Item.GetString("Text"); 466 var logo = item.JobCompanyLogo; 467 var logoPath = !string.IsNullOrEmpty(logo) ? $"/Admin/Public/GetImage.ashx?Image={logo}&Format=webp&Width=150&Height=0&Quality=100&Crop=0&t=2" : ""; 468 var jobInformation = item.JobInformation; 469 var jobRequirements = item.JobRequirements; 470 var jobApplicationInfo = item.JobApplicationInfo; 471 var jobHoursPerWeek = string.Empty; 472 473 if (item.JobMinHoursPerWeek < 0) // should never happen 474 { 475 item.JobMinHoursPerWeek = 0; 476 } 477 478 if (item.JobMaxHoursPerWeek < 0) // should never happen 479 { 480 item.JobMaxHoursPerWeek = 0; 481 } 482 483 if (Equals(item.JobMinHoursPerWeek, item.JobMaxHoursPerWeek)) 484 { 485 jobHoursPerWeek = item.JobMinHoursPerWeek.ToString(); 486 } 487 else if (item.JobMaxHoursPerWeek > item.JobMinHoursPerWeek) { 488 jobHoursPerWeek = $"{item.JobMinHoursPerWeek} - {item.JobMaxHoursPerWeek}"; 489 } 490 else { 491 jobHoursPerWeek = item.JobMinHoursPerWeek.ToString(); // should never happen, maybe we should use: Translate("JobOfferArticle_HoursPerWeek_Unknown", "-"); 492 } 493 494 var jobEducationalAttainment = (item.JobEducationalAttainment != null && item.JobEducationalAttainment.Any()) ? string.Join(", ", item.JobEducationalAttainment) : Translate("JobOfferArticle_EducationalAttainment_Unknown", "-"); 495 var skills = (item.JobSkills != null && item.JobSkills.Any()) ? string.Join(", ", item.JobSkills) : Translate("JobOfferArticle_Skills_Unknown", "-"); 496 var creationDate = item.JobCreationDate > DateTime.MinValue ? item.JobCreationDate.ToShortDateString() : Translate("JobOfferArticle_CreationDate_Unknown", "-"); 497 var expirationDate = item.JobExpirationDate > DateTime.MinValue ? item.JobExpirationDate.ToShortDateString() : Translate("JobOfferArticle_ExpirationDate_Unknown", "-"); 498 var companyPageId = item.JobCompanyPageId; 499 var jobApplyUrl = item.JobApplyUrl; 500 var jobIntroInformation = item.JobIntroInformation; 501 var jobCompanyInformation = item.JobCompanyInformation; 502 var headerBackgroundColor = item.BackgroundColor ?? "#000000"; 503 var companyTitle = ""; 504 var companyLogo = ""; 505 var companyPhoneNumber = ""; 506 var companyEmailAddress = ""; 507 var companyWebsiteUrl = ""; 508 var textColorClass = ColorHelper.PickFrontColorClassBasedOnBackgroundColor(headerBackgroundColor, "text-white", "text-black"); 509 var iconClass = textColorClass == "text-black" ? "icon--arrow-down-black" : "icon--arrow-down"; 510 511 if (companyPageId > 0) 512 { 513 var companyItem = Dynamicweb.Services.Items.GetItemByPageId(companyPageId, false); 514 if (companyItem != null) 515 { 516 var companyAddress = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.PartnerArticle.PartnerFullAddress); 517 if (!string.IsNullOrWhiteSpace(companyAddress)) 518 { 519 companyTitle = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.BaseArticle.Title); 520 companyLogo = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.PartnerArticle.PartnerLogo); 521 if (!string.IsNullOrWhiteSpace(companyLogo)) 522 { 523 companyLogo = $"/Admin/Public/GetImage.ashx?Image={companyLogo}&Format=webp&Width=300&Height=0&Quality=100&Crop=0&t=2"; 524 } 525 companyPhoneNumber = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.PartnerArticle.PartnerPhoneNumber); 526 companyEmailAddress = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.PartnerArticle.PartnerEmailAddress); 527 companyWebsiteUrl = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.PartnerArticle.PartnerWebsiteUrl); 528 } 529 } 530 } 531 532 <div id='@Model.ID' 533 class='page-hero job-offer-article-header @textColorClass' 534 style="background: @(item.ShowGradient ? $"linear-gradient(149deg, rgba(0,0,0,1) 30%, {headerBackgroundColor} 100%)" : $"{headerBackgroundColor} ");"> 535 <div class='container'> 536 <div class='text-image-grid'> 537 <div class='text'> 538 <h1 class="">@title</h1> 539 @if (!string.IsNullOrWhiteSpace(jobIntroInformation)) 540 { 541 <div class="introduction">@jobIntroInformation</div> 542 } 543 544 <a href='#content' class="anchor-link hidden-phone"> 545 @Translate("JobOfferArticle_Read_Entire_Article", "Lees hieronder de hele vacature") 546 <div class="@iconClass"></div> 547 </a> 548 </div> 549 @if (!string.IsNullOrWhiteSpace(logo)) 550 { 551 <img class="lazy job-offer-article-header__logo hidden-phone" data-src="@logoPath" alt="logo vacature @title" /> 552 } 553 </div> 554 </div> 555 </div> 556 557 @* ##### JOBOFFER DETAILS ##### *@ 558 <div class="joboffer-details"> 559 <div class="container"> 560 <h3 class="joboffer-details__title info">@Translate("JobOfferArticle_Details", "Vacature details")</h3> 561 <div class="joboffer-details__content"> 562 <div>@Translate("JobOfferArticle_CreationDate", "Geplaatst op")</div> 563 <div>@creationDate</div> 564 <div>@Translate("JobOfferArticle_HoursPerWeek", "Aantal uur")</div> 565 <div>@jobHoursPerWeek</div> 566 <div>@Translate("JobOfferArticle_ExpirationDate", "Vervaldatum")</div> 567 <div>@expirationDate</div> 568 <div>@Translate("JobOfferArticle_EducationalAttainment", "Opleidingsniveau")</div> 569 <div>@jobEducationalAttainment</div> 570 </div> 571 </div> 572 </div> 573 574 575 <div class="grid detail-grid-container container joboffer-container"> 576 <div id='content' class="content"> 577 @* ##### FUNCTION DESCRIPTION ##### *@ 578 @if (!string.IsNullOrWhiteSpace(jobInformation)) 579 { 580 @*<h3>@Translate("JobOfferArticle_InformationHeader", "Functie omschrijving")</h3>*@ 581 <div class="joboffer-paragraph">@jobInformation</div> 582 } 583 584 @* ##### FUNCTION REQUIREMENTS ##### *@ 585 @*@if (!string.IsNullOrWhiteSpace(jobRequirements)) 586 { 587 <h3>@Translate("JobOfferArticle_RequirementsHeader", "Functievereisten")</h3> 588 <div class="joboffer-paragraph">@jobRequirements</div> 589 } 590 591 @* ##### PROPOSAL ##### *@ 592 @*@if (!string.IsNullOrWhiteSpace(proposal)) 593 { 594 <h3>@Translate("JobOfferArticle_Proposal", "Aanbod")</h3> 595 <div class="joboffer-paragraph">@proposal</div> 596 } 597 598 @* ##### COMPANY PROFILE ##### *@ 599 600 @* Alinea titel: Bedrijfsprofiel + bedrijfsnaam *@ 601 602 @* organisatie-en afdelingsomschrijving *@ 603 604 @if (!string.IsNullOrWhiteSpace(jobCompanyInformation)) 605 { 606 <h3>@Translate("JobOfferArticle_CompanyHeader", "Bedrijfsprofiel") @companyTitle</h3> 607 <div class="joboffer-paragraph">@jobCompanyInformation</div> 608 } 609 610 @* ##### APPLY ##### *@ 611 @if (!string.IsNullOrWhiteSpace(jobApplicationInfo)) 612 { 613 <h3>@Translate("JobOfferArticle_ApplicationHeader", "Solliciteren")</h3> 614 <div class="joboffer-paragraph">@jobApplicationInfo</div> 615 } 616 617 @if (!string.IsNullOrWhiteSpace(jobApplyUrl)) 618 { 619 <div class="job-apply-url"> 620 <a class="button background--twente-red" target="_blank" href="@jobApplyUrl"> 621 @Translate("Job_apply", "Solliciteer") 622 <div class="background--twente-red pl-05 icon--arrow-right"></div> 623 </a> 624 </div> 625 } 626 627 628 <div class="share background--gray-1 font-color--black"> 629 630 <div class="social-title"> 631 @Translate("JobOfferArticle_Share", "<strong>Deel</strong> deze vacature") 632 </div> 633 634 <div class="social-media-icon-container"> 635 <!-- AddToAny BEGIN --> 636 <div class="a2a_kit a2a_kit_size_32 a2a_default_style"> 637 <a class="a2a_button_facebook social-media-icon icon--sm_facebook"></a> 638 <a class="a2a_button_twitter social-media-icon icon--sm_twitter"></a> 639 <a class="a2a_button_linkedin social-media-icon icon--sm_linkedin"></a> 640 <a class="a2a_button_whatsapp social-media-icon icon--sm_whatsapp"></a> 641 </div> 642 <script> 643 var a2a_config = a2a_config || {}; 644 a2a_config.locale = "@culture"; 645 </script> 646 <script type="application/javascript" async src="https://static.addtoany.com/menu/page.js"></script> 647 <!-- AddToAny END --> 648 </div> 649 </div> 650 651 </div> 652 653 @if (sidebar != null) 654 { 655 <div class="sidebar"> 656 @RenderPageContent(sidebar.ID) 657 </div> 658 } 659 660 661 @if (Model.Placeholder("Bottom").Any()) 662 { 663 <div class="bottom"> 664 @Model.Placeholder("Bottom") 665 </div> 666 } 667 668 </div> 669 if (companyPageId > 0) 670 { 671 var companyItem = Dynamicweb.Services.Items.GetItemByPageId(companyPageId, false); 672 if (companyItem != null) 673 { 674 var companyAddress = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.PartnerArticle.PartnerFullAddress); 675 if (!string.IsNullOrWhiteSpace(companyAddress)) 676 { 677 678 <div class="joboffer-company"> 679 <div class='container'> 680 <h3 class="joboffer-company__title info">@Translate("JobOfferArticle_More_Info", "Meer informatie")</h3> 681 <div class="joboffer-company__details"> 682 683 @if (!string.IsNullOrWhiteSpace(logo)) 684 { 685 <img src="@companyLogo" alt="logo @companyTitle" class="logo joboffer-company__details__image" /> 686 } 687 <div class="joboffer-company__details__contact"> 688 @if (!string.IsNullOrWhiteSpace(companyAddress)) 689 { 690 @companyAddress.NewlineToBr() <br> 691 } 692 693 @if (!string.IsNullOrWhiteSpace(companyPhoneNumber)) 694 { 695 @companyPhoneNumber 696 } 697 </div> 698 <div class="joboffer-company__details__address"> 699 @if (!string.IsNullOrWhiteSpace(companyEmailAddress) || !string.IsNullOrWhiteSpace(companyWebsiteUrl)) 700 { 701 if (!string.IsNullOrWhiteSpace(companyEmailAddress)) 702 { 703 <a href="mailto:@companyEmailAddress" target="_blank">@companyEmailAddress</a> <br> 704 } 705 if (!string.IsNullOrWhiteSpace(companyWebsiteUrl)) 706 { 707 var websiteLink = companyWebsiteUrl; 708 if (!websiteLink.ToLower().StartsWith("http")) 709 { 710 websiteLink = string.Format("https://{0}", companyWebsiteUrl); 711 } 712 <a href="@websiteLink" target="_blank">@companyWebsiteUrl</a> 713 } 714 } 715 </div> 716 </div> 717 </div> 718 </div> 719 } 720 } 721 } 722 } 723 else 724 { 725 <div>No-Item</div> 726 } 727 } 728 729 </main> 730 @using TwenteBranding.Repository.Helpers 731 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 732 @{ 733 var homepageLinkTitle = $"{Translate("LinkTitlePrefix", "Navigeer naar")}: {Translate("Homelink_Title", "De homepage")}"; 734 } 735 <footer class="background--black flex flex-align-center"> 736 <div class="container"> 737 @using TwenteBranding.Repository.Helpers 738 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 739 740 @if (Model.Area.Item != null) 741 { 742 <div class='social-media-icons flex'> 743 @foreach (var field in Model.Area.Item.Fields.Where(f => f.SystemName.StartsWith("Sm_"))) 744 { 745 if (!string.IsNullOrEmpty(field.GetString())) 746 { 747 <a class='mr-05' rel="noopener" aria-label="@field.Name.JsEncode()" href="@field.GetString()" title="@field.Name.JsEncode()" target="_blank"> 748 <div class="icon--@field.SystemName.ToLower() icon-size--x2"></div> 749 </a> 750 } 751 } 752 </div> 753 } 754 755 <div class="footer-link-container"> 756 @{ 757 var footerNavigationFolderId = GetPageIdByNavigationTag(TwenteBranding.Models.Constants.StringConstants.NavigationTags.FooterNavigation); 758 if (footerNavigationFolderId > 0) 759 { 760 var footerNavigationPageList = Dynamicweb.Services.Pages.GetPagesByParentID(footerNavigationFolderId); 761 if (footerNavigationPageList != null && footerNavigationPageList.Any()) 762 { 763 var footerNavigationPages = footerNavigationPageList.Where(page => page.Active).ToList(); 764 if (footerNavigationPages.Any()) 765 { 766 var footerLinkCounter = 1; 767 foreach (var footerNavigationPage in footerNavigationPages) 768 { 769 var footerNavigationPageName = footerNavigationPage.GetDisplayName(); 770 var footerNavigationPageTitle = $"{Translate("LinkTitlePrefix", "Navigeer naar")}: {footerNavigationPageName}".JsEncode(); 771 var footerNavigationPageLink = $"/Default.aspx?ID={footerNavigationPage.ID}"; 772 773 // place last link and copyright together to prevent wrapping on phone 774 if (footerNavigationPages.Count() == footerLinkCounter) 775 { 776 var copyRight = string.Format(Translate("Footer_CopyRight", "&copy; {0} Twente Branding"), DateTime.Now.Year); 777 778 <div class='wrapper'> 779 <a href="@footerNavigationPageLink" title="@footerNavigationPageTitle">@footerNavigationPageName</a> 780 <span>@copyRight</span> 781 </div> 782 } 783 else 784 { 785 <a href="@footerNavigationPageLink" title="@footerNavigationPageTitle">@footerNavigationPageName</a> 786 } 787 footerLinkCounter++; 788 } 789 } 790 } 791 } 792 } 793 </div> 794 </div> 795 <a class='twente-logo' href="@homepageUrl" title="@homepageLinkTitle"> 796 <img src="@IconHelper.GetSvgPath("twente", "logo/")" /> 797 </a> 798 </footer> 799 800 </div> 801 <aside> 802 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 803 @using Dynamicweb.Core 804 @using TwenteBranding.Repository.Helpers 805 @using System.Linq; 806 @using TwenteBranding.Models.ViewModels 807 808 @{ 809 var newsletterSubscriptionModalPageId = GetPageIdByNavigationTag("NewsletterSubscriptionModal"); 810 var jobAlertSubscriptionModalPageId = GetPageIdByNavigationTag("JobAlertSubscriptionModal"); 811 var jobOffersPageId = GetPageIdByNavigationTag("JobOffers"); 812 var jobOfferParentPageId = Dynamicweb.Frontend.PageView.Current().Page.ParentPageId; 813 var utmCampaign = Dynamicweb.Context.Current.Request.QueryString.Get("utm_campaign"); 814 var mainHashtagModal = ""; 815 816 // Specific pages which must not show a subscription modal (jobalert/newsletter) 817 var twenteLeeftPageId = GetPageIdByNavigationTag("MOT_TwenteLeeft"); 818 var jobAlertSubscription = GetPageIdByNavigationTag("JobAlertSubscription"); 819 var pageIdsWithoutModal = new List<int> { twenteLeeftPageId, jobAlertSubscription }; 820 821 // Get the item for the current page 822 TwenteBrandingItemModel pItem = null; 823 if (Model.ItemId != "1") //Item with ID 1 gives error 824 { 825 pItem = ItemHelper.GetTwenteBrandingItemForPage( 826 Model.ItemId, 827 Dynamicweb.Frontend.PageView.Current().ID.ToString(), 828 Dynamicweb.Frontend.PageView.Current().GlobalTags.GetTagByName("Global:Area.LongLang").Value 829 ); 830 } 831 832 if (pItem != null) 833 { 834 // Get main hashtag of the current page item 835 var mainHashtagId = pItem.MainHashtagIds.FirstOrDefault(); 836 if (!string.IsNullOrEmpty(mainHashtagId)) 837 { 838 var hashtagItem = Dynamicweb.Content.Items.Item.GetItemById(TwenteBranding.Models.Constants.StringConstants.ItemInstanceType.Hashtag, mainHashtagId); 839 mainHashtagModal = $"{ItemHelper.GetItemValue<string>(hashtagItem, TwenteBranding.Models.Constants.StringConstants.CustomItemTypes.BaseArticle.Title)}"; 840 } 841 } 842 843 // Dont show a modal on the following pages 844 if (pageIdsWithoutModal.Contains(Model.ID) || mainHashtagModal == "talent") 845 { 846 //do noting 847 } 848 else 849 { 850 // Show modal with link to vacancysubscription page on vacancy page and pages with #talent hashtag 851 if ((Model.ID == jobOffersPageId || jobOfferParentPageId == jobOffersPageId) 852 && jobAlertSubscriptionModalPageId > 0) 853 { 854 @RenderPageContent(jobAlertSubscriptionModalPageId) 855 } 856 // If the jobalert modal pageId has a value and utmCampaing matches the specified value 857 else if (jobAlertSubscriptionModalPageId > 0 && utmCampaign == "Remarketing vacaturebank") 858 { 859 @RenderPageContent(jobAlertSubscriptionModalPageId) 860 } 861 // Else if the newsletter pageId has a value, show the newsletter subscription modal 862 else if (newsletterSubscriptionModalPageId > 0) 863 { 864 @RenderPageContent(newsletterSubscriptionModalPageId) 865 } 866 } 867 } 868 </aside> 869 <script src="@customJs"></script> 870 <script src="@appJs"></script> 871 @RenderSnippet("JavascriptBottom") 872 </body> 873 </html> 874 }