Error executing template "Designs/Yrkisdepilin/_parsed/Utbugving.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_34fc4c52cd164ea4a7a6397303c000af.Execute() in E:\dynamicweb.net\solutions\Sendistovan\yrkisdepilin.dw9.dynamicweb-cms.com\files\Templates\Designs\Yrkisdepilin\_parsed\Utbugving.parsed.cshtml:line 437
   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 @using System.IO; 2 @{ 3 string custom = "Files/Templates/Designs/Yrkisdepilin/css/custom.css"; 4 string ifolder = custom.Substring(0, custom.LastIndexOf("/")).ToString(); 5 string ifolderOnDisk = System.Web.HttpContext.Current.Server.MapPath(ifolder); 6 DirectoryInfo idirectoryInfo = new System.IO.DirectoryInfo(ifolderOnDisk); 7 string idatefetch=@idirectoryInfo+"\\custom.css"; 8 DateTime ilastmodified = File.GetLastWriteTime(@idatefetch); 9 custom=@custom+"?modified="+@ilastmodified.ToString("yyyy-MM-ddTHH:mm:ss"); 10 } 11 12 <!DOCTYPE html> 13 <html lang="fo"> 14 <head> 15 <!--$$Snippet(mySnippet)--> 16 <meta charset="utf-8"> 17 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 18 <meta name="viewport" content="width=device-width, initial-scale=1"> 19 20 <meta name="author" content=""> 21 22 <title>@GetValue("Title")</title> 23 @GetValue("MetaTags") 24 @GetValue("CopyRightNotice") 25 26 27 <!-- Bootstrap Core CSS --> 28 <link href="/Files/Templates/Designs/Yrkisdepilin/css/bootstrap.min.css" rel="stylesheet"> 29 30 <!-- Custom CSS --> 31 <link href="/Files/Templates/Designs/Yrkisdepilin/css/logo-nav.cs?version=1" rel="stylesheet"> 32 <link rel="stylesheet" href="/Files/Templates/Designs/Yrkisdepilin/css/meanmenu.css" media="all"> 33 <link href="@custom" rel="stylesheet"> 34 <link rel="stylesheet" href="https://use.typekit.net/qtr8cjk.css"> 35 <link href="/Files/Templates/Designs/Yrkisdepilin/themify-icons/themify-icons.css" rel="stylesheet"> 36 <link rel="stylesheet" type="text/css" href="/Files/Templates/Designs/Yrkisdepilin/css/tablesaw.css?version=1"> 37 <link href="/Files/Templates/Designs/Yrkisdepilin/fonts/fonts.css" rel="stylesheet"> 38 <link rel="shortcut icon" type="image/ico" href="/Files/Templates/Designs/Yrkisdepilin/img/favicon.ico"> 39 40 <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> 41 <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> 42 <!--[if lt IE 9]> 43 <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> 44 <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> 45 <![endif]--> 46 47 @GetValue("Stylesheets") 48 @GetValue("Javascripts") 49 </head> 50 51 <body> 52 <script src="https://consent.cookiefirst.com/banner.js" data-cookiefirst-key="c78a8256-c1c0-442e-b92b-ec33b0d49f31"></script> 53 <!-- Navigation --> 54 <nav class="navbar" role="navigation"> 55 <div class="container"> 56 <!-- Brand and toggle get grouped for better mobile display --> 57 <div class="navbar-header"> 58 59 <a class="navbar-brand" href="/"> 60 <img src="/Files/Templates/Designs/Yrkisdepilin/img/logo.svg"> 61 </a> 62 </div> 63 <!-- Collect the nav links, forms, and other content for toggling --> 64 <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> 65 @GetValue("DwNavigation(topmen)") 66 67 68 <div class="mynav hidden-md hidden-lg"> 69 @GetValue("DwNavigation(mobmen)") 70 71 </div><!-- #dl-menu end --> 72 73 <ul class="othertopmen"> 74 @{string area=GetString("DwAreaID"); 75 string langdk="dk"+@area; 76 string langfo="fo"+@area; 77 string srchclass="search"+@area; 78 } 79 <li class="searchtrigger searchtr @srchclass"> 80 <span class="ti-search topleit" id="topsrchtrig" data-toggle="modal" data-target="#myModal"></span> 81 <!--</li> 82 <li class="dansk dk @langdk"> 83 <a href="/?id=37">på dansk</a> 84 </li> 85 <li class="dansk fo @langfo"> 86 <a href="/">á føroyskum</a> 87 </li>--> 88 </li></ul> 89 </div> 90 <!-- /.navbar-collapse --> 91 </div> 92 <!-- /.container --> 93 </nav> 94 95 <!-- Page Content --> 96 @using System.Web; @using System.Text.RegularExpressions; @using Dynamicweb.Content; @{ string mynd=GetString("Item.Mynd"); } <div class="container-fluid submenu1"> <div class="container"> <div class="row"> <div class="col-xs-12"> @GetValue("DwNavigation(horizontalMenu1)") </div> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-md-3 visible-md visible-lg hidden-xs hidden-sm"> @GetValue("DwNavigation(vinstramenu)") </div> <div class="col-md-9 LeftMenuTrue utbugving" id="Innihald" title="Innihald"> @if(!String.IsNullOrEmpty(@mynd)){ <text> @{ string klipp=@GetString("Item.Mynd.Value.FocalPointParameters"); } </text> <div class="mynd"> <img src="/admin/public/getimage.ashx?image=@mynd&width=900&height=400&crop=7&@klipp" alt="@GetString(" item.heiti")"=""> </div> } <div class="utbspecrow"> <div class="col-md-8 nolpadding-md"> <h1>@GetString("Item.Heiti") </h1> @if(!String.IsNullOrWhiteSpace(GetString("Item.DansktHeiti"))){ <text> <div class="dktitle"> Danskt heiti: @GetString("Item.DansktHeiti") </div> </text> } <div class="tekstur"> @GetString("Item.Tekstur") </div> @if(!String.IsNullOrEmpty(@GetString("Item.Video"))){ var url = @GetString("Item.Video"); var uri = new Uri(url); var query = HttpUtility.ParseQueryString(uri.Query); var videoId = query["v"]; <text> <div class="embed-container"> <iframe src='https://www.youtube.com/embed/@videoId' frameborder='0' allowfullscreen=""></iframe> </div> </text> } @if (!String.IsNullOrEmpty(@GetString("Item.YvirskriftNamsaetlan")) && 1 == 2) { <h2> @GetString("Item.YvirskriftNamsaetlan") </h2> } @if (!String.IsNullOrEmpty(@GetString("Item.TeksturNamsaetlan")) && 1 == 2) { <div class="namstekstur"> @GetString("Item.TeksturNamsaetlan") </div> } @{ var namssidaid=0; string? namssidaidString=""; var heiti=""; var skulaleinki=""; } @if (!String.IsNullOrEmpty(@GetString("Item.Namsaetlan")) && 1==2) { <text> @{ string Namsatlanstring = @GetString("Item.Namsaetlan"); int Namsatlanid = Int32.Parse(@Namsatlanstring); var item = Dynamicweb.Content.Items.ItemManager.Storage.GetById("Namsskipan", @Namsatlanstring); <text> @if(!String.IsNullOrEmpty(Namsatlanstring)){ heiti = item["Yvirskrift"].ToString(); } </text> // writerimg = item["Mynd"].ToString().Replace("?x", "&x"); var Namsatlanpage = Dynamicweb.Services.Pages.GetPageForItem("Namsskipan", @Namsatlanstring); namssidaid = Dynamicweb.Services.Pages.GetPageForItem("Namsskipan", @Namsatlanstring).ID; namssidaidString=namssidaid.ToString(); } </text> } @if(!String.IsNullOrEmpty(GetString("Item.Skuli"))){ <h3> Hvar er skúlagongdin? </h3> if( @GetString("Item.SkulagongdFragreiding").Length > 10){ <div class="skulafragr"> @GetString("Item.SkulagongdFragreiding") </div> } <ul class="skulayvirlit"> <text> @foreach (LoopItem i in GetLoop("Item.Skuli.Options")) { if(@i.GetString("Item.Skuli.Option.IsSelected")=="True"){ <text> @{ string skulaidstring=@i.GetString("Item.Skuli.Option.Value"); var skulaitem = Dynamicweb.Content.Items.ItemManager.Storage.GetById("Skuli", @skulaidstring); skulaleinki = skulaitem["LeinkiTilHeimasiduSkulans"].ToString(); } </text> <li> @if(!String.IsNullOrEmpty(@skulaleinki.ToString())){ <text> @if(!skulaleinki.StartsWith("http")){ skulaleinki="http://"+skulaleinki; } </text> <a target="_blank" href="@skulaleinki">@i.GetString("Item.Skuli.Option.Label")</a> } else{ @i.GetString("Item.Skuli.Option.Label") } </li> } } </text> </ul> } @{ var ossloop = GetLoop("Item.OftaSpurdirSpurningar"); } <h3 class="OSS"> UM ÚTBÚGVINGINA </h3> <div class="frontsp sppage spuutb"> <div class="col-xs-12 nopadding"> <span class="spurningur sp" rel="svar">Bygnaður av útbúgving</span> <span class="svar sv" id="sv"> @{ var uppbloop = GetLoop("Item.Uppbygnadur"); } @if (uppbloop.Any()) { float totalweekcount=0; float thisweekcount=0; string virksemiclass=""; float divwidth=0; string divwidthstring=""; <text> <h3 class="utbuppbh3">@GetString("Item.UppbygnadurYvirskrift")</h3> @foreach(LoopItem i in GetLoop("Item.Uppbygnadur")){ totalweekcount=totalweekcount+@i.GetInteger("Item.Uppbygnadur.TalAvVikum"); } @foreach(LoopItem i in GetLoop("Item.Uppbygnadur")){ thisweekcount=@i.GetInteger("Item.Uppbygnadur.TalAvVikum"); divwidth= @thisweekcount / @totalweekcount; divwidth=divwidth * 100; divwidthstring=@divwidth.ToString().Replace(",","."); virksemiclass=@i.GetString("Item.Uppbygnadur.Virrksemi").Replace(" ","").Replace("Í","i").Replace("ú","u").Replace("ð","d").Replace("æ","ae"); <div style="width:@divwidthstring%;" class="@virksemiclass activity"></div> } <div class="upptxtblock"> <div class="desblk"> <div class="circle ilaeru"> </div> <div class="txtdesc"> Í læru </div> </div> @foreach(LoopItem i in GetLoop("Item.Uppbygnadur")){ if(@i.GetString("Item.Uppbygnadur.Virrksemi")!="Í læru"){ <text> @{ string circleextendclass=@i.GetString("Item.Uppbygnadur.Virrksemi").Replace(" ","").Replace("Í","i").Replace("ú","u").Replace("ð","d"); } </text> <div class="desblk"> <div class="circle @circleextendclass"> </div> <div class="txtdesc"> @i.GetString("Item.Uppbygnadur.Tekstur") </div> </div> } } </div> </text> } </span></div> </div> @foreach(LoopItem i in ossloop){ <text> @{ string spurningur = @i.GetString("Item.OftaSpurdirSpurningar.Spurningur"); string svar = @i.GetString("Item.OftaSpurdirSpurningar.Svar"); } <div class="frontsp sppage"> <div class="col-xs-12 nopadding"> <span class="spurningur sp" rel="svar">@spurningur</span> <span class="svar sv" id="sv">@svar</span> </div> </div> </text> } @if(!string.IsNullOrEmpty(@GetString("Item.Namsskipan"))){ <string> @{ string namsskipleinki = @GetString("Item.Namsskipan"); } </string> <a class="namsleinki" href="@namsskipleinki"> <img src="/Files/Templates/Designs/Yrkisdepilin/img/namsaetlan.svg" alt=""><div>Sí námsskipan</div><span class="ti-arrow-right"></span> </a> } <h3 class="OSS"> LÆRUPLÁSS </h3> <div class="frontsp lpslot sppage"> <div class="col-xs-12 nopadding"> <span class="spurningur sp" rel="svar">Hvar kann eg søkja lærupláss?</span> <span class="svar sv lpsvar" id="sv"> <p>Her er listi yvir lærupláss, sum í løtuni hava – ella hava havt - lærlingar í læru innan yrkið. Virkir og stovnar, sum ynskja at taka lærlingar í læru, skulu søkja um at fáa eina læruplássgóðkenning innan tey yrki, sum læruplássið kann bjóða.</p> <div id="LPDestination"> </div> </span> </div> </div> </div> <div class="col-md-4 norpadding-md pt-20"> @{ string obtxt=""; string oblink=""; var oydbloop = GetLoop("Item.Oydublad"); } @if (oydbloop.Any()) { <text> <div class="oydublodRightBox"> <div class="icon"> <i class="ti-download"></i> </div> <h3 class="utboydublod"> Viðkomandi oyðubløð </h3> <ul> @foreach(LoopItem i in GetLoop("Item.Oydublad")){ if(!String.IsNullOrEmpty(@i.GetString("Item.Oydublad.Tekstur__Leinki"))) { obtxt=@i.GetString("Item.Oydublad.Tekstur__Leinki"); } else{ obtxt=""; } foreach(LoopItem u in i.GetLoop("Item.Oydublad.Oydublad.Options")){ if(@u.GetString("Item.Oydublad.Oydublad.Option.IsSelected")=="True"){ if(String.IsNullOrEmpty(@obtxt)){ obtxt=@u.GetString("Item.Oydublad.Oydublad.Option.Label"); } string obidstring = @u.GetString("Item.Oydublad.Oydublad.Option.Value"); var obitem = Dynamicweb.Content.Items.ItemManager.Storage.GetById("Oydublad", @obidstring); oblink = obitem["LeinkiTilOydublad"].ToString(); } } <li><a href="@oblink">@obtxt</a></li> } </ul> </div> </text> } @{ string linktarget="_self"; string linklink=""; } @if(!String.IsNullOrEmpty(@GetValue("Item.Leinki").ToString())){ <div class="leinkiRightBox"> <div class="icon"> <i class="ti-arrow-right"></i> </div> <h3 class="utboydublod"> Viðkomandi leinki </h3> <ul> @foreach(LoopItem i in GetLoop("Item.Leinki")){ <text>@{ linklink=@i.GetString("Item.Leinki.Leinki"); }</text> if(@i.GetString("Item.Leinki.OptenInNewWindow")=="True"){ linktarget="_blank"; } else{ linktarget="_self"; } <li> <a target="@linktarget" href="@linklink">@i.GetString("Item.Leinki.Tekstur")</a> </li> } </ul> </div> } <!-- logir start --> @{ string lawtxt=""; string lawlink=""; var logloop = GetLoop("Item.Logir"); } @if (logloop.Any()) { <text> <div class="logirRightBox"> <div class="icon"> <i class="ti-arrow-right"></i> </div> <h3 class="utblogir"> Lógarverk </h3> <ul> @foreach(LoopItem i in GetLoop("Item.Logir")){ if(!String.IsNullOrEmpty(@i.GetString("Item.Logir.Tekstur__Leinki"))) { lawtxt=@i.GetString("Item.Logir.Tekstur__Leinki"); } else{ lawtxt=""; } foreach (LoopItem u in i.GetLoop("Item.Logir.Log.Options")) { if(@u.GetString("Item.Logir.Log.Option.IsSelected")=="True"){ if(String.IsNullOrEmpty(@lawtxt)){ lawtxt=@u.GetString("Item.Logir.Log.Option.Label"); } string lawidstring = @u.GetString("Item.Logir.Log.Option.Value"); var lawitem = Dynamicweb.Content.Items.ItemManager.Storage.GetById("LogEllaKunngerd", @lawidstring); lawlink = lawitem["LeinkiTilLogEllaKunngerd"].ToString(); } } <li><a target="_blank" href="@lawlink">@lawtxt</a></li> } @if(!string.IsNullOrEmpty(@GetString("Item.Namsskipan"))){ <string> @{ string namsskipleinkili = @GetString("Item.Id"); } </string> <li><a href="@namsskipleinkili">Námsskipan</a></li> } </ul> </div> </text> } <!-- logir end --> </div> </div> </div> </div> </div> 97 <footer> 98 <div class="container"> 99 <div class="row"> 100 <div class="col-md-3 col-xs-12">@GetString("Item.Area.FooterCol1")</div> 101 <div class="col-md-3 col-xs-12">@GetString("Item.Area.FooterCol2")</div> 102 <div class="col-md-3 col-xs-12">@GetString("Item.Area.FooterCol3")</div> 103 <div class="col-md-3 col-xs-12">@GetString("Item.Area.FooterCol4")</div> 104 </div> 105 </div> 106 </footer> 107 108 109 <div class="container-fluid footerbottom"> 110 <div class="container"> 111 <div class="row"> 112 <div class="col-12 text-center"> 113 <a class="kolofon" target="_blank" href="//www.sendistovan.fo"><img src="/Files/Templates/Designs/Yrkisdepilin/img/kolofon.svg" alt="Sendistovan">Ein loysn frá Sendistovuni</a> 114 </div> 115 </div> 116 </div> 117 </div> 118 119 <!-- Modal leiting --> 120 <div class="modal fade" id="myModal" role="dialog"> 121 <div class="modal-dialog modal-sm"> 122 <div class="modal-content"> 123 <div class="modal-header"> 124 <button type="button" class="close" data-dismiss="modal">&times;</button> 125 126 </div> 127 <div class="modal-body"> 128 <form id="leitiform" action="?id=9"> 129 <input type="hidden" name="id" value="9"> 130 <input type="text" id="q" name="q" placeholder="Leitiorð..."> 131 <span class="ti-search" id="searchButton"></span> 132 </form> 133 </div> 134 <div class="modal-footer"> 135 <button class="hide" type="button" class="btn btn-default" data-dismiss="modal">Lat aftur</button> 136 </div> 137 </div> 138 </div> 139 </div> 140 141 <!-- Modal leiting end --> 142 143 144 <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script> 145 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> 146 147 148 <script src="/Files/Templates/Designs/Yrkisdepilin/js/tablesaw.jquery.js?version=1"></script> 149 150 <script src="/Files/Templates/Designs/Yrkisdepilin/js/tablesaw-init.js?version=1"></script> 151 152 153 <script> 154 $(document).ready(function(){ 155 $('#searchButton').click(function(){ 156 $("#leitiform").submit(); 157 }) 158 }); 159 </script> 160 161 <script> 162 $(document).ready(function(){ 163 jQuery('.frontsp .spurningur').click( function() { 164 165 if ($(this).next('.svar').hasClass('svarOpen')) { 166 $(this).next('.svar').slideToggle('fast'); 167 $(this).next('.svar').removeClass('svarOpen'); 168 $(this).removeClass('spactive'); 169 } 170 171 else { 172 /*$('.svarOpen').slideToggle('fast'); 173 $('.svarOpen').removeClass('svarOpen'); 174 $('.spactive').removeClass('spactive'); 175 */ 176 $(this).next('.svar').slideToggle('fast'); 177 $(this).next('.svar').addClass('svarOpen'); 178 $(this).addClass('spactive'); 179 } 180 181 182 }) 183 184 }); 185 </script> 186 187 188 <script> 189 190 $(document).ready(function(){ 191 $( "a.anchorLink" ).click(function( event ) { 192 event.preventDefault(); 193 $("html, body").animate({ scrollTop: $($(this).attr("href")).offset().top }, 500); 194 }) 195 }); 196 197 </script> 198 199 <script src="/Files/Templates/Designs/Yrkisdepilin/js/jquery.meanmenu.js"></script> 200 201 <script> 202 jQuery(document).ready(function () { 203 jQuery('.mynav').meanmenu(); 204 205 $('body').on('shown.bs.modal', '#myModal', function () { 206 $('input:visible:enabled:first', this).focus(); 207 }) 208 209 }); 210 </script> 211 212 213 <script> 214 $(document).ready(function(){ 215 // Activate Carousel 216 $("#myCarousel").carousel({interval: 9000}); 217 218 219 }); 220 </script> 221 222 223 <script> 224 document.addEventListener("DOMContentLoaded", function(event){ 225 $(".th1click .tablesaw-sortable-btn").click(); 226 $(".th1click .tablesaw-sortable-btn").click(); 227 228 }); 229 </script> 230 231 <script> 232 $(".NPhead").click(function () { 233 $(this).find(".head").toggleClass('active'); 234 $(this).find(".NPContent").slideToggle('fast'); 235 }); 236 </script> 237 238 239 <script type="text/javascript"> 240 jQuery(document).ready(function(){ 241 242 243 if (document.getElementById("LPDestination") !== null) { 244 245 // document.getElementById("LPDestination").innerHTML='<object type="text/plain" data="/default.aspx?id=468&utb=@GetString("Item.Id.Value")"></object>'; 246 247 248 jQuery("#LPDestination").load("/ajax-goðkend-laeruplass?utb=@GetString("Item.Id.Value")", function () { 249 $('#ajaxtable').tablesaw().data("tablesaw").refresh(); 250 $('.th1click>button').click(); 251 $('.th1click>button').click(); 252 //alert("Er innlisið"); 253 }); 254 } 255 }); 256 </script> 257 258 259 260 261 <!-- Global site tag (gtag.js) - Google Analytics --> 262 <script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-34816188-1"></script> 263 <script> 264 window.dataLayer = window.dataLayer || []; 265 function gtag(){dataLayer.push(arguments);} 266 gtag('js', new Date()); 267 268 gtag('config', 'UA-34816188-1'); 269 </script> 270 271 272 273 274 </body> 275 276 </html> 277