Error executing template "Designs/SSTemplate/_parsed/news.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_8d04513d65104fb5a905744da44ebad1.Execute() in E:\dynamicweb.net\Solutions\Sendistovan\j2019.dw9.dynamicweb-cms.com\files\Templates\Designs\SSTemplate\_parsed\news.parsed.cshtml:line 198
   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 @using System.Web.Mvc; 2 @using System.Text.RegularExpressions; 3 @using System.Web; 4 @using System.IO; 5 @using System.Linq; 6 @{ 7 string basecss = "/Files/Templates/Designs/SSTemplate/css/base.css"; 8 string ifolder = basecss.Substring(0, basecss.LastIndexOf("/")).ToString(); 9 string ifolderOnDisk = System.Web.HttpContext.Current.Server.MapPath(ifolder); 10 DirectoryInfo idirectoryInfo = new System.IO.DirectoryInfo(ifolderOnDisk); 11 string idatefetch=@idirectoryInfo+"\\base.css"; 12 DateTime ilastmodified = File.GetLastWriteTime(@idatefetch); 13 basecss=@basecss+"?modified="+@ilastmodified.ToString("yyyy-MM-ddTHH:mm:ss"); 14 string stylecss = "/Files/Templates/Designs/SSTemplate/css/styles.css"; 15 string ufolder = stylecss.Substring(0, stylecss.LastIndexOf("/")).ToString(); 16 string ufolderOnDisk = System.Web.HttpContext.Current.Server.MapPath(ufolder); 17 DirectoryInfo udirectoryInfo = new System.IO.DirectoryInfo(ufolderOnDisk); 18 string udatefetch=@udirectoryInfo+"\\styles.css"; 19 string logo=@GetString("Item.Area.Design.Logo"); 20 DateTime ulastmodified = File.GetLastWriteTime(@udatefetch); 21 stylecss=@stylecss+"?modified="+@ulastmodified.ToString("yyyy-MM-ddTHH:mm:ss"); 22 }@{ 23 24 string kolofonimg=@GetString("Item.Area.Design.Ikon"); 25 }<!DOCTYPE html> 26 <html lang="fo"> 27 @{ 28 string pageid=@GetString("DwPageID"); 29 string readspeak=@GetString("Item.Area.Funktionalitetir.BaseUr")+"?id="+pageid; 30 string pagenametit=@GetString("DwPageName"); 31 32 string pagearea=@GetString("DwPageID_1"); 33 pagearea="top"+pagearea; 34 ViewBag.BaseUrl = @GetString("Item.Area.Funktionalitetir.BaseUr"); 35 ViewBag.StoddStarvs = @GetString("Item.Page.StoddStarv"); 36 }<head> 37 <meta charset="utf-8"> 38 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 39 <meta name="viewport" content="width=device-width, initial-scale=1"> 40 41 <meta name="author" content=""> 42 <meta property="og:url" content="@readspeak"> 43 <meta property="og:locale" content="fo_FO"> 44 <meta property="og:title" content="@pagenametit"> 45 <meta name="google-site-verification" content="_8UkOXR321xXc60VV1folaRbl3pukMQpv1ifNUwjZXU"> 46 <link rel="shortcut icon" type="image/ico" href="/Files/Templates/Designs/SSTemplate/img/favicon.ico"> 47 <link rel="shortcut icon" type="image/png" href="/Files/Templates/Designs/SSTemplate/img/favicon.png"> 48 @RenderSnippet("FBimg") 49 50 @foreach(LoopItem i in GetLoop("Item.Area.Design.Fontar")){ 51 52 @i.GetString("Item.Area.Design.Fontar.Font") 53 54 } 55 <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css"> 56 <link rel="stylesheet" href="/Files/Templates/Designs/SSTemplate/css/meanmenu.css?build=25"> 57 <link rel="stylesheet" href="@basecss"> 58 59 <link rel="stylesheet" href="@stylecss"> 60 61 62 <link type="text/css" rel="stylesheet" href="/Files/Templates/Designs/SSTemplate/css/base-mobil.css"> 63 <link type="text/css" rel="stylesheet" href="/Files/Templates/Designs/SSTemplate/css/styles-mobil.css"> 64 <script type="text/javascript" src="/Files/Templates/Designs/SSTemplate/Fontur/Javascript/Clan.js"></script> 65 @GetValue("CopyRightNotice") 66 @GetValue("MetaTags") 67 @GetValue("Stylesheets") 68 @GetValue("Javascripts") 69 </head> 70 <body> 71 72 <script src="https://consent.cookiefirst.com/banner.js" data-cookiefirst-key="17b974b4-88db-494d-b44a-84321fcda66f"></script> 73 74 @GetString("Item.Area.SomeAndShare.FacebookJaascriptSDK") 75 76 77 <div class="mynav d-md-none d-lg-none d-xl-none"> 78 @GetValue("DwNavigation(mobmen)") 79 80 </div><!-- #dl-menu end --> 81 82 <div class="TopTopMenu container-fluid d-none d-sm-none d-md-block"> 83 <div class="row"> 84 <div class="container"> 85 <div class="row"> 86 <div class="col-12 toptopred"> 87 <div class="samband"> 88 <a href="/"><img class="logoimg" src="@logo" alt="Javnaðarflokkurin"></a> 89 </div> 90 <div class="toptoplinks navigation"> 91 <a class="toptopfacebooklink" target="_blank" href="https://www.facebook.com/Javnadarflokkurin1925/"><span class="icon-share-facebook"><span class="path1"></span><span class="path2"></span><span class="path3"></span></span></a> 92 @GetValue("DwNavigation(topnavul)") 93 94 95 </div> 96 <div class="langswapper"> 97 </div> 98 <div class="cart"> 99 </div> 100 </div> 101 </div> 102 </div> 103 </div> 104 </div> 105 106 107 <div class="container d-none d-sm-none d-md-block"> 108 <div class="row"> 109 <div class="col-12" id="topmenu"> 110 111 @GetValue("DwNavigation(topmen1)") 112 113 <form method="get" action="?id=47" id="searchform" class="form-inline my-2 my-md-0 relative searchform"> 114 <input type="hidden" name="id" value="47"> 115 <input type="submit" class="hide"> 116 117 @{string placeholder=@GetString("Item.Area.NavAndSearch.PlaceholderTekstur");} 118 <input class="form-control stdsrchinput" name="q" type="text" placeholder="@placeholder"><span class="icon-search searchicon "></span> 119 120 </form> 121 </div> 122 </div> 123 </div><!--- NAVIGATION ---> 124 125 126 @if(@GetString("Item.SystemName")=="Frontpage"){ 127 <div class="container-fluid bottomheadborder"></div> 128 } 129 130 131 @if(GetBoolean("Item.ShowBradcrumbs") == true || @GetString("Item.SystemName")=="Greinaskrivari") 132 {<text> 133 <div class="container-fluid mb-0 bread"> 134 <div class="container"> 135 <div class="row"> 136 <div class="bread col my-3"> 137 @GetValue("DwNavigation(bread)") 138 </div> 139 </div> 140 </div> 141 </div> 142 </text> 143 } 144 <!--- BREADCRUMB ---> 145 146 @using System.Text.RegularExpressions; 147 @using System.Web; 148 @using Dynamicweb.Content; 149 150 @{ 151 string mynd=@GetString("Item.Area.Design.FacebookDeilFallback"); 152 153 string play=""; 154 string videostart=""; 155 156 int sidaid=0; 157 } 158 159 @if(!string.IsNullOrEmpty(@GetString("Item.Video"))){play="<span class='icon-media-video'></span>"; videostart="videostart";} 160 else {play="";} 161 162 @if(!String.IsNullOrEmpty(GetString("Item.Mynd"))){ 163 mynd = @GetString("Item.Mynd"); 164 mynd=@mynd.Replace(" ", "%20"); 165 } 166 167 168 @SnippetStart("FBimg") 169 <meta property="og:image" content="@ViewBag.BaseUrl@mynd"> 170 @SnippetEnd("FBimg") 171 172 173 174 175 176 <div class="container newsintro-parent relative"> 177 178 @{ 179 string writer=""; 180 string writerimg=""; 181 string imgcroppoint=""; 182 183 184 } 185 186 @if(GetBoolean("Item.GuestWriterONOFF")!=true){ 187 <text> 188 189 190 191 192 @if(!String.IsNullOrEmpty(@GetString("Item.GreinaskrivariDropdown"))){ 193 <text> 194 @{ 195 string writeridstring=@GetString("Item.GreinaskrivariDropdown"); 196 int writerid=Int32.Parse(@writeridstring); 197 var item = Dynamicweb.Content.Items.ItemManager.Storage.GetById("Greinaskrivari", @writeridstring); 198 writer = item["Navn"].ToString(); 199 <text> 200 @try{ 201 writerimg=item["Mynd"].ToString().Replace("?x", "&x");} 202 catch(Exception){} 203 </text> 204 var writerpage=Dynamicweb.Services.Pages.GetPageForItem("Greinaskrivari", @writeridstring); 205 sidaid = Dynamicweb.Services.Pages.GetPageForItem("Greinaskrivari", @writeridstring).ID; 206 207 208 209 } 210 </text> 211 } 212 213 </text> 214 } 215 else { 216 writer=@GetString("Item.GuestWriter"); 217 writerimg=@GetString("Item.GuestWriterImafge"); 218 imgcroppoint=@GetString("Item.GuestWriterImafge.FocalPointParameters"); 219 220 } 221 222 223 @if(!String.IsNullOrEmpty(@GetString("Item.Mynd"))){ 224 mynd=@GetString("Item.Mynd"); 225 } 226 227 @if(String.IsNullOrEmpty(@mynd)){ 228 229 mynd="/Files/Templates/Designs/SSTemplate/img/fallback-umbod.jpg"; 230 } 231 232 @if(sidaid!=0){ 233 <a class="authorcont hide-mobile" href="/default.aspx?id=@sidaid"> 234 @if(!String.IsNullOrEmpty(@writerimg)){ 235 <div class="autorimage"><img src="/Admin/Public/Getimage.ashx?image=@writerimg&width=140&height=140&Crop=7&@imgcroppoint"> </div> 236 } 237 238 <div class="authorname">@writer </div> 239 240 </a> 241 } 242 else{ 243 <div class="authorcont"> 244 @if(!String.IsNullOrEmpty(@writerimg)){ 245 <div class="autorimage"><img src="/Admin/Public/Getimage.ashx?image=@writerimg&width=140&height=140&Crop=7&@imgcroppoint"> </div> 246 } 247 248 <div class="authorname">@writer </div> 249 250 </div> 251 } 252 253 254 255 256 <div class="row"> 257 <div class="col-xl-9 col-12 col-md-10 mt-5 newsintro"> 258 @if(!String.IsNullOrEmpty(GetString("Item.NewsType"))){ 259 <text><span class="greintype">@GetString("Item.NewsType").Replace("Tidindi", "Tíðindi").Replace("Lesarabraev", "Lesarabræv")</span></text>}<span class="dato">@GetDate("Item.Dato").ToString("dd. MMMM yyyy")</span> 260 @if(!String.IsNullOrEmpty(@writer)){ 261 <div class="authorname author-mobile">@writer </div> } 262 263 <h1>@GetString("Item.Yvirskrift") </h1> 264 265 266 267 @if(!String.IsNullOrEmpty(GetString("Item.Inngangstekstur"))){ 268 <p class="introIII mt-4 mb-5">@GetString("Item.Inngangstekstur")</p> } 269 </div> 270 </div> 271 </div> <!--- INTRO TEXT ---> 272 273 <div class="container newsshare-parent"> 274 <div class="row"> 275 @if(@GetBoolean("Item.MogulleikaFyriAtDeila")==true){ 276 <text> 277 <div class="col-xl-1 col-md-0 share-parent"> 278 279 280 281 <div class="linja mt-5"></div> 282 <p class="share">Deil:</p> 283 <a href="#" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(location.href),'facebook-share-dialog','width=626,height=436');return false;"><span class="icon-share-facebook"><span class="path1"></span><span class="path2"></span><span class="path3"></span></span></a> 284 @{ 285 string pagename=@GetString("DwPageName"); 286 string pagelink=@HttpContext.Current.Request.Url.AbsoluteUri; 287 } 288 <a href="mailto:?Subject=@pagename&body=Trýst á leinki her @pagelink"><span class="icon-share-email"><span class="path1"></span><span class="path2"></span><span class="path3"></span></span></a> 289 290 291 </div> 292 </text> 293 } 294 <div class="col-12 col-xl-9 col-md-10 newsmynd-parent"> 295 @if(!String.IsNullOrEmpty(@GetString("Item.Mynd"))){ 296 <text> 297 298 299 <div class="newsitemimage relative @videostart"> 300 @{ 301 int focalx=@GetInteger("Item.Mynd.FocalX"); 302 int focaly=@GetInteger("Item.Mynd.FocalY"); 303 } 304 <img src="/Admin/Public/Getimage.ashx?image=@mynd&width=900&height=500&Crop=7&x=@focalx&y=@focaly" class="img-fluid mt-5 mb-5"> 305 @play 306 307 @if(!String.IsNullOrEmpty(@GetString("Item.Evni"))){ 308 <span class="newsevni">@GetString("Item.Evni")</span> 309 } 310 311 </div> 312 </text> 313 } 314 315 </div> 316 317 <div class="col-12 col-xl-2 col-md-2 newsmyndatekstur"> 318 @if(!String.IsNullOrEmpty(GetString("Item.Myndatekstur"))){ 319 <div class="linja mt-5 ml-2"></div> 320 321 <text> 322 <p class="myndatekstur ml-2">@GetString("Item.Myndatekstur")</p> 323 </text>} 324 </div> 325 </div> 326 </div> <!--- MYND ---> 327 328 329 <div class="container newscont"> 330 <div class="row"> 331 <div class="col-12 col-xl-7 offset-xl-2 col-sm-12 offset-sm-0 newstekstur"> 332 @GetString("Item.Tekstur") 333 </div> 334 </div> 335 </div> 336 337 338 @if(!String.IsNullOrEmpty(@GetString("Item.TeksturKnap")) && !String.IsNullOrEmpty(@GetString("Item.LeinkiKnappur"))){ 339 <text> 340 <div class="container newsknaplink-parent"> 341 <div class="row"> 342 <div class="col-12 offset-sm-2 "> 343 <h2 class="alternative newsknaplink offset-sm-2">@GetString("Item.YvirskriftTilKnapp")</h2> 344 </div> 345 <a href='@GetString("Item.LeinkiKnappur")' class="col-12 col-xl-7 offset-xl-2 col-sm-12 offset-sm-0 oydublad my-3"> 346 @GetString("Item.TeksturKnap") <span class="icon-download taknidur"></span> 347 </a> 348 </div> 349 </div> 350 351 </text> 352 } 353 354 @if(!String.IsNullOrEmpty(GetString("Item.YvirskrftMyndasavn"))){ 355 <div class="container newsgallery-parent"> 356 <div class="row"> 357 <h2 class="offset-sm-2 alternative">@GetString("Item.YvirskrftMyndasavn")</h2> 358 <div class="card-columns offset-md-1 col-md-9 col-12" id="lightgallery"> 359 360 @{ 361 foreach(var file in GetLoop("Item.Mappa.ListOfFiles")){ 362 <div class="card mb-4 "> <a class="item" href='@GetValue("Item.Mappa")/@file.GetValue("Item.Mappa.FileName")'><img class="card-img" src='/admin/public/getimage.ashx?&Image=@GetValue("Item.Mappa")/@file.GetValue("Item.Mappa.FileName")&Resolution=75&Compression=90&Width=200&Crop=0'></a> 363 </div> 364 } 365 } 366 367 </div> 368 <div class="col-md-2 col-12"> 369 <div class="linja ml-2"></div> 370 <p class="myndatekstur ml-2">@GetString("Item.TeksturTilMyndasavn")</p> 371 </div> 372 373 </div> 374 </div> } <!--- MASONRY ---> 375 376 377 378 <div class="container mb-5 hide"> 379 <div class="row"> 380 <div class="col-12 next"> 381 <div class="text-right"> 382 <a href="#"><p>Næst</p> <span class="icon-arrow-right"></span></a> 383 </div> 384 </div> 385 </div> 386 </div> 387 388 389 <!--- IN OTHER NEWS ---> 390 391 <div class="container-fluid bg-grey othernews-parent"> 392 <div class="container pb-5 othernews-heiti-parent"> 393 <div class="row othernews"> 394 395 <div class="col-12 m-4 othernews-heiti"> 396 <h2 class="text-center">Nýggjastu tíðindi og greinar</h2></div> 397 @RenderParagraphContent(3) 398 399 </div> 400 </div> 401 </div> 402 <!--- FOOTER ---> 403 404 405 <div class="container"> 406 <div class="col-12 text-center"> 407 <a class="scrolltop"> <span class="icon-backtotop"><span class="path1"></span><span class="path2"></span></span></a> 408 </div> 409 </div> 410 411 412 413 @if (!string.IsNullOrWhiteSpace(@GetString("Item.Video"))) { 414 <text> 415 <script> 416 document.addEventListener("DOMContentLoaded", function(event) { 417 $('.videostart').on('click', function() { 418 $(this).lightGallery({ 419 dynamic: true, 420 zoom: false, 421 youtubePlayerParams: { modestbranding: 1, showinfo: 0, controls: 0, rel: 0 }, 422 dynamicEl: [{ 423 "src": '@GetValue("Item.Video")' 424 }] 425 }) 426 427 }); 428 }); 429 430 431 </script> 432 433 </text>} 434 435 436 437 <div class="container-fluid footer"> 438 <div class="container"> 439 <div class="row "> 440 441 <div class="col-xl-3 col-md-12 col-12 mt-5"> 442 @RenderParagraphContent(27) 443 </div> 444 <div class="col-xl-3 col-md-4 col-12 mt-5"> 445 @RenderParagraphContent(28) 446 </div> 447 <div class="col-xl-3 col-md-4 col-12 mt-5"> 448 @RenderParagraphContent(29) 449 </div> 450 <div class="col-xl-3 col-md-4 col-12 mt-5 fourth"> 451 @RenderParagraphContent(30) 452 </div> 453 </div> 454 </div> 455 </div> 456 457 <div class="container-fluid footerbottom"> 458 <div class="container"> 459 <div class="row"> 460 <div class="col-12 text-center"> 461 <a class="kolofon" target="_blank" href="//www.sendistovan.fo"><img src="@kolofonimg" alt="Sendistovan">Ein loysn frá Sendistovuni</a> 462 </div> 463 </div> 464 </div> 465 </div> 466 467 468 <div class="mob-search"> 469 <form method="post" action="?id=47" id="mob-searchform"> 470 <input type="submit" class="hide"> 471 <input class="mobinput" name="q" type="text" placeholder="Leita"><span class="icon-search mob-searchicon mob-submit"></span> 472 <span class="icon-menu-close mob-search-close"></span> 473 474 </form> 475 </div> 476 477 478 <div class="mobilmenpush hide"> 479 480 @GetValue("DwNavigation(mobtoptopnav)") 481 482 483 </div> 484 485 486 <link type="text/css" rel="stylesheet" href="/Files/Templates/Designs/SSTemplate/lightgallery/css/lightgallery.min.css"> 487 <link rel="stylesheet" href="/Files/Templates/Designs/SSTemplate/css/tablesaw.css"> 488 <script src="/Files/Templates/Designs/SSTemplate/js/tablesaw.js"></script> 489 <script src="/Files/Templates/Designs/SSTemplate/js/tablesaw-init.js"></script> 490 <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> 491 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script> 492 <script src="/Files/Templates/Designs/SSTemplate/lightgallery/js/lightgallery.min.js"></script> 493 <script src="/Files/Templates/Designs/SSTemplate/lightgallery/js/lg-thumbnail.js"></script> 494 <script src="/Files/Templates/Designs/SSTemplate/lightgallery/js/lg-zoom.js"></script> 495 <script src="/Files/Templates/Designs/SSTemplate/lightgallery/js/lg-video.js"></script> 496 <script src="/Files/Templates/Designs/SSTemplate/js/sendistovan.js"></script> 497 498 499 500 <script src="/Files/Templates/Designs/SSTemplate/js/meanmenu.js?build=24"></script> 501 <script> 502 document.addEventListener("DOMContentLoaded", function(event){ 503 jQuery('.mynav').meanmenu(); 504 505 506 var div1Html = $('.mobilmenpush').html(); 507 508 $( ".meanmenu" ).append(div1Html); 509 510 $(".search-reveal").click(function(){ 511 512 513 $('.mob-search').fadeIn("fast"); 514 $('.mobinput').focus(); 515 }); 516 517 $(".mob-submit").click(function(){ 518 $('#mob-searchform').submit(); 519 }); 520 521 522 }); 523 524 </script> 525 526 <script> 527 window.addEventListener('resize', function(event){ 528 jQuery('.mynav').meanmenu(); 529 530 531 var div1Html = $('.mobilmenpush').html(); 532 533 $( ".meanmenu" ).append(div1Html); 534 535 $(".search-reveal").click(function(){ 536 537 538 $('.mob-search').fadeIn("fast"); 539 $('.mobinput').focus(); 540 }); 541 </script> 542 543 <script> 544 545 document.addEventListener("DOMContentLoaded", function(event){ 546 $('.mob-search').hide(); 547 548 $(".mob-search-close").click(function(){ 549 550 551 $('.mob-search').fadeOut("fast"); 552 }); 553 554 555 556 }); 557 </script> 558 559 560 561 562 563 @{ 564 string valevniid=@GetString("Item.Id"); 565 566 } 567 568 569 570 571 <script type="text/javascript"> 572 document.addEventListener("DOMContentLoaded", function(event){ 573 jQuery(".minunikkarow").load("/Default.aspx?ID=379&wid=@valevniid"); 574 }); 575 </script> 576 577 578 579 580 <script> 581 document.addEventListener("DOMContentLoaded", function(event){ 582 if(document.getElementById("cookiwarcont") !== null) 583 { 584 $('#cookiwarcont').load('/Default.aspx?ID=30'); 585 } 586 }); 587 </script> 588 589 @GetString("Item.Area.Funktionalitetir.FacebookTrackingPixul") 590 591 @if(!String.IsNullOrEmpty(@GetString("Item.Area.Funktionalitetir.TrackingID"))) { 592 <text> 593 @{ 594 string trackid=@GetString("Item.Area.Funktionalitetir.TrackingID");} 595 @GetString("Item.Area.Uppseting.GoogleMapApi") 596 <script async="" src="https://www.googletagmanager.com/gtag/js?id=@trackid"></script> 597 <script> 598 window.dataLayer = window.dataLayer || []; 599 function gtag(){dataLayer.push(arguments);} 600 gtag('js', new Date()); 601 602 gtag('config', '@GetString("Item.Area.Funktionalitetir.TrackingID")'); 603 </script> 604 </text> 605 } 606 607 608 609 </body> 610 </html> 611 612