Error executing template "Designs/Nh1816/_parsed/TPOffice.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at Bluedesk.DynamicWeb.ExtensionMethods.ItemExtensions.SerializeTo(Item source) in C:\vso\Nh1816 V2\Bluedesk.DynamicWeb\ExtensionMethods\ItemExtensions.cs:line 14
   at CompiledRazorTemplates.Dynamic.RazorEngine_9cdf71195b9342199da430cc622be09b.Execute() in D:\Dynamicweb.NET\NH1816Production\files\Templates\Designs\Nh1816\_parsed\TPOffice.parsed.cshtml:line 244
   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.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @using Dynamicweb; 3 4 <!DOCTYPE html> 5 @{ 6 var httpdomain = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 7 var ogurl = string.Format("{0}{1}", httpdomain, GetGlobalValue("Global:Pageview.Url")); 8 var ogdesc = GetString("Meta.Description"); 9 var currentURL = @GetGlobalValue("Global:Pageview.Url"); 10 } 11 <html lang="nl"> 12 <head prefix="og: http://ogp.me/ns#"> 13 <meta charset="utf-8"> 14 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 15 <meta name="viewport" content="width=device-width, initial-scale=1"> 16 <meta name="theme-color" content="#e95e40"> 17 <meta name="description" content="@ogdesc"> 18 <meta property="og:site_name" content="nh1816"> 19 <meta property="og:url" content="@ogurl"> 20 21 @RenderSnippet("ogTags") 22 <title>@GetValue("Title")</title> 23 @RenderSnippet("metaDescription") 24 25 <link href="/Files/Templates/Designs/Nh1816/dist/css/style.css?v=1.12" rel="stylesheet"> 26 <link rel="icon" href="/Files/Templates/Designs/Nh1816/img/favicon.png" type="image/x-icon"> 27 @GetString("Item.Area.Custom_Html_Head") 28 29 30 31 @renderRichSnippet() 32 33 @renderReviewSnippet() 34 35 @RenderSnippet("FaqList") 36 37 </head> 38 39 <body> 40 @GetString("Item.Area.Google_Tag_Manager") 41 42 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 43 @using Dynamicweb; 44 @{ 45 var HeaderCTALink = GetString("Item.Area.Header_CTA.Link.Value"); 46 var HeaderCTAText = GetValue("Item.Area.Header_CTA.Text.Value"); 47 var logOffID = GetString("Item.Area.LogoutPage.Value"); 48 } 49 50 <!-- Begin header --> 51 @{ 52 var logo = string.Empty; 53 var logoURL = string.Empty; 54 var hideHeaderCTA = false; 55 56 if (GetString("Item.Area.GoedeDoelenPage.Value") == GetString("DwTopPageID")) 57 { 58 logo = GetString("Item.Area.LogoStichtingGoedeDoelen.Value"); 59 logoURL = string.Format("/Default.aspx?Id={0}", GetString("Item.Area.GoedeDoelenPage.Value")); 60 hideHeaderCTA = true; 61 } 62 else if (GetString("Item.Area.IntermediairPage.Value") == GetString("DwTopPageID")) 63 { 64 logo = GetString("Item.Area.LogoIntermediair.Value"); 65 logoURL = string.Format("/Default.aspx?Id={0}", GetString("Item.Area.IntermediairPage.Value")); 66 hideHeaderCTA = true; 67 } 68 else if (GetString("DwTopPageID") == "1307") 69 { 70 logo = GetString("Item.Area.LogoNh1816.Value"); 71 logoURL = string.Format("/Default.aspx?Id={0}", GetString("Item.Area.ExtranetPage.Value")); 72 hideHeaderCTA = true; 73 } 74 else 75 { 76 logo = GetString("Item.Area.LogoNh1816.Value"); 77 logoURL = "/"; 78 } 79 } 80 <header class="header"> 81 <section class="container header__container"> 82 <div class="header__logo-wrapper"> 83 <a href="@logoURL" class="header__link header__logo" style="background-image: url(@logo);"></a> 84 </div> 85 86 <!-- Begin top-menu --> 87 <nav class="topmenu" id="topmenu"> 88 <div class="topmenu__container"> 89 @if (GetString("Item.Area.GoedeDoelenPage.Value") == GetString("DwTopPageID") || GetString("Item.Area.IntermediairPage.Value") == GetString("DwTopPageID")) 90 { 91 <a class="topmenu__goback" href="/">Terug naar Nh1816</a> 92 } 93 @GetValue("DwNavigation(topnavigation)") 94 </div> 95 </nav> 96 <!-- End Begin top-menu --> 97 98 @if (!hideHeaderCTA) 99 { 100 if (Pageview.Page.Parent != null && GetGlobalValue("Global:Extranet.UserID") != "0" && (GetString("Item.Area.ExtranetPage.Value") == Pageview.Page.Parent.ID.ToString() || GetString("Item.Area.SocialPage.Value") == Pageview.Page.Parent.ID.ToString())) 101 { 102 <div class="header__cta"> 103 <a href="/Admin/Public/extranetlogoff.aspx?ID=@logOffID" class="header__btn">Uitloggen</a> 104 </div> 105 } 106 else 107 { 108 <div class="header__cta hidden-md-up hidden-sm-down"> 109 <a href="@HeaderCTALink" class="header__btn"> 110 <i class="fontello fontello-advisor header__icon"></i> 111 @HeaderCTAText 112 </a> 113 </div> 114 } 115 116 } 117 </section> 118 </header> 119 <!-- End header --> 120 121 122 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 123 @using Dynamicweb; 124 125 <!-- Begin header --> 126 @{ 127 var logoMainmenu = string.Empty; 128 var logoURLMainmenu = string.Empty; 129 130 if (GetString("Item.Area.GoedeDoelenPage.Value") == GetString("DwTopPageID")) 131 { 132 logoMainmenu = GetString("Item.Area.LogoStichtingGoedeDoelen.Value"); 133 logoURLMainmenu = string.Format("/Default.aspx?Id={0}", GetString("Item.Area.GoedeDoelenPage.Value")); 134 } 135 else if (GetString("Item.Area.IntermediairPage.Value") == GetString("DwTopPageID")) 136 { 137 logoMainmenu = GetString("Item.Area.LogoIntermediair.Value"); 138 logoURLMainmenu = string.Format("/Default.aspx?Id={0}", GetString("Item.Area.IntermediairPage.Value")); 139 } 140 else if (GetString("DwTopPageID") == "1307") 141 { 142 logoMainmenu = GetString("Item.Area.LogoNh1816.Value"); 143 logoURLMainmenu = string.Format("/Default.aspx?Id={0}", GetString("Item.Area.ExtranetPage.Value")); 144 } 145 else 146 { 147 logoMainmenu = GetString("Item.Area.LogoNh1816.Value"); 148 logoURLMainmenu = "/"; 149 } 150 } 151 152 <!-- Begin main menu --> 153 <section class="mainmenu"> 154 <div class="mainmenu__bg"> 155 <nav class="container mainmenu__container"> 156 <div class="navbar-header mainmenu__navbar"> 157 <button type="button" class="navbar-toggle collapsed mainmenu__mobile-toggle" data-toggle="collapse" data-target="#navbarCollapse" aria-expanded="false"> 158 <span class="sr-only">Toggle navigation</span> 159 <span class="icon-bar"></span> 160 <span class="icon-bar"></span> 161 <span class="icon-bar"></span> 162 </button> 163 <div class="mainmenu__logo"> 164 <a href="@logoURLMainmenu" class="mainmenu__logo-link" style="background-image: url(@logoMainmenu);"></a> 165 </div> 166 </div> 167 @if (GetString("Item.Area.GoedeDoelenPage.Value") == GetString("DwTopPageID")) 168 { 169 @GetValue("DwNavigation(mainmenulistgoeddoel)") 170 } 171 else if (GetString("Item.Area.IntermediairPage.Value") == GetString("DwTopPageID")) 172 { 173 @GetValue("DwNavigation(mainmenulistintermediair)") 174 } 175 else if (GetString("Item.Area.ExtranetPage.Value") == GetString("DwTopPageID")) 176 { 177 @GetValue("DwNavigation(mainmenulistextranet)") 178 } 179 else if (GetString("Item.Area.SocialPage.Value") == GetString("DwTopPageID")) 180 { 181 @GetValue("DwNavigation(mainmenulistsocial)") 182 } 183 else 184 { 185 @GetValue("DwNavigation(mainmenulist)") 186 } 187 188 @{ 189 var searchpage = GetString("Item.Area.SearchPage"); 190 <div class="menu-search menu-search--mobile dropdown"> 191 <a href="#" class="menu-search__toggle dropdown-toggle" id="btnSearchMobile" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></a> 192 <form class="menu-search__form dropdown-menu" aria-labelledby="btnSearchMobile" method="get" action="/Default.aspx"> 193 <input type="hidden" name="ID" value="@searchpage"> 194 <input type="text" class="menu-search__input" name="q" value="" placeholder="Zoeken..."> 195 <button type="submit" class="menu-search__btn"></button> 196 </form> 197 </div> 198 } 199 </nav> 200 </div> 201 </section> 202 <!-- End main-menu --> 203 204 <div class="bddropdown-backdrop"></div> 205 206 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 207 @using Dynamicweb; 208 209 @if (!GetBoolean("Item.Page.HideBreadcrumbs")) 210 { 211 <div class="container"> 212 <nav class="breadcrumbnav"> 213 @GetValue("DwNavigation(breadcrumblist)") 214 </nav> 215 </div> 216 } 217 218 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 219 @using Dynamicweb; 220 @using Dynamicweb.Content; 221 @using System.Web; 222 @using System.Collections; 223 @using System.Collections.Generic; 224 @using System.Linq; 225 @using HtmlAgilityPack; 226 @using Bluedesk.DynamicWeb.ExtensionMethods; 227 228 229 230 @{ 231 232 // What are we showing ? 233 var currentItemType = Pageview.Item.SystemName; 234 235 // check if we are showing the main office (main office has type TPOffice, sub offices are of type TPOfficeManual 236 var showingMainOffice = "TPOffice".Equals(currentItemType); 237 238 var officeData = bdPoi.TPOffice.CreateFrom(Pageview.Item.SerializeTo()); 239 var relatedOffice = new bdPoi.TPOfficeManual(); 240 //officeData.reviews.Total 241 if (!showingMainOffice) 242 { 243 // related office is displayed, we should start with loading the parent item for the default values. SerializeTo() with no parameters is an extension from the Bluedesk.DynamicWeb library 244 officeData.DeserializeFrom(Pageview.Page.Parent.Item.SerializeTo()); 245 relatedOffice.DeserializeFrom(Pageview.Item.SerializeTo()); 246 // merge related office data into the main office. All available data from the related office will override de data of the main office. 247 // Take special care of the Name fields, they should both be filled. Title for the url and OfficeName for the header. 248 officeData.Merge(relatedOffice); 249 } 250 251 var defaultDesc = string.Format("Bij {0} in {1} kunt u terecht voor terecht voor persoonlijk verzekeringsadvies afgestemd op uw situatie. Kom direct met ons in contact!", GetString("Item.Title"), UppercaseFirst(GetString("Item.AddressCity").ToLower())); 252 var metaDescription = GetString("Item.Description.Value"); 253 254 if (!string.IsNullOrWhiteSpace(metaDescription) && metaDescription.Length > 300) 255 { 256 metaDescription = metaDescription.Substring(0, 300); 257 HtmlDocument htmldoc = new HtmlDocument(); 258 htmldoc.LoadHtml(metaDescription); 259 metaDescription = htmldoc.DocumentNode.InnerText + "..."; 260 } 261 if (metaDescription.Length == 0) 262 { 263 metaDescription = defaultDesc; 264 } 265 266 } 267 268 @SnippetStart("metaDescription") 269 <meta name="description" content="@metaDescription"> 270 @SnippetEnd("metaDescription") 271 272 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 273 @using Dynamicweb; 274 @using System.Linq; 275 276 @SnippetStart("ogTags") 277 278 @{ 279 var ogtitle = GetString("Title"); 280 var og_item_image = GetString("Item.Image"); 281 var og_page_image = GetString("Item.Page.Og_Image"); 282 283 var TPOimage = !string.IsNullOrWhiteSpace(officeData.Image) ? officeData.Image : ""; 284 var TPOlogo = !string.IsNullOrWhiteSpace(officeData.Logo) ? officeData.Logo : ""; 285 286 var ogimage = ""; 287 288 if (!string.IsNullOrWhiteSpace(TPOlogo)) 289 { 290 ogimage = string.Format("{0}{1}", httpdomain, TPOlogo); 291 } 292 else if (!string.IsNullOrWhiteSpace(TPOimage)) 293 { 294 ogimage = string.Format("{0}{1}", httpdomain, TPOimage); 295 } 296 } 297 298 @{ 299 var adviseur = UppercaseFirst(GetString("Item.AddressCity").ToLower()); 300 var title = string.Format("{0} | Uw verzekeringsadviseur in {1}", GetString("Title"), adviseur); 301 302 if (title.Length >= 55) 303 { 304 title = string.Format("{0} | {1}", GetString("Title"), adviseur); 305 } 306 307 } 308 309 <title>@title@*@GetValue("Title")*@</title> 310 <meta property="og:title" content="@ogtitle"> 311 <meta property="og:description" content="@ogdesc"> 312 <meta property="og:type" content="website"> 313 <meta property="og:image" content="@ogimage"> 314 <meta property="og:image:url" content="@ogimage"> 315 <meta property="og:image:secure_url" content="@ogimage"> 316 @SnippetEnd("ogTags") 317 318 @functions { 319 public string UppercaseFirst(string s) 320 { 321 // Check for empty string. 322 if (string.IsNullOrEmpty(s)) 323 { 324 return string.Empty; 325 } 326 // Return char and concat substring. 327 return char.ToUpper(s[0]) + s.Substring(1); 328 } 329 } 330 331 <div class="container"> 332 333 <nav class="breadcrumbnav"> 334 @GetValue("DwNavigation(15076caa6527a9904a49a34f3020a0a0)") 335 </nav> 336 337 <div class="row" id="adviseur-content1">@GetValue("DwContent(adviseurcontent1)")</div> 338 339 <div class="row adviseur"> 340 <div class="col-md-6 col-md-push-6 col-xs-12"> 341 <div class="adviseur__details"> 342 @if (!string.IsNullOrWhiteSpace(officeData.Image)) 343 { 344 var fotoPath = HttpContext.Current.Server.MapPath(officeData.Image); 345 346 bool fotoExists = System.IO.File.Exists(fotoPath); 347 348 if (fotoExists) 349 { 350 <img class="adviseur__foto" src="@officeData.Image" alt="@officeData.Name() teamfoto"> 351 } 352 } 353 @if (!string.IsNullOrWhiteSpace(officeData.Logo)) 354 { 355 var logoPath = HttpContext.Current.Server.MapPath(officeData.Logo); 356 357 bool logoExists = System.IO.File.Exists(logoPath); 358 359 if (logoExists) 360 { 361 <img class="adviseur__logo" src="/admin/public/getimage.ashx?image=@(officeData.Logo)&height=480&compression=100" alt="@officeData.Name() logo"> 362 } 363 } 364 365 <div class="adviseur__button-wrapper clearfix"> 366 <div class="row less-gutter"> 367 <div class="col-lg-4 col-md-6 col-sm-4"> 368 <div class="adviseur__button"> 369 <a class="btn btn-default adviseur__belme" id="btnCallMeBack">@Translate("Bel me terug")</a> 370 </div> 371 </div> 372 <div class="col-lg-4 col-md-6 col-sm-4"> 373 <div class="adviseur__button"> 374 <a class="btn btn-default adviseur__vraag" id="btnAskQuestion">@Translate("Stel een vraag")</a> 375 </div> 376 </div> 377 <div class="col-lg-4 col-md-12 col-sm-4"> 378 @if (!string.IsNullOrWhiteSpace(officeData.ContactUrl)) 379 { 380 var url = officeData.ContactUrl.Contains("http") ? officeData.ContactUrl : "http://" + officeData.ContactUrl; 381 <div class="adviseur__button adviseur__button--vraag"> 382 <a href="@url" class="btn btn-default adviseur__website" target="_blank">@Translate("Naar de website")</a> 383 </div> 384 } 385 </div> 386 </div> 387 </div> 388 389 @if (!string.IsNullOrWhiteSpace(officeData.NormalizedPhoneNr())) 390 { 391 <a class="adviseur__telefoon" href="tel:@officeData.NormalizedPhoneNr(true)">Tel @officeData.NormalizedPhoneNr()</a> 392 } 393 </div> 394 </div> 395 396 <div class="col-xs-12 hidden-md-up" id="openhoursMobile"> 397 @openhoursSnippet(officeData) 398 </div> 399 400 <div class="col-md-6 col-md-pull-6 col-xs-12"> 401 <h1>@officeData.Name()</h1> 402 <div class="adviseur__usps"> 403 @{ 404 if (!string.IsNullOrWhiteSpace(officeData.USP_1)) 405 { 406 <div class="adviseur__usp">@officeData.USP_1</div> 407 } 408 if (!string.IsNullOrWhiteSpace(officeData.USP_2)) 409 { 410 <div class="adviseur__usp">@officeData.USP_2</div> 411 } 412 if (!string.IsNullOrWhiteSpace(officeData.USP_3)) 413 { 414 <div class="adviseur__usp">@officeData.USP_3</div> 415 } 416 } 417 </div> 418 <div class="adviseur__tekst"> 419 @officeData.Description 420 </div> 421 </div> 422 <div class="adviseur__line hidden-sm-up margin-bottom__tablet--md"> 423 <a id="leesverder" class="adviseur__leesverder" href="#">lees verder</a> 424 </div> 425 </div> 426 427 <div class="row" id="adviseur-content2">@GetValue("DwContent(adviseurcontent2)")</div> 428 429 <div class="row beoordelingen"> 430 @if (!string.IsNullOrWhiteSpace(officeData.FX_SATotal) || !string.IsNullOrWhiteSpace(officeData.FX_ACTotal)) 431 { 432 <h2 class="beoordeling__headingtitle">Beoordeling</h2>} 433 434 @if (!string.IsNullOrWhiteSpace(officeData.FX_SATotal) && !string.IsNullOrWhiteSpace(officeData.FX_SATotalReviews)) 435 { 436 <div class="col-md-6 col-xs-12 beoordeling"> 437 <div class="beoordeling__top"> 438 <h3 class="beoordeling__title-big">Schade afhandeling</h3> 439 @if (!string.IsNullOrWhiteSpace(officeData.FX_SATotal)) 440 { 441 <div class="beoordeling__cloud"> 442 <span class="beoordeling__cloud-grade">@officeData.FX_SATotal.Replace(".", ",")</span> 443 </div> 444 } 445 <div class="beoordeling__text-container clearfix"> 446 <span class="beoordeling__text"> 447 @GetString("Item.Area.SAFeeddexText") 448 </span> 449 </div> 450 <div class="clearfix beoordeling__details"> 451 <a href="#" class="beoordeling__details-button">Details</a> 452 </div> 453 </div> 454 455 <div class="beoordeling__bottom clearfix"> 456 <div class="row no-gutter"> 457 @ShowReviewScore("Toegankelijkheid", officeData.FX_SAToegankelijkheid) 458 @ShowReviewScore("Resultaat afhandeling", officeData.FX_SAResultaat) 459 @ShowReviewScore("Dienstverlening", officeData.FX_SADienstverlening) 460 @ShowReviewScore("Persoonlijke service", officeData.FX_SAService) 461 </div> 462 </div> 463 </div> 464 } 465 466 @if (!string.IsNullOrWhiteSpace(officeData.FX_ACTotal) && !string.IsNullOrWhiteSpace(officeData.FX_ACTotalReviews)) 467 { 468 <div class="col-md-6 col-xs-12 beoordeling"> 469 <div class="beoordeling__top"> 470 <h3 class="beoordeling__title-big">Nieuwe verzekering</h3> 471 <div class="beoordeling__cloud"> 472 <span class="beoordeling__cloud-grade">@officeData.FX_ACTotal.Replace(".", ",")</span> 473 </div> 474 <div class="beoordeling__text-container clearfix"> 475 <span class="beoordeling__text"> 476 @GetString("Item.Area.ACFeeddexText") 477 </span> 478 </div> 479 <div class="clearfix beoordeling__details"> 480 <a href="#" class="beoordeling__details-button">Details</a> 481 </div> 482 </div> 483 <div class="beoordeling__bottom clearfix"> 484 <div class="row no-gutter"> 485 @ShowReviewScore("Toegankelijkheid", officeData.FX_ACToegankelijkheid) 486 @ShowReviewScore("Resultaat afhandeling", officeData.FX_ACResultaat) 487 @ShowReviewScore("Dienstverlening", officeData.FX_ACDienstverlening) 488 @ShowReviewScore("Persoonlijke service", officeData.FX_ACService) 489 </div> 490 </div> 491 </div> 492 } 493 </div> 494 495 496 @if (Pageview.Page.Parent.Item != null && Pageview.Page.Parent.Item.SystemName == "TPOffice") 497 { 498 // show parent paragraphs 499 var pageID = Pageview.Page.ParentPageId; 500 System.Data.DataTable paragraphList = Bluedesk.DynamicWeb.DataAccess.DynamicwebData.Query("SELECT dbo.Paragraph.ParagraphId FROM dbo.ItemType_Review INNER JOIN dbo.Paragraph on dbo.ItemType_Review.Id = dbo.Paragraph.ParagraphItemId AND dbo.Paragraph.ParagraphItemType = 'Review' WHERE dbo.Paragraph.ParagraphPageId= @pageId AND dbo.Paragraph.ParagraphShowParagraph = 1 ORDER BY dbo.ItemType_Review.ReviewDate desc", new System.Data.SqlClient.SqlParameter("pageId", pageID)); 501 502 <div class="row" id="adviseur-content3"> 503 @foreach (System.Data.DataRow par in paragraphList.Rows) 504 { 505 @RenderParagraphContent((int)par[0]); 506 } 507 </div> 508 } 509 else 510 { 511 var pageID = Pageview.ID; 512 System.Data.DataTable parIDList = Bluedesk.DynamicWeb.DataAccess.DynamicwebData.Query("SELECT dbo.Paragraph.ParagraphId FROM dbo.ItemType_Review INNER JOIN dbo.Paragraph on dbo.ItemType_Review.Id = dbo.Paragraph.ParagraphItemId AND dbo.Paragraph.ParagraphItemType = 'Review' WHERE dbo.Paragraph.ParagraphPageId= @pageId AND dbo.Paragraph.ParagraphShowParagraph = 1 ORDER BY dbo.ItemType_Review.ReviewDate desc", new System.Data.SqlClient.SqlParameter("pageId", pageID)); 513 514 <div class="row" id="adviseur-content3"> 515 @foreach (System.Data.DataRow par in parIDList.Rows) 516 { 517 @RenderParagraphContent((int)par[0]); 518 } 519 </div> 520 } 521 @if (false) 522 { 523 <div class="row" id="adviseur-content3">@GetValue("DwContent(adviseurcontent3)")</div> 524 } 525 <div class="contact__tabs"> 526 <a id="1" class="contact__tab contact__tab--active">Vraag advies</a> 527 <a id="2" class="contact__tab">Vraag offerte aan</a> 528 <a id="3" class="contact__tab">Bel me terug</a> 529 </div> 530 </div> 531 532 <section class="background background--color border-bottom form-section" id="advisorForms"> 533 <div class="container"> 534 <div class="row contact"> 535 <div class="contact__form contact__form-1 contact__vraagadvies clearfix"> 536 @RenderParagraphContent(49) 537 </div> 538 539 <div class="contact__form contact__form-2 contact__offerte clearfix" style="display:none"> 540 @RenderParagraphContent(50) 541 </div> 542 543 <div class="contact__form contact__form-3 contact__belme clearfix" style="display:none"> 544 @RenderParagraphContent(51) 545 </div> 546 </div> 547 </div> 548 </section> 549 550 @{ 551 var serviceblockPID = GetInteger("Item.Area.ServiceBlocksParagraph"); 552 } 553 554 @if (serviceblockPID > 0) 555 { 556 <div class="white-service-blocks"> 557 <div class="container"> 558 <div class="row"> 559 @RenderParagraphContent(serviceblockPID) 560 </div> 561 </div> 562 </div> 563 } 564 565 <div class="container"> 566 <div class="row" id="adviseur-content4">@GetValue("DwContent(adviseurcontent4)")</div> 567 <div class="hidden-md-down" id="openhoursDesktop"> 568 @openhoursSnippet(officeData) 569 </div> 570 <div class="" id="otherLocations"> 571 @relatedOffices(showingMainOffice, officeData) 572 </div> 573 </div> 574 575 @{ 576 int totalReviews = !string.IsNullOrWhiteSpace(officeData.FX_SATotalReviews) ? Int32.Parse(officeData.FX_SATotalReviews) : 0; 577 } 578 @if (totalReviews != 0) 579 { 580 <div style="display:none;"> 581 <span itemtype="http://data-vocabulary.org/Review-aggregate" itemscope=""> 582 <span itemprop="itemreviewed">@officeData.Name()</span> 583 <span itemprop="rating" itemscope="" itemtype="http://data-vocabulary.org/Rating"> 584 @GetString("Item.Area.ReviewedPreText") 585 <span itemprop="average">@officeData.FX_SATotal</span> 586 <meta itemprop="best" content="10"> 587 <meta itemprop="worst" content="0">@GetString("Item.Area.ReviewedMiddleText") 588 </span> 589 <span itemprop="votes">@officeData.FX_SATotalReviews</span> @GetString("Item.Area.ReviewedAfterText") 590 </span> 591 </div> 592 } 593 594 @* Template helper functions *@ 595 596 @helper ShowReviewScore(string category, string score) 597 { 598 if (!string.IsNullOrWhiteSpace(score)) 599 { 600 <div class="col-sm-6"> 601 <div class="beoordeling__item" data-score="@score"> 602 <div class="row no-gutter"> 603 <div class="col-xs-3"> 604 <div class="beoordeling__grade">@score.Replace(".", ",")</div> 605 </div> 606 <div class="col-xs-9"> 607 <div class="beoordeling__title">@category</div> 608 </div> 609 <div class="col-xs-12"> 610 <div class="adviseur__score--bar" style='width:@score.Replace(".","")%;'></div> 611 </div> 612 </div> 613 </div> 614 </div> 615 } 616 } 617 618 @helper openhoursSnippet(bdPoi.TPOffice office) 619 { 620 621 bool showOpeningsTijden = !"".Equals(office.OfficeHoursMo + office.OfficeHoursTu + office.OfficeHoursWe + office.OfficeHoursTh + office.OfficeHoursTh + office.OfficeHoursSa + office.OfficeHoursSu); 622 bool showPhoneHours = !"".Equals(office.PhoneHours); 623 624 <div class="row"> 625 <div class="col-md-3 col-sm-6 col-xs-12 center"> 626 <h4 class="openhours__hoofdkantoor">Kantoor</h4> 627 <p class="openhours__adresgegevens"> 628 @office.AddressStreet @office.AddressNumber @office.AddressSuffix<br> 629 <span class="text-uppercase">@office.AddressZipcode</span>&nbsp;&nbsp;<span class="text-uppercase">@office.AddressCity</span> 630 </p> 631 632 <a href="tel:@office.NormalizedPhoneNr(true)" class="openhours__telefoonnummer">@office.NormalizedPhoneNr()</a> 633 @*<div class="openhours__socialmedia-container center"> 634 @{ 635 if (!string.IsNullOrWhiteSpace(office.Facebook)) 636 { 637 <a href="@office.Facebook" title="facebook" target="_blank"><i class="openhours__square openhours__square--facebook"></i></a> 638 } 639 if (!string.IsNullOrWhiteSpace(office.Twitter)) 640 { 641 <a href="@office.Twitter" title="twitter" target="_blank"><i class="openhours__square openhours__square--twitter"></i></a> 642 } 643 if (!string.IsNullOrWhiteSpace(office.LinkedIn)) 644 { 645 <a href="@office.LinkedIn" title="linkedin" target="_blank"><i class="openhours__square openhours__square--linkedin"></i></a> 646 } 647 if (!string.IsNullOrWhiteSpace(office.Video)) 648 { 649 <a href="@office.Video" title="video" target="_blank"><i class="openhours__square openhours__square--youtube"></i></a> 650 } 651 if (!string.IsNullOrWhiteSpace(office.Instagram)) 652 { 653 <a href="@office.Instagram" title="instagram" target="_blank"><i class="openhours__square openhours__square--instagram"></i></a> 654 } 655 } 656 </div>*@ 657 </div> 658 @if (showOpeningsTijden || showPhoneHours) 659 { 660 <div class="col-md-3 col-xs-12 hidden-md-down"> 661 <img class="img-responsive" src="//maps.googleapis.com/maps/api/staticmap?center=@(office.AddressGeoLocation)&zoom=13&size=290x290&maptype=roadmap&markers=color:red%7C@(office.AddressGeoLocation)&sensor=false&key=AIzaSyBUuVvNweNRjGmiC3H-V-VL2QkB7w8O6qE" alt="google map"> 662 </div> 663 <div class="col-md-6 col-sm-6 col-xs-12"> 664 <h4 class="openhours__openhours-title">Openingstijden</h4> 665 @if (showOpeningsTijden) 666 { 667 @openingHoursLineItem("Maandag", office.OfficeHoursMo) 668 @openingHoursLineItem("Dinsdag", office.OfficeHoursTu) 669 @openingHoursLineItem("Woensdag", office.OfficeHoursWe) 670 @openingHoursLineItem("Donderdag", office.OfficeHoursTh) 671 @openingHoursLineItem("Vrijdag", office.OfficeHoursFr) 672 @openingHoursLineItem("Zaterdag", office.OfficeHoursSa) 673 @openingHoursLineItem("Zondag", office.OfficeHoursSu) 674 } 675 @if (showPhoneHours) 676 { 677 <div class="openhours__phonehours">@office.PhoneHours</div> 678 } 679 </div> 680 } 681 else 682 { 683 <div class="col-md-3 col-xs-12 hidden-md-down"> 684 <img class="img-responsive" src="//maps.googleapis.com/maps/api/staticmap?center=@(office.AddressGeoLocation)&zoom=13&size=290x290&maptype=roadmap&markers=color:red%7C@(office.AddressGeoLocation)&sensor=false&key=AIzaSyBUuVvNweNRjGmiC3H-V-VL2QkB7w8O6qE" alt="google map"> 685 </div> 686 } 687 </div> 688 } 689 690 @helper openingHoursLineItem(string nameOfToday, string openingHoursToday) 691 { 692 <div class="row"> 693 <div class="col-xs-5 col-sm-4">@nameOfToday:</div> 694 <div class="col-xs-7 col-sm-8">@openingHoursToday</div> 695 </div> 696 } 697 698 @helper relatedOffices(bool showingMainOffice, bdPoi.TPOffice office) 699 { 700 701 // Dynamicweb.Services.Pages.GetPagesByParentID(Pageview.ID) 702 List<Page> relatedOffices = (showingMainOffice) ? Dynamicweb.Services.Pages.GetPagesByParentID(Pageview.ID).ToList() : Dynamicweb.Services.Pages.GetPagesByParentID(Pageview.Page.ParentPageId).ToList(); 703 704 if (relatedOffices.Count > 0) 705 { 706 var paragraphTitle = relatedOffices.Count > 1 ? Translate("tp_office_related_offices_title_multiple", "Andere vestigingen") : Translate("tp_office_related_offices_title_single", "Andere vestiging"); 707 708 <div class="row"> 709 <div class="col-xs-12"> 710 <div class="top-space"> 711 <h2 class="beoordeling__headingtitle">@paragraphTitle</h2> 712 </div> 713 </div> 714 </div> 715 716 <div class="row row-centered"> 717 @foreach (var relatedOffice in relatedOffices) 718 { 719 // load item from database, itemdata in Page object is cached even when data is changed and the page itself is refreshed (logical solution relatedOffice.Item.SerializeTo() but this is cached for too long) 720 var officeData = bdPoi.TPOffice.CreateFrom(Dynamicweb.Content.Items.Item.GetItemById("TPOfficeManual", relatedOffice.Item.Id).SerializeTo()); 721 722 var url = string.Format("/Default.aspx?ID={0}", relatedOffice.ID); 723 724 if (!showingMainOffice && Pageview.Page.ID == relatedOffice.ID) 725 { 726 // this related office is the one we are displaying right now. Show address of main office (parent page) instead. 727 officeData.DeserializeFrom(Pageview.Page.Parent.Item.SerializeTo()); 728 url = string.Format("/Default.aspx?ID={0}", Pageview.Page.Parent.ID); 729 } 730 731 <div class="col-md-3 col-sm-6 related_office col-centered"> 732 <div class="row"> 733 <div class="related_office__main"> 734 <div class="col-xs-12"> 735 <h3 class="related_office__main--title">@officeData.Name()</h3> 736 </div> 737 <div class="col-xs-12"> 738 <div class="related_office__main--address"> 739 @officeData.AddressStreet @officeData.AddressNumber @officeData.AddressSuffix <br> 740 <span class="text-uppercase">@officeData.AddressZipcode</span>&nbsp;&nbsp;<span class="text-uppercase">@officeData.AddressCity</span> 741 </div> 742 </div> 743 <div class="col-sm-10 col-sm-push-1"> 744 <div class="related_office__main--link"> 745 <a class="btn btn-default" href="@url">@Translate("tp_office_related_offices_detail_link", "Naar de vestiging")</a> 746 </div> 747 </div> 748 </div> 749 </div> 750 </div> 751 } 752 </div> 753 } 754 } 755 756 757 758 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 759 @using Dynamicweb; 760 761 @{ 762 int j; 763 } 764 765 <footer class="footer"> 766 <div class="container"> 767 <div class="row footer__usps"> 768 @for (j = 1; j < 5; j++) 769 { 770 <div class="col-sm-6 col-md-6 col-lg-3"> 771 <span class="footer__usp">@GetString("Item.Area.USP" + j)</span> 772 </div> 773 } 774 </div> 775 </div> 776 <div class="footer__middle"> 777 <div class="container"> 778 <div class="row"> 779 780 @GetValue("DwNavigation(footernavigation)") 781 782 <div class="col-md-2-4 col-lg-2-4 footer__logos" style="text-align:center;"> 783 <img class="footer__image img-responsive" src="/Files/Templates/Designs/Nh1816/img/logo/adfiz-prestatieonderzoek-2019-diap.png" style="margin-bottom:20px" alt="adfiz logo"> 784 <img class="footer__image img-responsive" src="/Files/Templates/Designs/Nh1816/img/logo/verzekeraarsinbeeld.png" style="margin-bottom:20px;" alt="verzekeraarsinbeeld logo"> 785 <img class="footer__image" src="/Files/Templates/Designs/Nh1816/img/logo/Kifid.png" style="width:170px; height: 55px;" alt="kifid logo"> 786 </div> 787 788 <div class="footer__address col-md-2-4 col-lg-2-4"> 789 <span class="footer__header">Nh1816 Verzekeringen</span> 790 @GetString("Item.Area.FooterAddress") 791 </div> 792 793 <div class="col-xs-10 col-xs-offset-1 footer__logos--mobile"> 794 <div class="row"> 795 <div class="col-xs-12"> 796 <div class="images-mobile__image images-mobile__image--big img-responsive" style="background-image: url('/Files/Templates/Designs/Nh1816/img/logo/adfiz-prestatieonderzoek-2019-diap.png')"></div> 797 </div> 798 <div class="col-xs-12"> 799 <div class="images-mobile__image img-responsive" style="background-image: url('/Files/Templates/Designs/Nh1816/img/logo/verzekeraarsinbeeld.png')"></div> 800 </div> 801 <div class="col-xs-12"> 802 <div class="images-mobile__image img-responsive" style="background-image: url('/Files/Templates/Designs/Nh1816/img/logo/kifid.png')"></div> 803 </div> 804 </div> 805 </div> 806 </div> 807 808 <div class="footer__social"> 809 @{ 810 var fb = GetString("Item.Area.Facebook"); 811 var twitter = GetString("Item.Area.Twitter"); 812 var linkedin = GetString("Item.Area.Linkedin"); 813 var googlePlus = GetString("Item.Area.Google_Plus"); 814 var instagram = GetString("Item.Area.Instagram"); 815 var youtube = GetString("Item.Area.Youtube"); 816 817 if (!string.IsNullOrWhiteSpace(fb)) 818 { 819 <a rel="nofollow" href="@fb" target="_blank" title="Facebook" class="footer__sociallink footer__sociallink--fb"></a> 820 } 821 if (!string.IsNullOrWhiteSpace(twitter)) 822 { 823 <a rel="nofollow" href="@twitter" target="_blank" title="Twitter" class="footer__sociallink footer__sociallink--twitter"></a> 824 } 825 if (!string.IsNullOrWhiteSpace(linkedin)) 826 { 827 <a rel="nofollow" href="@linkedin" target="_blank" title="LinkedIn" class="footer__sociallink footer__sociallink--linkedin"></a> 828 } 829 if (!string.IsNullOrWhiteSpace(googlePlus)) 830 { 831 <a rel="nofollow" href="@googlePlus" target="_blank" title="Google Plus" class="footer__sociallink footer__sociallink--gplus"></a> 832 } 833 if (!string.IsNullOrWhiteSpace(instagram)) 834 { 835 <a rel="nofollow" href="@instagram" target="_blank" title="Instagram" class="footer__sociallink footer__sociallink--ig"></a> 836 } 837 if (!string.IsNullOrWhiteSpace(youtube)) 838 { 839 <a rel="nofollow" href="@youtube" target="_blank" title="YouTube" class="footer__sociallink footer__sociallink--yt"></a> 840 } 841 } 842 </div> 843 </div> 844 </div> 845 <div class="footer__bottom"> 846 <div class="container"> 847 <div class="row"> 848 <div class="col-md-2-4 col-lg-2-4"></div> 849 <div class="footer__review col-md-7-2"> 850 <span> 851 <span>@GetString("Item.Area.ReviewedName")</span> 852 <span> 853 @GetString("Item.Area.ReviewedPreText") 854 <span>@GetString("Item.Area.ReviewedAverage")</span> 855 <meta> 856 <meta>@GetString("Item.Area.ReviewedMiddleText") 857 </span> 858 <span>@GetString("Item.Area.ReviewedVotes").Replace(".", "")</span> @GetString("Item.Area.ReviewedAfterText") 859 </span> 860 </div> 861 862 <div class="col-md-2-4 col-lg-2-4 copyright"> 863 <img src="/Files/Templates/Designs/Nh1816/img/logo/footer-logo.png" class="copyright__img" alt="nh logo"> 864 <span class="copyright__text">Copyright &#169; @DateTime.Now.Year <br><span class="copyright__company">Nh1816</span></span> 865 </div> 866 867 @GetValue("DwNavigation(bottomnavigation)") 868 </div> 869 </div> 870 </div> 871 </footer> 872 873 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 874 @using Dynamicweb; 875 876 @*TODO : teksten verwijderen*@ 877 878 @{ 879 var BottomCTALink = GetString("Item.Area.Header_CTA.Link.Value"); 880 var BottomCTAText = GetValue("Item.Area.Header_CTA.Text.Value"); 881 var ContactLabel = GetValue("Item.Area.SidemenuLabel"); 882 } 883 884 @*Side-contact op desktop en tablet :*@ 885 @if (!string.IsNullOrWhiteSpace(GetGlobalValue("Global:Device.IsDesktop")) || !string.IsNullOrWhiteSpace(GetGlobalValue("Global:Device.IsTablet"))) 886 { 887 <!-- Begin side-contact --> 888 <nav class="side-contact"> 889 <a class="side-contact__tag" id="side-contact__tag">@ContactLabel</a> 890 891 <div class="side-contact__body"> 892 <div class="side-contact__items"> 893 894 @foreach (var i in GetLoop("Item.Area.Buttons")) 895 { 896 var link = i.GetString("Item.Area.Buttons.Link"); 897 var text = i.GetString("Item.Area.Buttons.Text"); 898 var fontello = i.GetString("Item.Area.Buttons.Icon.Icon"); 899 900 <a href="@link" title="@text" class="side-contact__item fontello-@fontello">@text</a> 901 } 902 </div> 903 </div> 904 </nav> 905 <!-- End side-contact --> 906 } 907 908 @*Bottom-contact op mobile en tablet :*@ 909 @if (!string.IsNullOrWhiteSpace(GetGlobalValue("Global:Device.IsMobile")) || !string.IsNullOrWhiteSpace(GetGlobalValue("Global:Device.IsTablet"))) 910 { 911 <!-- Begin bottom-contact --> 912 <nav class="bottom-contact"> 913 <div class="bottom-contact__menu"> 914 <a class="bottom-contact__tag" id="bottom-contact__tag">@ContactLabel</a> 915 <a href="@BottomCTALink" class="bottom-contact__adviseur">@BottomCTAText</a> 916 <a href="javascript:void(0);" class="bottom-contact__up" id="bottom-contact__up"><i class="bottom-contact__up--icon"></i></a> 917 </div> 918 919 <div class="bottom-contact__body"> 920 <i class="bottom-contact__close-button"></i> 921 <div class="bottom-contact__items"> 922 @foreach (var i in GetLoop("Item.Area.Buttons")) 923 { 924 var link = i.GetString("Item.Area.Buttons.Link"); 925 var text = i.GetString("Item.Area.Buttons.Text"); 926 var fontello = i.GetString("Item.Area.Buttons.Icon.Icon"); 927 928 <a href="@link" title="@text" class="bottom-contact__item fontello-@fontello">@text</a> 929 } 930 </div> 931 </div> 932 </nav> 933 <!-- End bottom-contact --> 934 } 935 936 <script src="//maps.googleapis.com/maps/api/js?key=AIzaSyDoTsyWDp1MyrNw9krWcD0EVfT0fPPnkfU"></script> 937 <script type="text/javascript" src="/Files/Templates/Designs/Nh1816/dist/js/main.js"></script> 938 939 </body> 940 </html> 941 942 943 @*helper renderRichSnippet(string schemaType) 944 { 945 <script type="application/ld+json"> 946 [{ 947 "@@context": "http://schema.org", 948 "@@type": "Website", 949 "name" : "Nh1816 Verzekeringen", 950 "alternateName" : "Nh1816", 951 "url": "@Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain()", 952 "potentialAction": { 953 "@@type": "SearchAction", 954 "target": "/zoeken?q={search_term_string}", 955 "query-input": "required name=search_term_string" 956 }, 957 "publisher": { 958 "@@type": "@schemaType", 959 "name" : "Nh1816 Verzekeringen", 960 "url": "@Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain()", 961 "sameAs" : ["@GetString("Item.Area.Facebook")", "@GetString("Item.Area.Twitter")", "@GetString("Item.Area.Linkedin")", "@GetString("Item.Area.Instagram")", "@GetString("Item.Area.Youtube")", "@GetString("Item.Area.Google_Plus")"], 962 "logo": { 963 "@@type" : "ImageObject", 964 "url" : "@Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain()/Files/Templates/Designs/Nh1816/img/logo/NH_Logo_Google.png", 965 "width" : "100", 966 "height" : "39" 967 } 968 } 969 }] 970 </script> 971 }*@ 972 973 <!-- Structured Data JSON-LD --> 974 @helper renderRichSnippet() 975 { 976 <script type="application/ld+json"> 977 [{ 978 "@@context": "http://schema.org", 979 "@@type": "Organization", 980 "name" : "@GetString("DwAreaName")", 981 "url": "@Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain()", 982 "logo": "@Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain()/Files/Images/Header-Logos/NH_Logo.svg", 983 "contactPoint" : [{ 984 "@@type" : "ContactPoint", 985 "telephone" : "@GetString("Item.Area.Phonenumber")", 986 "contactType" : "customer service" , 987 "@@context": "http://schema.org", 988 "@@id": "@Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain()", 989 "name": "@GetString("DwAreaName")" 990 }], 991 "address": { 992 "@@type": "PostalAddress", 993 "streetAddress": "@GetString("Item.Area.StreetAddress")", 994 "addressLocality": "@GetString("Item.Area.AddressLocality")", 995 "addressRegion": "@GetString("Item.Area.AddressRegion")", 996 "postalCode": " @GetString("Item.Area.PostalCode")", 997 "addressCountry": "@GetString("Item.Area.AddressCountry")" 998 } 999 }, 1000 { 1001 "@@context": "http://schema.org", 1002 "@@type": "WebSite", 1003 "name" : "@GetString("DwAreaName")", 1004 "alternateName" : "NH1816", 1005 "url": "@Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain()", 1006 "potentialAction": { 1007 "@@type": "SearchAction", 1008 "target": " /default.aspx?id=@GetString("Item.Area.SearchPageSEO")&q={search_term_string}", 1009 "query-input": "required name=search_term_string" 1010 } 1011 }] 1012 </script> 1013 } 1014 1015 1016 1017 <!-- Structured Data JSON-LD --> 1018 @helper renderReviewSnippet() 1019 { 1020 var reviewName = GetString("Item.Area.Review_Name") != null ? GetString("Item.Area.Review_Name") : ""; 1021 var reviewBestRating = GetString("Item.Area.Review_Best_Rating") != null ? GetString("Item.Area.Review_Best_Rating") : ""; 1022 var reviewWorstRating = GetString("Item.Area.Review_Worst_Rating") != null ? GetString("Item.Area.Review_Worst_Rating") : ""; 1023 var reviewRatingValue = GetString("Item.Area.Review_Rating_Value") != null ? GetString("Item.Area.Review_Rating_Value") : ""; 1024 var reviewCount = GetString("Item.Area.Review_Count") != null ? GetString("Item.Area.Review_Count") : ""; 1025 var reviewUrl = GetString("Item.Area.Review_URL") != null ? GetString("Item.Area.Review_URL") : ""; 1026 1027 1028 <script type="application/ld+json"> 1029 { 1030 "@@context": "http://schema.org", 1031 "@@type": "Review", 1032 "name": "@reviewName", 1033 "url":"@reviewUrl", 1034 "aggregateRating": { 1035 "@@type": "AggregateRating", 1036 "bestRating": "@reviewBestRating", 1037 "worstRating": "@reviewWorstRating", 1038 "ratingValue": "@reviewRatingValue", 1039 "reviewCount": "@reviewCount" 1040 } 1041 } 1042 </script> 1043 }