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