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