Error executing template "Designs/Grundsalg/_parsed/frontpage.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_6d6319e3759b4783b65db652b5bc6427.CityOnline(Page city, Object areasJson) in E:\dynamicweb.net\Solutions\rksk.net.dynamicweb-cms.com\Website\Files\Templates\Designs\Grundsalg\_parsed\frontpage.parsed.cshtml:line 751
   at CallSite.Target(Closure , CallSite , RazorEngine_6d6319e3759b4783b65db652b5bc6427 , Page , Object )
   at CompiledRazorTemplates.Dynamic.RazorEngine_6d6319e3759b4783b65db652b5bc6427.Execute() in E:\dynamicweb.net\Solutions\rksk.net.dynamicweb-cms.com\Website\Files\Templates\Designs\Grundsalg\_parsed\frontpage.parsed.cshtml:line 232
   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 RazorTemplateBase<RazorTemplateModel<Template>> 2 @using System; 3 @using System.Web; 4 @using System.Linq; 5 @using Dynamicweb.Rendering; 6 7 8 @{ 9 bool isCommercialArea = GetGlobalValue("Global:Page.Top.ID") == "20101"; 10 string logoLink = isCommercialArea ? "/Default.aspx?ID=20101" : "/Default.aspx?ID=14315"; 11 bool gisActive = RKSK.Api.GroundSaleUtility.ServiceActive("https://gisext.rksk.dk/arcgis/rest/services/Temaer/MapServer/2/query?f=pjson"); 12 if (!gisActive) 13 { 14 string htmlError = "<div style='padding: 10px; font-size: 20px; font-weight:bold;'>Der er problemer med at indhente boliger lige nu. Vi arbejder p&aring; sagen!<br>Pr&oslash;v igen om 5 minutter.<p>"; 15 HttpContext.Current.Response.Flush(); 16 HttpContext.Current.Response.Write(htmlError); 17 HttpContext.Current.Response.End(); 18 } 19 } 20 21 @using System.IO; 22 @using System.Web; 23 24 @functions { 25 string GetImageUrl(string url, int width = 200, int height = 200){ 26 if (string.IsNullOrWhiteSpace(url)){ 27 url = string.Format("http://placehold.it/{0}x{1}", width, height); 28 } 29 else 30 { 31 url = url.Replace("http://rksk.dk", ""); 32 url = url.Replace("https://rksk.dk", ""); 33 } 34 35 if (!url.StartsWith("http://")){ 36 url = string.Format("/Admin/Public/GetImage.ashx?Image={0}&width={1}&height={2}", url, width, height); 37 } 38 return url; 39 } 40 41 42 string GetRandomImage(string path){ 43 44 string file = ""; 45 if (!string.IsNullOrEmpty(path)){ 46 var extensions = new string[] { ".png", ".jpg", ".gif" }; 47 try{ 48 var di = new DirectoryInfo(HttpContext.Current.Request.MapPath(path)); 49 50 var rgFiles = di.GetFiles("*.*").Where( f => extensions.Contains( f.Extension.ToLower())); 51 Random R = new Random(); 52 file = rgFiles.ElementAt(R.Next(0,rgFiles.Count())).FullName; 53 } 54 catch {} 55 } 56 57 string replace_file_root = System.Web.HttpContext.Current.Server.MapPath("/files"); 58 string file_replaced_root = file.Replace(replace_file_root, "/Files"); 59 60 string replace_slash = @"\"; 61 string file_replaced = file_replaced_root.Replace(replace_slash, "/"); 62 63 return file_replaced; 64 } 65 66 string GetTopImagePath(int pageid){ 67 68 string folder = "Borger"; 69 switch (pageid){ 70 case 74: 71 folder = "Erhverv"; 72 break; 73 case 76: 74 folder = "OmKommunen"; 75 break; 76 } 77 78 return folder; 79 } 80 81 } 82 83 <!DOCTYPE html> 84 <html lang="da"> 85 <head> 86 <meta http-equiv="content-type" content="text/xhtml; charset=utf-8"> 87 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> 88 89 @if (HttpContext.Current.Request.Url.Host.Contains(".rksk.vjm.dk")) 90 { 91 <meta name="robots" content="noindex,nofollow"> 92 } 93 94 <title>@GetValue("Title")</title> 95 @GetValue("MetaTags") 96 @GetValue("CopyRightNotice") 97 98 99 100 <script id="CookieConsent" src="https://policy.app.cookieinformation.com/uc.js" data-culture="DA" type="text/javascript"></script> 101 102 <link href='https://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> 103 <link href='https://fonts.googleapis.com/css?family=Bitter:400,700' rel='stylesheet' type='text/css'> 104 <link href='/Files/Templates/Designs/Grundsalg/css/styles.css?v=2' rel='stylesheet' type='text/css'> 105 <link href="/Files/Templates/Designs/rksk/favicon.ico" type="image/x-icon" rel="icon"> 106 <link href="/Files/Templates/Designs/rksk/favicon.ico" type="image/x-icon" rel="shortcut icon"> 107 108 @RenderSnippet("Links") 109 @RenderSnippet("Metas") 110 111 <!--[if lt IE 9]> 112 <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script> 113 <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.3.0/respond.js"></script> 114 <![endif]--> 115 116 @GetValue("Stylesheets") 117 @GetValue("Javascripts") 118 </head> 119 <body> 120 121 <nav class="nav--jump" aria-label="Genveje til indhold" title="Genveje til indhold"> 122 <ul> 123 <li> 124 <a href="#leftMenu" title="Spring til sidens menu" accesskey="1" class=""> 125 Navigation 126 </a> 127 </li> 128 <li> 129 <a href="#Indhold" title="Spring til indhold på siden" accesskey="2" class=""> 130 Indhold 131 </a> 132 </li> 133 </ul> 134 </nav> 135 136 <div class="site--topbar clearfix"> 137 <div class="container"> 138 <nav class="nav nav--topbar clearfix" aria-label="Privat eller erhverv grundsalg genveje"> 139 <ul> 140 <li><a href="/" title="Gå til privat grundsalg" class="@if(!isCommercialArea) { <text>active</text> }">Boliggrunde</a></li> 141 <li><a href="/erhverv" title="Gå til erhverv grundsalg" class="@if(isCommercialArea) { <text>active</text> }">Erhvervsgrunde</a></li> 142 </ul> 143 </nav> 144 </div> 145 </div> 146 147 <header class="site--header"> 148 <section class="container" aria-label="logo og hovednavigation"> 149 150 <a href="@logoLink" title="Gå til forside" aria-label="Logo desktop/tablet" class="site--logo hidden-xs hidden-sm"> 151 <img src="/Files/Templates/Designs/Grundsalg/img/logo_naturens_rige.png" alt="Logo Ringkøbing Skjern Kommune"> 152 </a> 153 154 155 <a href="@logoLink" title="Gå til forside" aria-label="Logo mobil" class="site--logo site--logo-mobile visible-xs visible-sm"> 156 <img src="/Files/Templates/Designs/Grundsalg/img/logo_stripped.png" alt="Logo Ringkøbing Skjern Kommune" width="50px"> 157 </a> 158 159 <div class="visible-xs visible-sm"> 160 <a id="DropdownMenu" class="nav-button" href="#"> 161 <span class="nav-button-icon">&#9776; Menu</span> 162 </a> 163 </div> 164 165 <nav aria-label="Hoved menu"> 166 @if (isCommercialArea) 167 { 168 @GetValue("DwNavigation(MainNavigationErhverv)") 169 } 170 else 171 { 172 @GetValue("DwNavigation(MainNavigation)") 173 174 } 175 </nav> 176 </section> 177 </header> 178 179 <div role="main" aria-label="Sidens indhold"> 180 @using System; 181 @using System.Web; 182 @using System.Net; 183 @using System.IO; 184 @using System.Text; 185 @using System.Data; 186 @using Newtonsoft.Json; 187 @using Dynamicweb.Data; 188 189 190 191 @{ 192 193 string areaType = isCommercialArea ? "erhverv" : "bolig"; 194 int groundTypeCode = 1; 195 string plotBaseGisUrl = "https://gisext.rksk.dk/arcgis/rest/services/Temaer/MapServer/2"; 196 string whereGisArea = @"where=""Paa_web""=%27JA%27"; 197 int parentPageId = 14319; 198 if (areaType == "erhverv") 199 { 200 groundTypeCode = 4; 201 plotBaseGisUrl = "https://gisext.rksk.dk/arcgis/rest/services/Temaer/MapServer/3"; 202 whereGisArea = @"where=""Paa_web_erhverv""=%27JA%27"; 203 parentPageId = 20102; 204 } 205 206 IEnumerable<Dynamicweb.Content.Page> cities = RKSK.Api.Page.GetPagesByParentID(parentPageId); 207 dynamic plotsJson = RKSK.Api.GroundSaleUtility.GetJson(plotBaseGisUrl + "/query?where=%22grund_type_kode%22="+ groundTypeCode + "%20and%20ADRESSE+is+not+Null&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=25832&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=25832&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=pjson"); 208 209 //get area 210 string urlGisArea = String.Format("https://gisext.rksk.dk/arcgis/rest/services/GISext_registrering/MapServer/18/query?{0}&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=25832&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=25832&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&f=pjson", whereGisArea); 211 dynamic areasJson = RKSK.Api.GroundSaleUtility.GetJson(urlGisArea); 212 213 214 //get town json data 215 string urlGisTown = "https://gisext.rksk.dk/arcgis/rest/services/GISext_registrering/MapServer/20/query?where=%22By_navn%22+is+not+Null&text=&objectIds=&time=&geometry=&geometryType=esriGeometryEnvelope&inSR=25832&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=*&returnGeometry=true&returnTrueCurves=false&maxAllowableOffset=&geometryPrecision=&outSR=25832&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&resultOffset=&resultRecordCount=&queryByDistance=&returnExtentsOnly=false&datumTransformation=%C2%B6meterValues=&rangeValues=&f=pjson"; 216 dynamic townsJson = RKSK.Api.GroundSaleUtility.GetJson(urlGisTown); 217 218 } 219 220 <div class="plot__frontpage"> 221 <div class="plot__frontpage__map__container"> 222 <div class="container"> 223 <div class="row"> 224 <div class="col-xs-12"> 225 <div class="plot__frontpage__map__areas hidden-xs"> 226 <div class="plot__frontpage__map__areas__header"> 227 Alle områder 228 </div> 229 <ul class="plot__frontpage__map__areas__list" id="leftMenu"> 230 @foreach (var city in cities) 231 { 232 if (CityOnline(city, areasJson)) 233 { 234 <li> 235 <a href="Default.aspx?ID=@city.ID" title="Gå til område: @city.MenuText">@city.MenuText</a> 236 </li> 237 } 238 239 } 240 </ul> 241 </div> 242 <div class="plot__frontpage__map__fullscreen"> 243 <a href="#" id="gofullscreen" class="btb btn-block plot__frontpage__map__fullscreen__btn" tabindex="-1"><span class="icon" aria-hidden="true">&#xf065;</span> Fuldskærm</a> 244 </div> 245 246 </div> 247 </div> 248 </div> 249 <div id="map" class="plot__frontpage__map" tabindex="-1"></div> 250 <div class="plot__frontpage__map__areas visible-xs" hidden="" aria-hidden="true"> 251 <div class="plot__frontpage__map__areas__header"> 252 Alle områder 253 </div> 254 <ul class="plot__frontpage__map__areas__list" id="leftMenu"> 255 @foreach (var city in cities) 256 { 257 if (CityOnline(city, areasJson)) 258 { 259 <li> 260 <a href="Default.aspx?ID=@city.ID" title="Gå til område: @city.MenuText">@city.MenuText</a> 261 </li> 262 } 263 } 264 </ul> 265 </div> 266 </div> 267 268 <div id="Indhold"> 269 270 <div class="plot__frontpage__teaser text-center"> 271 <div class="plot__frontpage__teaser__content"> 272 @GetValue("Item.TopTekst") 273 </div> 274 </div> 275 <div class="container"> 276 <div class="row"> 277 <div class="col-xs-12"> 278 <div class="plot__frontpage__plots"> 279 <div class="plot__frontpage__plots__header text-center"> 280 @GetValue("Item.BundTekst") 281 </div> 282 283 <div class="plot__frontpage__plots__header__seperator"> 284 &nbsp; 285 </div> 286 287 <div class="plot__frontpage__plots__filter clearfix"> 288 <ul role="tablist"> 289 <li class="active" data-id="popular" aria-controls="popular" role="tab" tabindex="0"> 290 Populære grunde 291 </li> 292 <li data-id="newest" aria-controls="newest" role="tab" tabindex="0"> 293 Nyeste 294 </li> 295 </ul> 296 </div> 297 298 <div class="plot__frontpage__plots__item__container"> 299 <div class="row"> 300 <div id="popular" aria-labelledby="popular" role="tabpanel" class="tabpanel"> 301 @{ 302 using (IDbConnection connection = Database.CreateConnection()) 303 { 304 IDbCommand commandNext = connection.CreateCommand(); 305 commandNext.CommandText = String.Format(@"SELECT TOP (6) COUNT(dbo.RkskPageStatistic.PageId) AS antal, Page.PageMenuText, Page.PageID, ItemType_Template__GrundsalgGrund.Omraadenr 306 FROM ItemType_Template__GrundsalgGrund 307 INNER JOIN Page ON ItemType_Template__GrundsalgGrund.Id = Page.PageItemId 308 INNER JOIN dbo.RkskPageStatistic ON dbo.Page.PageID = dbo.RkskPageStatistic.PageId 309 WHERE Page.PageItemType = 'Template__GrundsalgGrund' AND ItemType_Template__GrundsalgGrund.OmraadeType = '{0}' 310 GROUP BY dbo.RkskPageStatistic.PageId, Page.PageMenuText, Page.PageID, ItemType_Template__GrundsalgGrund.Omraadenr 311 ORDER BY antal DESC", areaType); 312 System.Data.IDataReader popularIDataReader = commandNext.ExecuteReader(); 313 314 while (popularIDataReader.Read()) 315 { 316 string areaNumber = popularIDataReader["Omraadenr"].ToString(); 317 string pageName = popularIDataReader["PageMenuText"].ToString(); 318 int pageId = Dynamicweb.Core.Converter.ToInt32(popularIDataReader["PageID"]); 319 string[] pageNameArr = pageName.Split(','); 320 321 322 string town = pageNameArr[0].Trim(); 323 string address = pageNameArr[1].Trim(); 324 325 //get attributes for plot 326 dynamic plotJsonAttributes = null; 327 foreach (var features in plotsJson.features) 328 { 329 if (features.attributes != null) 330 { 331 332 if (areaNumber == features.attributes.Omraadenr.ToString() && address == features.attributes.ADRESSE.ToString() && features.attributes.STATUS_SALG.ToString() == "Ledig") 333 { 334 plotJsonAttributes = features.attributes; 335 break; 336 } 337 } 338 } 339 340 //get attributes for area 341 dynamic areaJsonAttributes = null; 342 foreach (var features in areasJson.features) 343 { 344 if (features.attributes != null) 345 { 346 if (areaNumber == features.attributes.Omraadenr.ToString()) 347 { 348 areaJsonAttributes = features.attributes; 349 break; 350 } 351 } 352 } 353 354 if (plotJsonAttributes == null || areaJsonAttributes == null) 355 { 356 continue; 357 } 358 359 string photoUrl = plotJsonAttributes.Foto_1.ToString(); 360 photoUrl = photoUrl.Replace("https://grundsalg.rksk.dk", ""); 361 photoUrl = photoUrl.Replace("http://grundsalg.rksk.dk", ""); 362 363 string photo = String.Empty; 364 if (String.IsNullOrEmpty(photoUrl)) 365 { 366 photo = "/Files/Templates/Designs/Grundsalg/img/not-found.jpg"; 367 } 368 else 369 { 370 photo = GetImageUrl(photoUrl, 300, 200); 371 } 372 373 374 decimal buildingArea = RKSK.Api.GroundSaleUtility.CalculateBuildingArea(plotJsonAttributes.grundareal.ToString()); 375 376 <div class="col-md-4"> 377 <a href="/Default.aspx?ID=@pageId" title="Gå til: @address"> 378 <div class="plot__frontpage__plots__item"> 379 380 <div class="plot__frontpage__plots__item__image__wrapper"> 381 <img src="@photo" class="plot__frontpage__plots__item__image"> 382 <div class="icon plot__frontpage__plots__item__image__share" aria-hidden="true">&#xf064;</div> 383 </div> 384 <div class="plot__frontpage__plots__item__content"> 385 <p class="plot__frontpage__plots__item__content__road">@address</p> 386 <p class="plot__frontpage__plots__item__content__zip">@areaJsonAttributes.Postnr, @town</p> 387 <p class="plot__frontpage__plots__item__content__price">@String.Format("{0:#,##0.##}", Dynamicweb.Core.Converter.ToInt32(plotJsonAttributes.pris)) kr.</p> 388 </div> 389 390 <div class="plot__frontpage__plots__item__bottom"> 391 <div class="plot__frontpage__plots__item__bottom__boxes"> 392 <p>Grundareal</p> 393 <p>@plotJsonAttributes.grundareal &nbsp;</p> 394 </div> 395 <div class="plot__frontpage__plots__item__bottom__boxes"> 396 <p>Bygningsareal</p> 397 <p> 398 @if (buildingArea == 0) 399 { 400 <text>-</text> 401 } 402 else 403 { 404 @buildingArea 405 } 406 &nbsp; 407 </p> 408 </div> 409 <div class="plot__frontpage__plots__item__bottom__boxes"> 410 <p>Pris pr. kvm.</p> 411 <p>@plotJsonAttributes.kvm_pris &nbsp;</p> 412 </div> 413 </div> 414 <div class="clearfix"></div> 415 416 </div> 417 </a> 418 </div> 419 } 420 } 421 } 422 </div> 423 424 <div id="newest" aria-labelledby="newest" role="tabpanel" style="display: none;" class="tabpanel"> 425 @{ 426 using (IDbConnection connection = Database.CreateConnection()) 427 { 428 IDbCommand commandNext = connection.CreateCommand(); 429 commandNext.CommandText = String.Format(@"SELECT TOP (6) Page.PageMenuText, Page.PageID, ItemType_Template__GrundsalgGrund.Omraadenr 430 FROM ItemType_Template__GrundsalgGrund 431 INNER JOIN Page ON ItemType_Template__GrundsalgGrund.Id = Page.PageItemId 432 WHERE Page.PageItemType = 'Template__GrundsalgGrund' AND ItemType_Template__GrundsalgGrund.OmraadeType = '{0}' 433 ORDER BY Page.PageCreatedDate DESC", areaType); 434 System.Data.IDataReader newestIDataReader = commandNext.ExecuteReader(); 435 436 while (newestIDataReader.Read()) 437 { 438 string areaNumber = newestIDataReader["Omraadenr"].ToString(); 439 string pageName = newestIDataReader["PageMenuText"].ToString(); 440 int pageId = Dynamicweb.Core.Converter.ToInt32(newestIDataReader["PageID"]); 441 string[] pageNameArr = pageName.Split(','); 442 443 string town = pageNameArr[0].Trim(); 444 string address = ""; 445 if (pageNameArr.Length > 1) 446 { 447 address = pageNameArr[1].Trim(); 448 } 449 450 //get attributes for plot 451 dynamic plotJsonAttributes = null; 452 foreach (var features in plotsJson.features) 453 { 454 if (features.attributes != null) 455 { 456 if (areaNumber == features.attributes.Omraadenr.ToString() && address == features.attributes.ADRESSE.ToString() && features.attributes.STATUS_SALG.ToString() == "Ledig") 457 { 458 plotJsonAttributes = features.attributes; 459 break; 460 } 461 } 462 } 463 464 //get attributes for area 465 dynamic areaJsonAttributes = null; 466 foreach (var features in areasJson.features) 467 { 468 if (features.attributes != null) 469 { 470 if (areaNumber == features.attributes.Omraadenr.ToString()) 471 { 472 areaJsonAttributes = features.attributes; 473 break; 474 } 475 } 476 } 477 478 if (plotJsonAttributes == null || areaJsonAttributes == null) 479 { 480 continue; 481 } 482 483 string photoUrl = plotJsonAttributes.Foto_1.ToString(); 484 photoUrl = photoUrl.Replace("https://grundsalg.rksk.dk", ""); 485 photoUrl = photoUrl.Replace("http://grundsalg.rksk.dk", ""); 486 487 string photo = String.Empty; 488 if (String.IsNullOrEmpty(photoUrl)) 489 { 490 photo = "/Files/Templates/Designs/Grundsalg/img/not-found.jpg"; 491 } 492 else 493 { 494 photo = GetImageUrl(photoUrl, 300, 200); 495 } 496 497 decimal buildingArea = RKSK.Api.GroundSaleUtility.CalculateBuildingArea(plotJsonAttributes.grundareal.ToString()); 498 499 <div class="col-md-4"> 500 <a href="/Default.aspx?ID=@pageId" title="Gå til: @address"> 501 <div class="plot__frontpage__plots__item"> 502 503 <div class="plot__frontpage__plots__item__image__wrapper"> 504 <img src="@photo" class="plot__frontpage__plots__item__image"> 505 <div class="icon plot__frontpage__plots__item__image__share" aria-hidden="true">&#xf064;</div> 506 </div> 507 <div class="plot__frontpage__plots__item__content"> 508 <p class="plot__frontpage__plots__item__content__road">@address</p> 509 <p class="plot__frontpage__plots__item__content__zip">@areaJsonAttributes.Postnr, @town</p> 510 <p class="plot__frontpage__plots__item__content__price">@String.Format("{0:#,##0.##}", Dynamicweb.Core.Converter.ToInt32(plotJsonAttributes.pris)) kr.</p> 511 </div> 512 513 <div class="plot__frontpage__plots__item__bottom"> 514 <div class="plot__frontpage__plots__item__bottom__boxes"> 515 <p>Grundareal</p> 516 <p>@plotJsonAttributes.grundareal &nbsp;</p> 517 </div> 518 <div class="plot__frontpage__plots__item__bottom__boxes"> 519 <p>Bygningsareal</p> 520 <p> 521 @if (buildingArea == 0) 522 { 523 <text>-</text> 524 } 525 else 526 { 527 @buildingArea 528 } 529 &nbsp; 530 </p> 531 </div> 532 <div class="plot__frontpage__plots__item__bottom__boxes"> 533 <p>Pris pr. kvm.</p> 534 <p>@plotJsonAttributes.kvm_pris &nbsp;</p> 535 </div> 536 </div> 537 538 </div> 539 </a> 540 </div> 541 } 542 } 543 } 544 </div> 545 </div> 546 </div> 547 </div> 548 </div> 549 </div> 550 </div> 551 552 <div class="plot__frontpage__west text-center"> 553 <div class="plot__frontpage__west__content"> 554 <div class="plot__frontpage__west__aboveheader">Flyt mod vest</div> 555 <div class="plot__frontpage__west__header"> 556 Drømmer du om det gode liv? 557 </div> 558 <div class="plot__frontpage__west__belowheader"> 559 Læs mere om livet i Ringkøbing-Skjern Kommune 560 </div> 561 <a href="http://www.flytmodvest.dk/" target="_blank" class="btn btn-lg btn-primary" title="Se alle grunde">Besøg flyt mod vest</a> 562 </div> 563 </div> 564 </div> 565 </div> 566 567 @SnippetStart("JavaScript") 568 569 <script src="https://maps.google.com/maps/api/js?key=AIzaSyAMvetR2U-TCjlHH7NqzCGGiO8WPxbY1eo" type="text/javascript"></script> 570 <script> 571 572 $("#gofullscreen").on("click", function (event) { 573 event.preventDefault(); 574 $('.gm-fullscreen-control').trigger('click'); 575 }); 576 577 var map; 578 function initialize() { 579 var geocoder = new google.maps.Geocoder(); 580 581 var myOptions = { 582 center: { lat: 56.044689, lng: 8.35589 }, 583 zoom: 10, 584 mapTypeControl: false, 585 scaleControl: false, 586 streetViewControl: false, 587 rotateControl: false, 588 mapTypeId: google.maps.MapTypeId.ROADMAP, 589 styles: [ 590 { 591 "featureType": "administrative", 592 "elementType": "labels.text.fill", 593 "stylers": [ 594 { 595 "color": "#444444" 596 } 597 ] 598 }, 599 { 600 "featureType": "landscape", 601 "elementType": "all", 602 "stylers": [ 603 { 604 "color": "#f2f2f2" 605 } 606 ] 607 }, 608 { 609 "featureType": "poi", 610 "elementType": "all", 611 "stylers": [ 612 { 613 "visibility": "off" 614 } 615 ] 616 }, 617 { 618 "featureType": "road", 619 "elementType": "all", 620 "stylers": [ 621 { 622 "saturation": -100 623 }, 624 { 625 "lightness": 45 626 } 627 ] 628 }, 629 { 630 "featureType": "road.highway", 631 "elementType": "all", 632 "stylers": [ 633 { 634 "visibility": "simplified" 635 } 636 ] 637 }, 638 { 639 "featureType": "road.arterial", 640 "elementType": "labels.icon", 641 "stylers": [ 642 { 643 "visibility": "off" 644 } 645 ] 646 }, 647 { 648 "featureType": "transit", 649 "elementType": "all", 650 "stylers": [ 651 { 652 "visibility": "off" 653 } 654 ] 655 }, 656 { 657 "featureType": "water", 658 "elementType": "all", 659 "stylers": [ 660 { 661 "color": "#46bcec" 662 }, 663 { 664 "visibility": "on" 665 } 666 ] 667 } 668 ] 669 }; 670 map = new google.maps.Map(document.getElementById("map"), myOptions); 671 setmarkers(map, geocoder); 672 } 673 674 function setmarkers(map, geocoder) { 675 @foreach (var city in cities){ 676 if (!CityOnline(city, areasJson)) 677 { 678 continue; 679 } 680 681 string lattitude = ""; 682 string longitude = ""; 683 foreach (var features in townsJson.features) 684 { 685 if (features.attributes != null) 686 { 687 if (city.MenuText == features.attributes.By_navn.ToString()) 688 { 689 lattitude = features.attributes.Lattitude.ToString(); 690 longitude = features.attributes.Longitude.ToString(); 691 break; 692 } 693 } 694 } 695 696 if(!String.IsNullOrEmpty(lattitude) && !String.IsNullOrEmpty(longitude)) 697 { 698 <text> 699 var myLatlng = new google.maps.LatLng(@lattitude.Replace(",","."), @longitude.Replace(",", ".")); 700 var marker = new google.maps.Marker({ 701 map: map, 702 position: myLatlng, 703 title: "Gå til " + "@city.MenuText" 704 }); 705 706 google.maps.event.addListener(marker, 'click', function () { 707 top.location = "/Default.aspx?ID=@city.ID"; 708 }); 709 710 </text> 711 } 712 713 } 714 } 715 716 // Onload handler to fire off the app. 717 google.maps.event.addDomListener(window, "load", initialize); 718 </script> 719 720 <script> 721 $(document).ready(function () { 722 $('.plot__frontpage__plots__filter li').on('click keypress', function (e) { 723 724 var doit = true; 725 if (e.type == 'keypress') { 726 if (e.keyCode != 13) { 727 doit = false; 728 } 729 } 730 731 if (doit) { 732 $('.plot__frontpage__plots__filter li').removeClass('active'); 733 $(this).addClass('active'); 734 var filterBy = $(this).data('id'); 735 736 $('.tabpanel').hide(); 737 $("#" + filterBy).show(); 738 } 739 }); 740 }); 741 </script> 742 743 @SnippetEnd("JavaScript") 744 745 746 747 @functions { 748 749 public bool CityOnline(Dynamicweb.Content.Page city, dynamic areasJson) 750 { 751 foreach (var features in areasJson.features) 752 { 753 if (features.attributes != null) 754 { 755 if (city.MenuText == features.attributes.Bynavn.ToString()) 756 { 757 return true; 758 } 759 } 760 } 761 762 return false; 763 } 764 765 } 766 </div> 767 768 <footer class="site--footer-container"> 769 <section class="site--footer" aria-label="Kontakt og åbningstider"> 770 771 <div class="container"> 772 773 <div class="row"> 774 <div class="col-sm-4 col-xs-12"> 775 <div class="site--footer-content-container"> 776 <div class="row"> 777 <div class="site--footer-content col-md-12"> 778 @RenderParagraphContent(18971) 779 </div> 780 </div> 781 </div> 782 </div> 783 784 <div class="col-sm-4 col-xs-12"> 785 <div class="site--footer-content-container"> 786 <div class="row"> 787 <div class="site--footer-content col-md-12"> 788 @RenderParagraphContent(18972) 789 </div> 790 </div> 791 </div> 792 </div> 793 794 <div class="col-sm-4 col-xs-12"> 795 <div class="site--footer-content-container"> 796 <div class="row"> 797 <div class="site--footer-content col-md-12"> 798 @RenderParagraphContent(18973) 799 </div> 800 </div> 801 </div> 802 </div> 803 804 <div class="row"> 805 <div class="col-xs-12"> 806 <a href="https://www.rksk.dk/om-kommunen/organisation/databeskyttelse#accordion-8" title="Se privatlivspolitik gældende for www.rksk.dk og dens subdomæner" target="_blank">Privatlivspolitik gældende for www.rksk.dk og dens subdomæner</a><br> 807 <a href="https://www.rksk.dk/om-kommunen/organisation/databeskyttelse#accordion-7" title="Se kommunes cookiepolitik for www.rksk.dk og dens subdomæner" target="_blank">Kommunes cookiepolitik for www.rksk.dk og dens subdomæner</a> 808 </div> 809 </div> 810 </div> 811 812 </div> 813 814 </section> 815 </footer> 816 817 818 819 <div class="modal fade" id="sectionTypeModal" role="dialog" aria-labelledby="sectionTypeModalLabel" aria-modal="true" aria-hidden="true" tabindex="-1"> 820 <div class="modal-dialog"> 821 <div class="modal-content"> 822 <div class="site__sectiontype__container"> 823 <div class="h1" id="sectionTypeModalLabel"> 824 @GetString("Item.Area.ModalSectionTypeHeader") 825 </div> 826 <div class="site__sectiontype__content"> 827 @GetString("Item.Area.ModalSectionTypeContent") 828 </div> 829 <div class="site__sectiontype__buttons"> 830 <div class="row"> 831 <div class="col-sm-6"> 832 <a href="/" class="btn btn-block btn-primary" title="Gå til boliggrunde">Boliggrunde</a> 833 </div> 834 <div class="col-sm-6"> 835 <a href="/Default.aspx?ID=20101" class="btn btn-block site__sectiontype__buttons--blue" title="Gå til erhvervsgrunde">Erhvervsgrunde</a> 836 </div> 837 </div> 838 </div> 839 </div> 840 </div> 841 </div> 842 </div> 843 844 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> 845 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> 846 <script type="text/javascript" src="/Files/Templates/Designs/Grundsalg/js/scripts.min.js?v=2"></script> 847 848 @RenderSnippet("JavaScript") 849 850 <script> 851 // INLINE SCRIPT FOR AT SIKRE OS AT REPONSIVE BREDDER OVERHOLDES PÅ WINDOWS PHONE. 852 // http://getbootstrap.com/getting-started/#support-ie10-width 853 if (navigator.userAgent.match(/IEMobile\/10\.0/)) { 854 var msViewportStyle = document.createElement("style") 855 msViewportStyle.appendChild( 856 document.createTextNode( 857 "&#64;-ms-viewport{width:auto!important}" 858 ) 859 ) 860 document.getElementsByTagName("head")[0].appendChild(msViewportStyle) 861 } 862 </script> 863 864 <script type="text/javascript"> 865 window.addEventListener('CookieInformationConsentGiven', function (event) { 866 if (CookieInformation.getConsentGivenFor('cookie_cat_statistic')) { 867 /*<![CDATA[*/ 868 (function () { 869 var sz = document.createElement('script'); sz.type = 'text/javascript'; sz.async = true; 870 sz.src = '//siteimproveanalytics.com/js/siteanalyze_2542.js'; 871 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(sz, s); 872 })(); 873 /*]]>*/ 874 } 875 }, false); 876 </script> 877 </body> 878 </html></div>