Error executing template "Designs/TwenteBranding/_parsed/VideoArticle.parsed.cshtml"
System.ArgumentNullException: Value cannot be null.
Parameter name: source
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Dynamicweb.Frontend.XmlNavigation.GenerateXml(IEnumerable`1 pages, XmlElement parentNode)
at Dynamicweb.Frontend.XmlNavigation.GenerateXml(IEnumerable`1 pages, XmlElement parentNode)
at Dynamicweb.Frontend.XmlNavigation.MakeXml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, Int32 selectedAreaId)
at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(Int32 parentId, Int32 levelStart, Int32 levelStop, Expand expand, String name, String xsltPath, Int32 selectedAreaId, Boolean sitemapMode, NameValueCollection settings, NameValueCollection attributes, IncludeMode mode)
at Dynamicweb.Frontend.XmlNavigation.GetNavigationHtml(NameValueCollection settings, NameValueCollection attributes)
at Dynamicweb.Rendering.TemplateBase`1.RenderNavigation(Object settings)
at CompiledRazorTemplates.Dynamic.RazorEngine_e1b88d7d78fe415f94ab38009a69d47b.Execute() in D:\home\site\wwwroot\Files\Templates\Designs\TwenteBranding\_parsed\VideoArticle.parsed.cshtml:line 191
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.DynamicWrapperService.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 RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, ITemplateSource templateSource, String name, Type modelType, Object model, DynamicViewBag viewBag)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 2 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 3 @using TwenteBranding.Repository.Helpers 4 5 @{ 6 Title("Master view model template"); 7 Description("Master view model template"); 8 var currentPageView = Dynamicweb.Frontend.PageView.Current(); 9 var contentLanguage = currentPageView.GlobalTags.GetTagByName("Global:Area.Lang").Value; 10 var scheme = currentPageView.GlobalTags.GetTagByName("Global:Request.Scheme").Value; 11 var host = currentPageView.GlobalTags.GetTagByName("Global:Request.Host").Value; 12 var requestHost = string.Format("{0}://{1}", scheme, host); 13 var metaDescription = Model.Description; 14 var metaKeywords = Model.Keywords; 15 16 <!DOCTYPE html> 17 <html> 18 <head> 19 <title>@Model.Title</title> 20 @if (!string.IsNullOrWhiteSpace(metaDescription)) 21 { 22 <meta name="description" content="@metaDescription" /> 23 } 24 @if (!string.IsNullOrWhiteSpace(metaKeywords)) 25 { 26 <meta name="keywords" content="@metaKeywords" /> 27 } 28 <meta http-equiv="content-language" content='@contentLanguage' /> 29 <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> 30 <meta http-equiv="imagetoolbar" content="no" /> 31 <meta http-equiv="x-dns-prefetch-control" content="on" /> 32 <meta http-equiv="x-ua-compatible" content="ie=edge" /> 33 <meta name="viewport" content="width=device-width,initial-scale=1"> 34 <meta name="application-name" content="innovadis.com" /> 35 <meta name="author" content="Innovadis BV, Enschede" /> 36 <meta name="copyright" content='Innovadis BV, Enschede, @DateTime.Now.Year' /> 37 <meta name="web_author" content="Innovadis BV, Enschede" /> 38 <link rel="dns-prefetch" href='@requestHost' /> 39 <link rel="icon" href="/favicon.ico" type="image/x-icon" /> 40 <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> 41 <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" type="text/css" rel="stylesheet" /> 42 <link rel="stylesheet" type="text/css" href="~/Files/Templates/Designs/TwenteBranding/css/main.min.css" /> 43 <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Ubuntu:300i,400,500,700" rel="stylesheet"> 44 @{ var gaHeadCode = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Analytics.GoogleAnalyticsTrackingCode); 45 if (!string.IsNullOrWhiteSpace(gaHeadCode)) 46 { 47 <script> 48 (function (i, s, o, g, r, a, m) { 49 i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { 50 (i[r].q = i[r].q || []).push(arguments) 51 }, i[r].l = 1 * new Date(); a = s.createElement(o), 52 m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) 53 })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga'); 54 55 ga('create', '@gaHeadCode', 'auto'); 56 ga('send', 'pageview'); 57 </script> 58 } 59 } 60 @{ var gtmHeadCode = TwenteBranding.Repository.Helpers.AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.Analytics.GoogleTagManagerTrackingCode); 61 if (!string.IsNullOrWhiteSpace(gtmHeadCode)) 62 { 63 <script> 64 (function (w, d, s, l, i) { 65 w[l] = w[l] || []; w[l].push({ 66 'gtm.start': 67 new Date().getTime(), event: 'gtm.js' 68 }); var f = d.getElementsByTagName(s)[0], 69 j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src = 70 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f); 71 })(window, document, 'script', 'dataLayer', '@gtmHeadCode');</script> 72 } 73 } 74 @RenderSnippet("HeadSection") 75 76 @* Print alternate links and content-language meta tags *@ 77 @LanguageHelper.GetMasterLanguageTags(Model.ID) 78 </head> 79 <body> 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 <main class="twentebranding-container"> 90 @using Dynamicweb.Content 91 @using Dynamicweb.Ecommerce.International 92 @using TwenteBranding.Repository.Helpers 93 @using Page = System.Web.UI.Page 94 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 95 @{ 96 var websiteLanguages = Model.Area.Languages; 97 List<Dynamicweb.Content.Page> topNavigationPages = null; 98 99 int topNavigationFolderId = GetPageIdByNavigationTag("TopNavigation"); 100 if (topNavigationFolderId > 0) 101 { 102 var pageService = new Dynamicweb.Content.PageService(); 103 var topNavigationPageList = pageService.GetPagesByParentID(topNavigationFolderId); 104 if (topNavigationPageList != null && topNavigationPageList.Any()) 105 { 106 topNavigationPages = topNavigationPageList.Where(p => p.Active).ToList(); 107 } 108 } 109 110 var homelinkImage = IconHelper.GetSvgPath("twente", "logo/"); 111 112 <div id="homelink"> 113 <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> 114 </div> 115 116 var searchResultsPageId = AreaHelper.GetAreaItemStringValueBySystemName(TwenteBranding.Models.Constants.StringConstants.WebsiteSettings.PageIds.SearchResults); 117 118 // Top navigation Snippet 119 @SnippetStart("TopNavigation") 120 121 <div id="top-navigation"> 122 @if (topNavigationPages != null && topNavigationPages.Any()) 123 { 124 <ul class="pages"> 125 @foreach (var topNavigationPage in topNavigationPages) 126 { 127 var topNavigationPageName = topNavigationPage.GetDisplayName(); 128 var topNavigationPageTitle = string.Format("{0}: {1}", Translate("LinkTitlePrefix", "Navigeer naar"), topNavigationPageName).JsEncode(); 129 <li><a href="@string.Format("/Default.aspx?ID={0}", topNavigationPage.ID)" title="@topNavigationPageTitle" target="_top">@topNavigationPageName</a></li> 130 } 131 </ul> 132 } 133 134 @if (websiteLanguages != null && websiteLanguages.Any()) 135 { 136 <ul class="languages"> 137 @{ 138 var pageService = new PageService(); 139 var languagePages = pageService.GetLanguagePages(Model.ID); 140 141 foreach (var language in Model.Area.Languages) 142 { 143 var lang = language.Culture.Split('-')[0]; 144 var link = ""; 145 var listClass = language.IsCurrent ? "active" : ""; 146 var langTitle = string.Format("{0}: {1}", Translate("LinkTitlePrefix", "Navigeer naar"), language.Name).JsEncode(); 147 148 if (language.IsMaster && !language.IsCurrent) 149 { 150 var masterAreaPage = pageService.GetPagesByAreaID(1).SingleOrDefault(p => p.GetLanguageVersion(Model.Area.ID) != null && p.GetLanguageVersion(Model.Area.ID).ID.Equals(Model.ID)); 151 if (masterAreaPage != null) 152 { 153 link = string.Format("/Default.aspx?ID={0}", masterAreaPage.ID); 154 } 155 } 156 else if (language.IsCurrent) 157 { 158 link = "javascript:void(0);"; 159 } 160 else 161 { 162 foreach (var languagePage in languagePages) 163 { 164 var languageAreaId = language.ID; 165 if (languageAreaId == languagePage.AreaId) 166 { 167 link = string.Format("/Default.aspx?ID={0}", languagePage.ID); 168 } 169 } 170 } 171 172 //TODO: querystring? 173 174 <li class="@listClass" title="@langTitle"><a href="@link" target="_top">@lang</a></li> 175 } 176 } 177 </ul> 178 } 179 </div> 180 181 @SnippetEnd("TopNavigation") 182 183 // navigation SM 184 <div id="header_mobile" class="d-block d-md-none" data-hometext="@Translate("Navigation_HomeText", "Home")"> 185 <div class="header-mobile-icons"> 186 <a id="mobile-menu-button" class="icon-color--gray-4 icon--hamburger menu-icon"></a> 187 <a id="mobile-search-button" class="icon-color--gray-4 icon--search menu-icon"></a> 188 <a id="mobile-close-button" class="icon-color--gray-4 icon--cross menu-icon"></a> 189 </div> 190 <nav id="mobile-nav" class="navigation-mobile"> 191 @RenderNavigation(new { StartLevel = 1, EndLevel = 2, Template = "LIClean-mobile.xslt", Expandmode = "All" }) 192 <div class="mobile-topnavigation"> 193 @RenderSnippet("TopNavigation") 194 </div> 195 </nav> 196 <div id="mobile-navigation-submenu"></div> 197 198 <div id="mobile-search" class="search-mobile"> 199 @if (!string.IsNullOrWhiteSpace(searchResultsPageId)) 200 { 201 var searchResultUrl = string.Format("/Default.aspx?ID={0}", searchResultsPageId); 202 <form id="searchFormMobile" name="searchForm" method="POST" action="@searchResultUrl"> 203 <div id="top-search"> 204 <div class="input-group"> 205 <input type="text" class="form-control" name="q" id="q" placeholder="@Translate(" Searchbar_Placeholder", "Zoeken" )" aria-label="@Translate(" Searchbar_AriaLabel", "Zoeken" )" aria-describedby="basic-addon2"> 206 <div class="input-group-append"> 207 <button class="btn icon--search icon-color--gray-4 icon-size--x1 search-button-mobile" type="submit"></button> 208 </div> 209 </div> 210 </div> 211 </form> 212 } 213 </div> 214 </div> 215 216 // navigation MD+ 217 <div id="header" class="d-none d-md-block"> 218 <div class="container"> 219 220 @RenderSnippet("TopNavigation") 221 222 <nav id="navigation" data-hometext="@Translate("Navigation_HomeText", "Home")"> 223 @RenderNavigation(new { StartLevel = 1, EndLevel = 2, Template = "LIClean.xslt", Expandmode = "All" }) 224 </nav> 225 226 @if (!string.IsNullOrWhiteSpace(searchResultsPageId)) 227 { 228 var searchResultUrl = string.Format("/Default.aspx?ID={0}", searchResultsPageId); 229 <form id="searchForm" name="searchForm" method="POST" action="@searchResultUrl"> 230 <div id="top-search"> 231 <div class="input-group"> 232 <input type="text" class="form-control" name="q" id="q" placeholder="@Translate(" Searchbar_Placeholder", "Zoeken" )" aria-label="@Translate(" Searchbar_AriaLabel", "Zoeken" )" aria-describedby="basic-addon2"> 233 <div class="input-group-append"> 234 <button class="btn icon--search icon-color--gray-4 icon-size--x1 search-button" type="submit"></button> 235 </div> 236 </div> 237 </div> 238 </form> 239 } 240 </div> 241 <div id="navigation-submenu"></div> 242 </div> 243 } 244 <main> 245 @using TwenteBranding.Repository.Helpers 246 @using TwenteBranding.Models.Constants 247 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 248 249 @{ 250 var pService = new Dynamicweb.Content.PageService(); 251 var iService = new Dynamicweb.Content.ItemService(); 252 var pageView = Dynamicweb.Frontend.PageView.Current(); 253 var culture = pageView.GlobalTags.GetTagByName("Global:Area.LongLang").Value; 254 var itemPageId = pageView.ID; 255 var sidebar = pService.GetPageByNavigationTag(Model.Area.ID, StringConstants.NavigationTags.BaseArticleSidebar); 256 257 var item = ItemHelper.GetTwenteBrandingItemForPage(Model.ItemId, itemPageId.ToString(), culture, pService, iService); 258 if (item != null) 259 { 260 var hashtag = string.Format("{0}", item.MainHashtag); 261 var goalName = item.GoalName; 262 var background = goalName.FixNameForClass(); 263 var goalIcon = item.GoalIcon; 264 var goalUrl = item.GoalUrl; 265 var goalIconHeader = item.GoalIconHeader; 266 var goalType = item.GoalType; 267 var gradientCss = item.GoalGradientCss; 268 var video = item.Video; 269 var title = item.Title; 270 var introduction = Model.Item.GetString("Text"); 271 var headerImage = ""; 272 273 if (Model.Item.Fields.Where(x => x.SystemName.Contains("Image")).Count() > 0) 274 { 275 headerImage = Model.Item.GetString("ImageLarge"); 276 if (string.IsNullOrWhiteSpace(headerImage)) 277 { 278 headerImage = Model.Item.GetString("ImageWide"); 279 if (string.IsNullOrWhiteSpace(headerImage)) 280 { 281 headerImage = Model.Item.GetString("Image"); 282 } 283 } 284 } 285 286 @SnippetStart("ImageOrVideo") 287 if (string.IsNullOrWhiteSpace(video)) 288 { 289 if (!string.IsNullOrWhiteSpace(headerImage)) 290 { 291 <div class="header-image" style="background: url(@headerImage)"> 292 <h4 class="item-hashtag">@hashtag</h4> 293 @TwenteBranding.Repository.Helpers.ItemHelper.GetTileIconLink(goalIcon, goalUrl) 294 <div class="@gradientCss"></div> 295 </div> 296 } 297 } 298 else 299 { 300 <div class="header-video"> 301 <iframe src="@video"></iframe> 302 </div> 303 } 304 @SnippetEnd("ImageOrVideo") 305 306 <div class="main-container"> 307 308 <div class="top d-block d-md-none"> 309 @RenderSnippet("ImageOrVideo") 310 </div> 311 312 <div class="page-title article-title background--@background"> 313 <div class="container"> 314 <div class="grid header-grid "> 315 <div class="title"> 316 <h1 class="font-color--white">@title</h1> 317 @if (!string.IsNullOrWhiteSpace(introduction)) 318 { 319 <div class="sub-header font-color--white">@introduction</div> 320 } 321 <div class="read-full-article font-color--white">@Translate("BaseArticle_Read_Entire_Article", "Lees hieronder het hele artikel")<div class="icon--arrow-down">&nbsp;</div></div> 322 323 </div> 324 <div class="image"><img src="@goalIconHeader" /></div> 325 </div> 326 327 </div> 328 </div> 329 <div class="page-content container"> 330 <div class="grid detail-grid-container"> 331 332 @if (Model.Placeholder("Content").Any()) 333 { 334 <div class="content"> 335 <div class="top d-none d-md-block"> 336 @RenderSnippet("ImageOrVideo") 337 </div> 338 339 @Model.Placeholder("Content") 340 </div> 341 } else 342 { 343 <div class="content"></div> 344 } 345 346 @{ 347 if (sidebar != null) 348 { 349 <div class="sidebar"> 350 @RenderPageContent(sidebar.ID) 351 </div> 352 } 353 } 354 355 @if (Model.Placeholder("Bottom").Any()) 356 { 357 <div class="bottom"> 358 @Model.Placeholder("Bottom") 359 </div> 360 } 361 362 </div> 363 </div> 364 </div> 365 } 366 else 367 { 368 <div>No-Item</div> 369 } 370 } 371 </main> 372 @using TwenteBranding.Models.Constants 373 @using TwenteBranding.Repository.Helpers 374 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 375 376 @{ 377 var hashTags = AreaHelper.GetFooterHashTags(Model); 378 var hashTagsTitleField = Model.Area.Item.GetField(StringConstants.ItemInstanceType.FooterTagsTitle).GetValue(); 379 var hashTagsTitle = hashTagsTitleField == null ? "" : hashTagsTitleField.ToString(); 380 if (hashTags.Count > 0) 381 { 382 <div class="background--gray-1"> 383 384 <div class="hashtags-container container"> 385 @{ 386 if (!string.IsNullOrEmpty(hashTagsTitle)) 387 { 388 <div class="title"> 389 @hashTagsTitle 390 </div> 391 } 392 } 393 <div class="hashtags font-color--twente-red"> 394 @foreach (var tag in hashTags) 395 { 396 <a href="/Default.aspx?ID=@tag.ID">#@tag.MenuText</a> 397 } 398 </div> 399 </div> 400 </div> 401 } 402 } 403 404 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 405 <footer class="background--twente-red"> 406 <div class="container"> 407 <div class="social-media-icon-container"> 408 @using TwenteBranding.Repository.Helpers 409 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.PageViewModel> 410 411 @if (Model.Area.Item != null) 412 { 413 <ul> 414 @foreach (var field in Model.Area.Item.Fields.Where(f => f.SystemName.StartsWith("Sm_"))) 415 { 416 if (!string.IsNullOrEmpty(field.GetString())) 417 { 418 <li> 419 <a href="@field.GetString()" title="@field.Name.JsEncode()" target="_blank"> 420 <div class="social-media-icon icon--@field.SystemName.ToLower() icon-size--x2"></div> 421 </a> 422 </li> 423 } 424 } 425 </ul> 426 } 427 </div> 428 <div class="footer-link-container"> 429 @{ 430 List<Dynamicweb.Content.Page> footerNavigationPages = null; 431 int footerNavigationFolderId = GetPageIdByNavigationTag(TwenteBranding.Models.Constants.StringConstants.NavigationTags.FooterNavigation); 432 if (footerNavigationFolderId > 0) 433 { 434 var pageService = new Dynamicweb.Content.PageService(); 435 var footerNavigationPageList = pageService.GetPagesByParentID(footerNavigationFolderId); 436 if (footerNavigationPageList != null && footerNavigationPageList.Any()) 437 { 438 footerNavigationPages = footerNavigationPageList.Where(p => p.Active).ToList(); 439 if (footerNavigationPages != null && footerNavigationPages.Any()) 440 { 441 var footerLinkCounter = 1; 442 foreach (var footerNavigationPage in footerNavigationPages) 443 { 444 var footerNavigationPageName = footerNavigationPage.GetDisplayName(); 445 var footerNavigationPageTitle = string.Format("{0}: {1}", Translate("LinkTitlePrefix", "Navigeer naar"), footerNavigationPageName).JsEncode(); 446 var footerNavigationPageLink = string.Format("/Default.aspx?ID={0}", footerNavigationPage.ID); 447 448 if (footerNavigationPages.Count() == footerLinkCounter) 449 { 450 var copyRight = string.Format(Translate("Footer_CopyRight", "&copy; {0} Twente Branding"), DateTime.Now.Year); 451 452 <div class="footer-link-wrapper"> 453 <div class="footer-link"> 454 <a href="@footerNavigationPageLink" title="@footerNavigationPageTitle">@footerNavigationPageName</a> 455 </div> 456 <div class="footer-link"><span>@copyRight</span></div> 457 </div> 458 } 459 else 460 { 461 <div class="footer-link"> 462 <a href="@footerNavigationPageLink" title="@footerNavigationPageTitle">@footerNavigationPageName</a> 463 </div> 464 } 465 footerLinkCounter++; 466 } 467 } 468 } 469 } 470 } 471 </div> 472 </div> 473 </footer> 474 475 </main> 476 <script src="https://code.jquery.com/jquery-2.2.4.min.js" 477 integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" 478 crossorigin="anonymous"></script> 479 <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script> 480 <script src="~/Files/Templates/Designs/TwenteBranding/js/app.min.js"></script> 481 @RenderSnippet("JavascriptBottom") 482 </body> 483 </html> 484 }