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_fb53909658524ea8bd8ea8f661ada9ed.Execute() in D:\inetpub\wwwroot\www.twente.com\Files\Templates\Designs\TwenteBranding\_parsed\JobOfferArticle.parsed.cshtml:line 369
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 @using TwenteBranding.Repository.Helpers 3 4 @{ 5 Title("Master view model template"); 6 Description("Master view model template"); 7 var currentPageView = Dynamicweb.Frontend.PageView.Current(); 8 var contentLanguage = currentPageView.GlobalTags.GetTagByName("Global:Area.Lang").Value; 9 var scheme = currentPageView.GlobalTags.GetTagByName("Global:Request.Scheme").Value; 10 var host = currentPageView.GlobalTags.GetTagByName("Global:Request.Host").Value; 11 var requestHost = string.Format("{0}://{1}", scheme, host); 12 var metaDescription = Model.Description; 13 var metaKeywords = Model.Keywords; 14 15 var appJs = FileHelper.GetFilenameWithTimeStamp("/Files/Templates/Designs/TwenteBranding/js/app.min.js"); 16 var appCss = FileHelper.GetFilenameWithTimeStamp("/Files/Templates/Designs/TwenteBranding/css/main.min.css"); 17 18 19 <html lang="@contentLanguage"> 20 <head> 21 <title>@Model.Title</title> 22 @if (!string.IsNullOrWhiteSpace(metaDescription)) 23 { 24 <meta name="description" content="@metaDescription"/> 25 } 26 @if (!string.IsNullOrWhiteSpace(metaKeywords)) 27 { 28 <meta name="keywords" content="@metaKeywords"/> 29 } 30 <meta http-equiv="content-language" content='@contentLanguage'/> 31 <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> 32 <meta http-equiv="imagetoolbar" content="no"/> 33 <meta http-equiv="x-dns-prefetch-control" content="on"/> 34 <meta http-equiv="x-ua-compatible" content="ie=edge"/> 35 <meta name="viewport" content="width=device-width,initial-scale=1"> 36 <meta name="application-name" content="innovadis.com"/> 37 <meta name="author" content="Innovadis BV, Enschede"/> 38 <meta name="copyright" content='Innovadis BV, Enschede, @DateTime.Now.Year'/> 39 <meta name="web_author" content="Innovadis BV, Enschede"/> 40 <link rel="dns-prefetch" href='@requestHost'/> 41 <link rel="icon" href="/favicon.ico" type="image/x-icon"/> 42 <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/> 43 <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" type="text/css" rel="stylesheet"/> 44 <link rel="stylesheet" type="text/css" href="@appCss"/> 45 <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Ubuntu:300i,400,500,700&display=swap" rel="stylesheet"> 46 @{ var gaHeadCode = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Analytics.GoogleAnalyticsTrackingCode); 47 if (!string.IsNullOrWhiteSpace(gaHeadCode)) 48 { 49 <script> 50 (function (i, s, o, g, r, a, m) { 51 i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { 52 (i[r].q = i[r].q || []).push(arguments) 53 }, i[r].l = 1 * new Date(); a = s.createElement(o), 54 m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) 55 })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); 56 57 ga('create', '@gaHeadCode', 'auto'); 58 ga('send', 'pageview'); 59 </script> 60 } 61 } 62 @{ var gtmHeadCode = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Analytics.GoogleTagManagerTrackingCode); 63 if (!string.IsNullOrWhiteSpace(gtmHeadCode)) 64 { 65 <script> 66 (function (w, d, s, l, i) { 67 w[l] = w[l] || []; w[l].push({ 68 'gtm.start': 69 new Date().getTime(), event: 'gtm.js' 70 }); var f = d.getElementsByTagName(s)[0], 71 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 72 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 73 })(window, document, 'script', 'dataLayer', '@gtmHeadCode');</script> 74 } 75 } 76 @RenderSnippet("HeadSection") 77 78 @* Print alternate links and content-language meta tags *@ 79 @LanguageHelper.GetMasterLanguageTags(Model.ID) 80 @{ var gtmBodyCode = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Analytics.GoogleTagManagerTrackingCode); 81 if (!string.IsNullOrWhiteSpace(gtmBodyCode)) 82 { 83 var gtmUrl = string.Format("https://www.googletagmanager.com/ns.html?id={0}", gtmBodyCode); 84 <noscript> 85 <iframe src="@gtmUrl" height="0" width="0" style="display:none;visibility:hidden"></iframe> 86 </noscript> 87 } 88 } 89 @{ 90 var trengoKey = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Trengo.Key); 91 if (!string.IsNullOrWhiteSpace(trengoKey)) 92 { 93 <script type="text/javascript"> 94 window.Trengo = window.Trengo || {}; 95 window.Trengo.key = "@trengoKey"; 96 97 (function(d, script, t) { 98 script = d.createElement('script'); 99 script.type = 'text/javascript'; 100 script.async = true; 101 script.src = 'https://static.widget.trengo.eu/embed.js'; 102 d.getElementsByTagName('head')[0].appendChild(script); 103 }(document)); 104 105 </script> 106 } 107 } 108 @{ 109 var hotjarKey = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Hotjar.Key); 110 if (!string.IsNullOrWhiteSpace(hotjarKey)) 111 { 112 <!-- Hotjar Tracking Code --> 113 <script> 114 (function(h,o,t,j,a,r){ 115 h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)}; 116 h._hjSettings={hjid:@hotjarKey,hjsv:6}; 117 a=o.getElementsByTagName('head')[0]; 118 r=o.createElement('script');r.async=1; 119 r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv; 120 a.appendChild(r); 121 })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv='); 122 </script> 123 } 124 } 125 </head> 126 <body> 127 <main class="twentebranding-container"> 128 @using Dynamicweb.Content 129 @using Dynamicweb.Ecommerce.International 130 @using TwenteBranding.Repository.Helpers 131 @using Page = System.Web.UI.Page 132 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 133 @{ 134 var websiteLanguages = Model.Area.Languages; 135 List<Dynamicweb.Content.Page> topNavigationPages = null; 136 137 int topNavigationFolderId = GetPageIdByNavigationTag("TopNavigation"); 138 if (topNavigationFolderId > 0) 139 { 140 var pageService = new Dynamicweb.Content.PageService(); 141 var topNavigationPageList = pageService.GetPagesByParentID(topNavigationFolderId); 142 if (topNavigationPageList != null && topNavigationPageList.Any()) 143 { 144 topNavigationPages = topNavigationPageList.Where(p => p.Active).ToList(); 145 } 146 } 147 148 var homelinkImage = IconHelper.GetSvgPath("twente", "logo/"); 149 150 <div id="homelink"> 151 <a href="/" target="_top" title="@string.Format(" {0}: {1}", Translate("LinkTitlePrefix", "Navigeer naar" ), Translate("Homelink_Title", "De homepage" )).JsEncode()"><img src="@homelinkImage" alt="@Translate(" Homelink_ImageAlt", "Image met het Twentse Ros die onclick naar de homepge navigeert" )" /></a> 152 </div> 153 154 var searchResultsPageId = AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.PageIds.SearchResults); 155 156 // Top navigation Snippet 157 @SnippetStart("TopNavigation") 158 159 <div class="top-navigation"> 160 @if (topNavigationPages != null && topNavigationPages.Any()) 161 { 162 <ul class="pages"> 163 @foreach (var topNavigationPage in topNavigationPages) 164 { 165 var topNavigationPageName = topNavigationPage.GetDisplayName(); 166 var topNavigationPageTitle = string.Format("{0}: {1}", Translate("LinkTitlePrefix", "Navigeer naar"), topNavigationPageName).JsEncode(); 167 <li><a href="@string.Format("/Default.aspx?ID={0}", topNavigationPage.ID)" title="@topNavigationPageTitle" target="_top">@topNavigationPageName</a></li> 168 } 169 </ul> 170 } 171 172 @if (websiteLanguages != null && websiteLanguages.Any()) 173 { 174 <ul class="languages"> 175 @{ 176 var pageService = new PageService(); 177 var languagePages = pageService.GetLanguagePages(Model.ID); 178 179 foreach (var language in Model.Area.Languages) 180 { 181 var lang = language.Culture.Split('-')[0]; 182 var link = ""; 183 var listClass = language.IsCurrent ? "active" : ""; 184 var langTitle = string.Format("{0}: {1}", Translate("LinkTitlePrefix", "Navigeer naar"), language.Name).JsEncode(); 185 186 if (language.IsMaster && !language.IsCurrent) 187 { 188 var masterAreaPage = pageService.GetPagesByAreaID(1).SingleOrDefault(p => p.GetLanguageVersion(Model.Area.ID) != null && p.GetLanguageVersion(Model.Area.ID).ID.Equals(Model.ID)); 189 if (masterAreaPage != null) 190 { 191 link = string.Format("/Default.aspx?ID={0}", masterAreaPage.ID); 192 } 193 } 194 else if (language.IsCurrent) 195 { 196 link = "javascript:void(0);"; 197 } 198 else 199 { 200 foreach (var languagePage in languagePages) 201 { 202 var languageAreaId = language.ID; 203 if (languageAreaId == languagePage.AreaId) 204 { 205 link = string.Format("/Default.aspx?ID={0}", languagePage.ID); 206 } 207 } 208 } 209 210 //TODO: querystring? 211 212 <li class="@listClass" title="@langTitle"><a href="@link" target="_top">@lang</a></li> 213 } 214 } 215 </ul> 216 } 217 </div> 218 219 @SnippetEnd("TopNavigation") 220 221 // navigation SM 222 <div id="header_mobile" class="d-block d-md-none" data-hometext="@Translate("Navigation_HomeText", "Home")"> 223 <div class="header-mobile-icons"> 224 <a id="mobile-menu-button" class="icon-color--gray-4 icon--hamburger menu-icon"></a> 225 <a id="mobile-search-button" class="icon-color--gray-4 icon--search menu-icon"></a> 226 <a id="mobile-close-button" class="icon-color--gray-4 icon--cross menu-icon"></a> 227 </div> 228 <nav id="mobile-nav" class="navigation-mobile"> 229 @RenderNavigation(new { StartLevel = 1, EndLevel = 2, Template = "LIClean-mobile.xslt", Expandmode = "All" }) 230 <div class="mobile-topnavigation"> 231 @RenderSnippet("TopNavigation") 232 </div> 233 </nav> 234 <div id="mobile-navigation-submenu"></div> 235 236 <div id="mobile-search" class="search-mobile"> 237 @if (!string.IsNullOrWhiteSpace(searchResultsPageId)) 238 { 239 var searchResultUrl = string.Format("/Default.aspx?ID={0}", searchResultsPageId); 240 <div id="searchFormMobile" data-target="@searchResultUrl"> 241 <div class="top-search"> 242 <div class="input-group"> 243 <input type="text" class="form-control" name="q" id="q" placeholder="@Translate(" Searchbar_Placeholder", "Zoeken" )" aria-label="@Translate(" Searchbar_AriaLabel", "Zoeken" )"> 244 <div class="input-group-append"> 245 <button class="btn icon--search icon-color--gray-4 icon-size--x1 search-button-mobile" type="button" aria-label="search"></button> 246 </div> 247 </div> 248 </div> 249 </div> 250 @SnippetStart("JavascriptBottom") 251 <script> 252 $(document).ready(function () { 253 $(".search-button-mobile, #searchFormMobile").off("click").on("click", function () { 254 SearchHelper.SearchMobile(); 255 }); 256 $("#q, #searchFormMobile").keypress(function (e) { 257 if (e.which == 13) { 258 SearchHelper.SearchMobile(); 259 return false; 260 } 261 }); 262 }); 263 </script> 264 @SnippetEnd("JavascriptBottom") 265 266 } 267 </div> 268 </div> 269 270 // navigation MD+ 271 <div id="header" class="d-none d-md-block"> 272 <div class="container"> 273 274 @RenderSnippet("TopNavigation") 275 276 <nav id="navigation" data-hometext="@Translate("Navigation_HomeText", "Home")"> 277 @RenderNavigation(new { StartLevel = 1, EndLevel = 2, Template = "LIClean.xslt", Expandmode = "All" }) 278 </nav> 279 280 @if (!string.IsNullOrWhiteSpace(searchResultsPageId)) 281 { 282 var searchResultUrl = string.Format("/Default.aspx?ID={0}", searchResultsPageId); 283 <div id="searchForm" data-target="@searchResultUrl"> 284 <div class="top-search"> 285 <div class="input-group"> 286 <input type="text" class="form-control" name="q" id="q" placeholder="@Translate(" Searchbar_Placeholder", "Zoeken" )" aria-label="@Translate(" Searchbar_AriaLabel", "Zoeken" )"> 287 <div class="input-group-append"> 288 <button class="btn icon--search icon-color--gray-4 icon-size--x1 search-button" type="button" aria-label="search"></button> 289 </div> 290 </div> 291 </div> 292 </div> 293 294 @SnippetStart("JavascriptBottom") 295 <script> 296 $(document).ready(function () { 297 $(".search-button, #searchForm").off("click").on("click", function () { 298 SearchHelper.Search(); 299 }); 300 $("#q, #searchForm").keypress(function (e) { 301 if (e.which == 13) { 302 SearchHelper.Search(); 303 return false; 304 } 305 }); 306 }); 307 </script> 308 @SnippetEnd("JavascriptBottom") 309 } 310 </div> 311 <div id="navigation-submenu"></div> 312 </div> 313 } 314 <main> 315 @using Dynamicweb.Content 316 @using Dynamicweb.Core 317 @using Dynamicweb.Frontend 318 @using TwenteBranding.Models.Constants 319 @using TwenteBranding.Repository.Helpers 320 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 321 @Description("View model template for a job offer page") 322 323 @{ 324 var pService = new PageService(); 325 var iService = new ItemService(); 326 var pageView = PageView.Current(); 327 var culture = pageView.GlobalTags.GetTagByName("Global:Area.LongLang").Value; 328 var itemPageId = pageView.ID; 329 var sidebar = pService.GetPageByNavigationTag(Model.Area.ID, StringConstants.NavigationTags.JobOfferArticleSidebar); 330 331 var item = ItemHelper.GetTwenteBrandingItemForPage(Model.ItemId, itemPageId.ToString(), culture, pService, iService, false); 332 if (item != null) 333 { 334 var hashtag = item.MainHashtag.IsNotNullOrEmpty() ? string.Format("#{0}", item.MainHashtag) : string.Format("#{0}", item.MainHashtagEnglish); 335 336 var goalName = item.GoalName; 337 var background = goalName.FixNameForClass(); 338 var goalIcon = item.GoalIcon; 339 var goalType = item.GoalType; 340 var gradientCss = item.GoalGradientCss; 341 var fontColor = item.HeaderFontColor; 342 343 var title = Model.Item.GetString("Title"); 344 var proposal = Model.Item.GetString("Text"); 345 346 var logo = item.JobCompanyLogo; 347 var logoPath = $"/Admin/Public/GetImage.ashx?Image={logo}&Format=webp&Width=150&Height=-1&Quality=100&Crop=0&t=2"; 348 349 var jobInformation = item.JobInformation; 350 var jobRequirements = item.JobRequirements; 351 var jobApplicationInfo = item.JobApplicationInfo; 352 var jobHoursPerWeek = item.JobHoursPerWeek > 0 ? item.JobHoursPerWeek.ToString() : Translate("JobOfferArticle_HoursPerWeek_Unknown", "-"); 353 var jobEducationalAttainment = (item.JobEducationalAttainment != null && item.JobEducationalAttainment.Any()) ? string.Join(", ", item.JobEducationalAttainment) : Translate("JobOfferArticle_EducationalAttainment_Unknown", "-"); 354 var creationDate = item.JobCreationDate > DateTime.MinValue ? item.JobCreationDate.ToShortDateString() : Translate("JobOfferArticle_CreationDate_Unknown", "-"); 355 var expirationDate = item.JobExpirationDate > DateTime.MinValue ? item.JobExpirationDate.ToShortDateString() : Translate("JobOfferArticle_ExpirationDate_Unknown", "-"); 356 var companyPageId = item.JobCompanyPageId; 357 var jobApplyUrl = item.JobApplyUrl; 358 var jobIntroInformation = item.JobIntroInformation; 359 var jobCompanyInformation = item.JobCompanyInformation; 360 361 var companyTitle = ""; 362 var companyLogo = ""; 363 var companyPhoneNumber = ""; 364 var companyEmailAddress = ""; 365 var companyWebsiteUrl = ""; 366 367 if (companyPageId > 0) 368 { 369 var companyItem = iService.GetItemByPageId(companyPageId, false); 370 if (companyItem != null) 371 { 372 var companyAddress = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.PartnerArticle.PartnerFullAddress); 373 if (!string.IsNullOrWhiteSpace(companyAddress)) 374 { 375 companyTitle = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.BaseArticle.Title); 376 companyLogo = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.PartnerArticle.PartnerLogo); 377 companyLogo = $"/Admin/Public/GetImage.ashx?Image={companyLogo}&Format=webp&Width=300&Height=-1&Quality=100&Crop=0&t=2"; 378 379 companyPhoneNumber = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.PartnerArticle.PartnerPhoneNumber); 380 companyEmailAddress = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.PartnerArticle.PartnerEmailAddress); 381 companyWebsiteUrl = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.PartnerArticle.PartnerWebsiteUrl); 382 } 383 } 384 } 385 386 <div class="main-container"> 387 <div class="page-title background--@background" style="@item.HeaderBackground;"> 388 <div class="container"> 389 <div class="header-grid"> 390 <div class="title"> 391 392 <h1 class="font-color--twente-red">@title</h1> 393 394 @if (!string.IsNullOrWhiteSpace(jobIntroInformation)) 395 { 396 <div class="sub-header @fontColor">@jobIntroInformation</div> 397 } 398 399 <div class="read-full-article @fontColor">@Translate("JobOfferArticle_Read_Entire_Article", "Lees hieronder de hele vacature")<div class="icon--arrow-down">&nbsp;</div></div> 400 401 </div> 402 @if (!string.IsNullOrWhiteSpace(logo)) 403 { 404 <div class="image"><img class="lazy" data-src="@logoPath" alt="logo vacature @title"/></div> 405 } 406 </div> 407 </div> 408 </div> 409 410 <div class="page-content container"> 411 <div class="grid detail-grid-container"> 412 <div class="content"> 413 @* ##### FUNCTION DESCRIPTION ##### *@ 414 415 @* functie informatie *@ 416 417 @if (!string.IsNullOrWhiteSpace(jobInformation)) 418 { 419 <h3>@Translate("JobOfferArticle_InformationHeader", "Functie omschrijving")</h3> 420 <div class="joboffer-paragraph">@jobInformation</div> 421 } 422 423 @* ##### JOBOFFER DETAILS ##### *@ 424 425 <div class="joboffer-details"> 426 <h3 class="info">@Translate("JobOfferArticle_Details", "Vacature details")</h3> 427 <div> 428 <div class="row"> 429 <div class="col-6 col-lg-3 order-1 label">@Translate("JobOfferArticle_CreationDate", "Geplaatst op")</div> 430 <div class="col-6 col-lg-3 order-2">@creationDate</div> 431 <div class="col-6 col-lg-3 order-3 order-lg-5 label">@Translate("JobOfferArticle_ExpirationDate", "Vervaldatum")</div> 432 <div class="col-6 col-lg-3 order-4 order-lg-6">@expirationDate</div> 433 <div class="col-6 col-lg-3 order-5 order-lg-3 label">@Translate("JobOfferArticle_HoursPerWeek", "Aantal uur")</div> 434 <div class="col-6 col-lg-3 order-6 order-lg-4">@jobHoursPerWeek</div> 435 <div class="col-6 col-lg-3 order-7 label">@Translate("JobOfferArticle_EducationalAttainment", "Opleidingsniveau")</div> 436 <div class="col-6 col-lg-3 order-8">@jobEducationalAttainment</div> 437 </div> 438 </div> 439 </div> 440 441 @* ##### FUNCTION REQUIREMENTS ##### *@ 442 443 @* functie=eisen *@ 444 445 @if (!string.IsNullOrWhiteSpace(jobRequirements)) 446 { 447 <h3>@Translate("JobOfferArticle_RequirementsHeader", "Functievereisten")</h3> 448 <div class="joboffer-paragraph">@jobRequirements</div> 449 } 450 451 @* ##### PROPOSAL ##### *@ 452 453 @* Aanbod *@ 454 455 @if (!string.IsNullOrWhiteSpace(proposal)) 456 { 457 <h3>@Translate("JobOfferArticle_Proposal", "Aanbod")</h3> 458 <div class="joboffer-paragraph">@proposal</div> 459 } 460 461 @* ##### COMPANY PROFILE ##### *@ 462 463 @* Alinea titel: Bedrijfsprofiel + bedrijfsnaam *@ 464 465 @* organisatie-en afdelingsomschrijving *@ 466 467 @if (!string.IsNullOrWhiteSpace(jobCompanyInformation)) 468 { 469 <h3>@Translate("JobOfferArticle_CompanyHeader", "Bedrijfsprofiel") @companyTitle</h3> 470 <div class="joboffer-paragraph">@jobCompanyInformation</div> 471 } 472 473 @* ##### APPLY ##### *@ 474 475 @* Solliciteren bij *@ 476 477 @if (!string.IsNullOrWhiteSpace(jobApplicationInfo)) 478 { 479 <h3>@Translate("JobOfferArticle_ApplicationHeader", "Solliciteren")</h3> 480 <div class="joboffer-paragraph">@jobApplicationInfo</div> 481 } 482 483 @if (!string.IsNullOrWhiteSpace(jobApplyUrl)) 484 { 485 <div class="jobApplyUrl"> 486 <a class="button red" target="_blank" href="@jobApplyUrl">@Translate("Job_apply", "Solliciteer")</a> 487 </div> 488 } 489 @* ######################### *@ 490 491 @if (companyPageId > 0) 492 { 493 var companyItem = iService.GetItemByPageId(companyPageId, false); 494 if (companyItem != null) 495 { 496 var companyAddress = ItemHelper.GetItemValue<string>(companyItem, StringConstants.CustomItemTypes.PartnerArticle.PartnerFullAddress); 497 if (!string.IsNullOrWhiteSpace(companyAddress)) 498 { 499 <div class="partner-information"> 500 501 <h3 class="partner-information-title info">@Translate("JobOfferArticle_More_Info", "Meer informatie")</h3> 502 503 <div class="partner-information-details"> 504 @if (!string.IsNullOrWhiteSpace(logo)) 505 { 506 <div> 507 <img src="@companyLogo" alt="logo @companyTitle" class="logo" /> 508 </div> 509 } 510 511 <div> 512 @if (!string.IsNullOrWhiteSpace(companyAddress)) 513 { 514 <span class="info address">@companyAddress.NewlineToBr()</span> 515 } 516 517 @if (!string.IsNullOrWhiteSpace(companyPhoneNumber)) 518 { 519 <span class="info phoneNumber">@companyPhoneNumber</span> 520 } 521 </div> 522 523 @if (!string.IsNullOrWhiteSpace(companyEmailAddress) || !string.IsNullOrWhiteSpace(companyWebsiteUrl)) 524 { 525 <div> 526 @if (!string.IsNullOrWhiteSpace(companyEmailAddress)) 527 { 528 <span class="info e-mailaddress"><a href="mailto:@companyEmailAddress" target="_blank">@companyEmailAddress</a></span> 529 } 530 @if (!string.IsNullOrWhiteSpace(companyWebsiteUrl)) 531 { 532 var websiteLink = companyWebsiteUrl; 533 if (!websiteLink.ToLower().StartsWith("http")) 534 { 535 websiteLink = string.Format("https://{0}", companyWebsiteUrl); 536 } 537 <span class="info website-url"><a href="@websiteLink" target="_blank">@companyWebsiteUrl</a></span> 538 } 539 </div> 540 } 541 542 </div> 543 </div> 544 } 545 } 546 } 547 548 <div class="share background--twente-red font-color--white"> 549 550 <div class="social-title"> 551 @Translate("JobOfferArticle_Share", "<strong>Deel</strong> deze vacature") 552 </div> 553 554 <div class="social-media-icon-container"> 555 <!-- AddToAny BEGIN --> 556 <div class="a2a_kit a2a_kit_size_32 a2a_default_style"> 557 <a class="a2a_button_facebook icon--sm_facebook"></a> 558 <a class="a2a_button_twitter icon--sm_twitter"></a> 559 <a class="a2a_button_linkedin icon--sm_linkedin"></a> 560 <a class="a2a_button_whatsapp icon--sm_whatsapp"></a> 561 </div> 562 <script> 563 var a2a_config = a2a_config || {}; 564 a2a_config.locale = "@culture"; 565 </script> 566 <script async src="https://static.addtoany.com/menu/page.js"></script> 567 <!-- AddToAny END --> 568 </div> 569 </div> 570 571 </div> 572 573 @if (sidebar != null) 574 { 575 <div class="sidebar"> 576 @RenderPageContent(sidebar.ID) 577 </div> 578 } 579 580 581 @if (Model.Placeholder("Bottom").Any()) 582 { 583 <div class="bottom"> 584 @Model.Placeholder("Bottom") 585 </div> 586 } 587 588 </div> 589 </div> 590 </div> 591 <script>console.log("PublicationId:", @item.JobPublicationId)</script> 592 } 593 else 594 { 595 <div>No-Item</div> 596 } 597 } 598 </main> 599 @using Dynamicweb.Frontend 600 @using TwenteBranding.Models.Constants 601 @using TwenteBranding.Repository.Helpers 602 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 603 604 @{ 605 var hashTags = AreaHelper.GetFooterHashTags(Model); 606 var hashTagsTitleField = Model.Area.Item.GetField(StringConstants.ItemInstanceType.FooterTagsTitle).GetValue(); 607 var hashTagsTitle = hashTagsTitleField == null ? "" : hashTagsTitleField.ToString(); 608 if (hashTags.Count > 0) 609 { 610 <div class="background--gray-1"> 611 612 <div class="hashtags-container container"> 613 @{ 614 if (!string.IsNullOrEmpty(hashTagsTitle)) 615 { 616 <div class="title"> 617 @hashTagsTitle 618 </div> 619 } 620 } 621 <div class="hashtags font-color--twente-red"> 622 @foreach (var tag in hashTags) 623 { 624 <a href="@SearchEngineFriendlyURLs.GetFriendlyUrl(tag.ID)">#@tag.MenuText</a> 625 } 626 </div> 627 </div> 628 </div> 629 } 630 } 631 632 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 633 <footer class="background--twente-red"> 634 <div class="container"> 635 <div class="social-media-icon-container"> 636 @using TwenteBranding.Repository.Helpers 637 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 638 639 @if (Model.Area.Item != null) 640 { 641 <ul> 642 @foreach (var field in Model.Area.Item.Fields.Where(f => f.SystemName.StartsWith("Sm_"))) 643 { 644 if (!string.IsNullOrEmpty(field.GetString())) 645 { 646 <li> 647 <a rel="noopener" aria-label="@field.Name.JsEncode()" href="@field.GetString()" title="@field.Name.JsEncode()" target="_blank"> 648 <div class="social-media-icon icon--@field.SystemName.ToLower() icon-size--x2"></div> 649 </a> 650 </li> 651 } 652 } 653 </ul> 654 } 655 </div> 656 <div class="footer-link-container"> 657 @{ 658 List<Dynamicweb.Content.Page> footerNavigationPages = null; 659 int footerNavigationFolderId = GetPageIdByNavigationTag(TwenteBranding.Models.Constants.StringConstants.NavigationTags.FooterNavigation); 660 if (footerNavigationFolderId > 0) 661 { 662 var pageService = new Dynamicweb.Content.PageService(); 663 var footerNavigationPageList = pageService.GetPagesByParentID(footerNavigationFolderId); 664 if (footerNavigationPageList != null && footerNavigationPageList.Any()) 665 { 666 footerNavigationPages = footerNavigationPageList.Where(p => p.Active).ToList(); 667 if (footerNavigationPages != null && footerNavigationPages.Any()) 668 { 669 var footerLinkCounter = 1; 670 foreach (var footerNavigationPage in footerNavigationPages) 671 { 672 var footerNavigationPageName = footerNavigationPage.GetDisplayName(); 673 var footerNavigationPageTitle = string.Format("{0}: {1}", Translate("LinkTitlePrefix", "Navigeer naar"), footerNavigationPageName).JsEncode(); 674 var footerNavigationPageLink = string.Format("/Default.aspx?ID={0}", footerNavigationPage.ID); 675 676 if (footerNavigationPages.Count() == footerLinkCounter) 677 { 678 var copyRight = string.Format(Translate("Footer_CopyRight", "&copy; {0} Twente Branding"), DateTime.Now.Year); 679 680 <div class="footer-link-wrapper"> 681 <div class="footer-link"> 682 <a href="@footerNavigationPageLink" title="@footerNavigationPageTitle">@footerNavigationPageName</a> 683 </div> 684 <div class="footer-link"><span>@copyRight</span></div> 685 </div> 686 } 687 else 688 { 689 <div class="footer-link"> 690 <a href="@footerNavigationPageLink" title="@footerNavigationPageTitle">@footerNavigationPageName</a> 691 </div> 692 } 693 footerLinkCounter++; 694 } 695 } 696 } 697 } 698 } 699 </div> 700 </div> 701 </footer> 702 703 </main> 704 <aside> 705 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 706 @using Dynamicweb.Core 707 @using TwenteBranding.Repository.Helpers 708 @using System.Linq; 709 @using TwenteBranding.Models.ViewModels 710 711 @{ 712 var newsletterSubscriptionModalPageId = GetPageIdByNavigationTag("NewsletterSubscriptionModal"); 713 var jobAlertSubscriptionModalPageId = GetPageIdByNavigationTag("JobAlertSubscriptionModal"); 714 var jobOffersPageId = GetPageIdByNavigationTag("JobOffers"); 715 var jobOfferParentPageId = Dynamicweb.Frontend.PageView.Current().Page.ParentPageId; 716 var utmCampaign = System.Web.HttpContext.Current.Request.QueryString.Get("utm_campaign"); 717 var mainHashtagModal = ""; 718 719 // Specific pages which must not show a subscription modal (jobalert/newsletter) 720 var twenteLeeftPageId = GetPageIdByNavigationTag("MOT_TwenteLeeft"); 721 var jobAlertSubscription = GetPageIdByNavigationTag("JobAlertSubscription"); 722 var pageIdsWithoutModal = new List<int> { twenteLeeftPageId, jobAlertSubscription }; 723 724 // Get the item for the current page 725 TwenteBrandingItemModel pItem = null; 726 if (Model.ItemId != "1") //Item with ID 1 gives error 727 { 728 pItem = ItemHelper.GetTwenteBrandingItemForPage( 729 Model.ItemId, 730 Dynamicweb.Frontend.PageView.Current().ID.ToString(), 731 Dynamicweb.Frontend.PageView.Current().GlobalTags.GetTagByName("Global:Area.LongLang").Value 732 ); 733 } 734 735 if (pItem != null) 736 { 737 // Get main hashtag of the current page item 738 var mainHashtagId = pItem.MainHashtagIds.FirstOrDefault(); 739 if (!string.IsNullOrEmpty(mainHashtagId)) 740 { 741 var hashtagItem = Dynamicweb.Content.Items.Item.GetItemById(TwenteBranding.Models.Constants.StringConstants.ItemInstanceType.Hashtag, mainHashtagId); 742 mainHashtagModal = $"{ItemHelper.GetItemValue<string>(hashtagItem, TwenteBranding.Models.Constants.StringConstants.CustomItemTypes.BaseArticle.Title)}"; 743 } 744 } 745 746 // Dont show a modal on the following pages 747 if (pageIdsWithoutModal.Contains(Model.ID) || mainHashtagModal == "talent") 748 { 749 //do noting 750 } 751 else 752 { 753 // Show modal with link to vacancysubscription page on vacancy page and pages with #talent hashtag 754 if ((Model.ID == jobOffersPageId || jobOfferParentPageId == jobOffersPageId) 755 && jobAlertSubscriptionModalPageId > 0) 756 { 757 @RenderPageContent(jobAlertSubscriptionModalPageId) 758 } 759 // If the jobalert modal pageId has a value and utmCampaing matches the specified value 760 else if (jobAlertSubscriptionModalPageId > 0 && utmCampaign == "Remarketing vacaturebank") 761 { 762 @RenderPageContent(jobAlertSubscriptionModalPageId) 763 } 764 // Else if the newsletter pageId has a value, show the newsletter subscription modal 765 else if (newsletterSubscriptionModalPageId > 0) 766 { 767 @RenderPageContent(newsletterSubscriptionModalPageId) 768 } 769 } 770 } 771 </aside> 772 <script rel="prefetch" src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script> 773 <script acync rel="prefetch" src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script> 774 <script rel="prefetch" type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.lazy/1.7.9/jquery.lazy.min.js"></script> 775 <script rel="prefetch" type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.lazy/1.7.9/jquery.lazy.plugins.min.js"></script> 776 777 <script src="@appJs"></script> 778 @RenderSnippet("JavascriptBottom") 779 </body> 780 </html> 781 }