Error executing template "Designs/Scanpan/_parsed/blog-post.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_a71cabb23bef4f10a9506a58bba857f2.Execute() in E:\dynamicweb.net\Solutions\scanpan-live\Files\Templates\Designs\Scanpan\_parsed\blog-post.parsed.cshtml:line 10
   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 @{ 2 var requestHost = GetGlobalValue("Global:Request.Host"); 3 4 var googleTagManagerToken = Pageview.Area.Item["GoogleTagManagerToken"].ToString(); 5 var googleAnalyticsToken = Pageview.Area.Item["GoogleAnalyticsToken"].ToString(); 6 var googleSiteVerificationToken = Pageview.Area.Item["GoogleSiteVerificationToken"].ToString(); 7 var pinterestSiteVerificationToken = Pageview.Area.Item["PinterestSiteVerificationToken"].ToString(); 8 var visualWebsiteOptimizerToken = Pageview.Area.Item["VisualWebsiteOptimizerToken"].ToString(); 9 var newsletterReceipt = Pageview.Area.Item["NewsletterReceiptPageId"].ToString(); 10 var footerScript = Pageview.Area.Item["FooterScript"].ToString(); 11 var assetsVersion = Pageview.Area.Item["AssetsVersion"].ToString(); 12 } 13 <!DOCTYPE html> 14 <!--[if lte IE 8]> <html id="scanpan" class="no-js lt-ie9 lt-ie10"> <![endif]--> 15 <!--[if lte IE 9]> <html id="scanpan" class="no-js lt-ie10"> <![endif]--> 16 <!--[if gt IE 9]><!--> <html id="scanpan" class="no-js"> <!--<![endif]--> 17 <head> 18 <meta charset="utf-8"> 19 20 <title>@GetValue("Title")</title> 21 @GetValue("MetaTags") 22 @GetValue("CopyRightNotice") 23 24 25 26 <meta name="viewport" content="width=device-width"> 27 <meta name="globalsign-domain-verification" content="EWGav1RwWcMsTp8Fx4t9bGNw_r7PQ6cRVx7_udeJiC"> 28 <meta name="globalsign-domain-verification" content="Gd4KzAVKV-VBSUdl8V45WUiwRoDU4XYc2XotXeF5_J"> 29 30 @* Disable robots/indexing for staging/nozebrahosting domains *@ 31 @if (requestHost.Contains("staging") || requestHost.Contains("nozebrahosting")) { 32 <meta name="robots" content="noindex, nofollow"> 33 } 34 35 @if (!string.IsNullOrWhiteSpace(googleSiteVerificationToken)) { 36 <meta name="google-site-verification" content="@googleSiteVerificationToken"> 37 } 38 @if (!string.IsNullOrWhiteSpace(pinterestSiteVerificationToken)) { 39 <meta name="p:domain_verify" content="@pinterestSiteVerificationToken"> 40 } 41 42 <link href="/Files/Templates/Designs/Scanpan/assets/stylesheets/main.css?nocache=@assetsVersion" rel="stylesheet"> 43 <link href="/Files/Templates/Designs/Scanpan/assets/stylesheets/print.css?nocache=@assetsVersion" rel="stylesheet" media="print"> 44 45 <link rel="shortcut icon" href="/Files/Templates/Designs/Scanpan/favicon.ico"> 46 47 <script type="application/ld+json"> 48 { 49 "@@context": "http://schema.org", 50 "@@type": "LocalBusiness", 51 "address": { 52 "@@type": "PostalAddress", 53 "addressLocality": "DK-8550 Ryomgård", 54 "streetAddress": "Industrivej 49" 55 }, 56 "description": "Scanpan", 57 "name": "Scanpan", 58 "image": "https://www.scanpan.dk/Files/Templates/Designs/Scanpan/assets/images/logo.png", 59 "telephone": "+45 87 74 14 00" 60 } 61 </script> 62 63 <script> 64 // Replace no-js css class with js css class 65 document.documentElement.className = document.documentElement.className.replace(/\bno-js\b/g, 'js'); 66 </script> 67 68 <!--[if IE]> 69 <link href="/Files/Templates/Designs/Scanpan/assets/stylesheets/ie.css" rel="stylesheet"> 70 <![endif]--> 71 72 <!--[if lt IE 9]> 73 <script src="/Files/Templates/Designs/Scanpan/assets/javascripts/lib/html5shiv-3.7.2.min.js"></script> 74 <![endif]--> 75 76 @RenderSnippet("HeadClose") 77 78 @if (!string.IsNullOrWhiteSpace(googleTagManagerToken)) { 79 <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': 80 new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], 81 j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 82 '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); 83 })(window,document,'script','dataLayer','@googleTagManagerToken');</script> 84 } 85 86 <!-- Anti-flicker snippet (recommended)  --> 87 <style>.async-hide { opacity: 0 !important} </style> 88 <script>(function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date; 89 h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')}; 90 (a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c; 91 })(window,document.documentElement,'async-hide','dataLayer',4000, 92 {'GTM-58J3SP8':true});</script> 93 <!-- Modified Analytics tracking code with Optimize plugin --> 94 <script> 95 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 96 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 97 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 98 })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); 99 100 ga('create', '@googleAnalyticsToken', 'auto'); 101 ga('require', 'GTM-58J3SP8'); 102 ga('send', 'pageview'); 103 </script> 104 @GetValue("Stylesheets") 105 @GetValue("Javascripts") 106 </head> 107 <body> 108 109 @{ 110 try 111 { 112 NoZebra.DW.ItpCookies.ViewHandler.SetCookies(); 113 } 114 catch (Exception e) 115 { 116 //log exception 117 } 118 } 119 120 @* Google Tag Manager *@ 121 @if (!string.IsNullOrWhiteSpace(googleTagManagerToken)) { 122 <noscript><iframe src="//www.googletagmanager.com/ns.html?id=@googleTagManagerToken" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> 123 } 124 125 @* Facebook Conversion Code for Signup to newsletter *@ 126 @if(!string.IsNullOrWhiteSpace(newsletterReceipt)) { 127 if(newsletterReceipt == GetString("Global:Page.ID")) { 128 <script>(function() { 129 var _fbq = window._fbq || (window._fbq = []); 130 if (!_fbq.loaded) { 131 var fbds = document.createElement('script'); 132 fbds.async = true; 133 fbds.src = '//connect.facebook.net/en_US/fbds.js'; 134 var s = document.getElementsByTagName('script')[0]; 135 s.parentNode.insertBefore(fbds, s); 136 _fbq.loaded = true; 137 } 138 })(); 139 window._fbq = window._fbq || []; 140 window._fbq.push(['track', '6028091289621', {'value':'0.01','currency':'DKK'}]); 141 </script> 142 <noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6028091289621&amp;cd[value]=0.01&amp;cd[currency]=DKK&amp;noscript=1"></noscript> 143 } 144 } 145 146 <!-- Facebook Pixel Code --> 147 <script> 148 !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod? 149 n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n; 150 n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0; 151 t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window, 152 document,'script','//connect.facebook.net/en_US/fbevents.js'); 153 154 fbq('init', '187845994920748'); 155 fbq('track', "PageView");</script> 156 <noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=187845994920748&ev=PageView&noscript=1"></noscript> 157 <!-- End Facebook Pixel Code --> 158 159 <!--googleoff: all--> 160 <div class="cookiebar js-cookiebar" data-id="cookie-accept"> 161 <div class="cookiebar__container"> 162 <div class="cookiebar__body">@Pageview.Area.Item["CookieBarBody"]</div> 163 <div class="cookiebar__button-container"> 164 <a class="cookiebar__close js-cookiebar-close">Close</a> 165 </div> 166 </div> 167 </div><!-- .cookiebar --> 168 <!--googleon: all--> 169 170 @{ 171 var searchPlaceholderText = "Search for products or pages"; 172 } 173 <header id="header" class="header js-header"> 174 @{ 175 string theme = GetString("Item.Area.GlobalMessageTheme"); 176 177 int campaignDuration = GetInteger("Item.Area.GlobalMessageCampaignDuration") > 0 ? GetInteger("Item.Area.GlobalMessageCampaignDuration") : 30; 178 179 // Setting default global message 180 181 string name = "defaultMessage"; 182 183 int hour = int.Parse(Translate("global-message-hour", "13")); 184 185 string message = Translate("global-message-default", "Vi sender din ordre om:"); 186 187 DateTime current = DateTime.Now; 188 189 DateTime endDate = DateTime.Now.Date.Add(new TimeSpan(hour, 0, 0)); 190 191 bool hideCountDown = current.DayOfWeek == DayOfWeek.Friday && current.TimeOfDay.TotalSeconds >= 60 * 60 * hour 192 || current.DayOfWeek == DayOfWeek.Saturday 193 || current.DayOfWeek == DayOfWeek.Sunday && current.TimeOfDay.TotalSeconds <= 60 * 60 * hour; 194 195 if (hideCountDown) 196 { 197 message = Translate("global-message-weekend", "Vi sender din ordre på mandag kl. 13"); 198 } 199 200 if (current.TimeOfDay.TotalSeconds > 60 * 60 * hour) 201 { 202 endDate = endDate.AddDays(1); // Hour is passed 13. Adding one day to endDate 203 } 204 205 bool hideDays = false; 206 207 // Overruling default values when activated from website settings 208 209 DateTime campaignEndDate = GetDate("Item.Area.CampaignEndDate"); 210 211 bool globalMessageIsActive = GetBoolean("Item.Area.GlobalMessageIsActive"); 212 213 if (globalMessageIsActive && campaignEndDate >= DateTime.Now) 214 { 215 message = GetString("Item.Area.GlobalMessageText"); 216 endDate = campaignEndDate; 217 hideCountDown = GetBoolean("Item.Area.HideCountDown"); 218 if (!string.IsNullOrEmpty(GetString("Item.Area.GlobalMessageCampaignName"))) 219 { 220 name = GetString("Item.Area.GlobalMessageCampaignName"); 221 } 222 } 223 else 224 { 225 hideDays = true; 226 } 227 228 // Do not render section if cookie set (message dismissed) and area id not equals 1 229 if (globalMessageIsActive && System.Web.HttpContext.Current.Request.Cookies[name] == null && Dynamicweb.Frontend.PageView.Current().Area.ID == 1) 230 { 231 <!--googleoff: all--> 232 <div class="global-message--@(theme) js-cookiebar js-count-down-active-state" data-id="@name" data-expires="@campaignDuration" data-bodyclass="has-global-message"> 233 <div class="global-message__content"> 234 <div class="global-message__text">@message</div> 235 @if (!hideCountDown) 236 { 237 <div class="global-message__counter js-count-down" data-end-date="@endDate"> 238 @if (!hideDays) 239 { 240 <span class="js-count-down-days"></span><span>@Translate("global-message-days", "d:")</span> 241 } 242 <span class="js-count-down-hours"></span><span>@Translate("global-message-hours", "t:")</span> 243 <span class="js-count-down-minutes"></span><span>@Translate("global-message-minutes", "m:")</span> 244 <span class="js-count-down-seconds"></span><span>@Translate("global-message-seconds", "s")</span> 245 </div> 246 } 247 <a class="global-message__close js-cookiebar-close">Close</a> 248 </div> 249 </div> <!-- .global-message--@(theme) --> 250 <!--googleon: all--> 251 } 252 } 253 254 255 <div class="header__toolbar"> 256 <div class="header__inner"> 257 258 <ul class="tick-list"> 259 <li class="tick-list__item"><div class="tick-list__rectangle"></div>Orginal Scanpan</li> 260 <li class="tick-list__item"><div class="tick-list__rectangle"></div>Gratis levering og gratis retur</li> 261 <li class="tick-list__item"><div class="tick-list__rectangle"></div>Made in Denmark</li> 262 </ul> 263 264 @{ 265 string browserVersion = ""; 266 switch(System.Web.HttpContext.Current.Request.Browser.Type) { 267 case "IE7": 268 browserVersion = "ie7"; 269 break; 270 271 case "IE8": 272 browserVersion = "ie8"; 273 break; 274 275 case "IE9": 276 browserVersion = "ie9"; 277 break; 278 279 case "IE10": 280 browserVersion = "ie10"; 281 break; 282 283 case "IE11": 284 browserVersion = "ie11"; 285 break; 286 } 287 } 288 289 290 @{ 291 // Whether eCom features should be hidden in the frontend 292 var disableEcommerce = GetBoolean("Item.Area.DisableEcommerce"); 293 294 // The page ID used to make the link for ajax basket endpoint 295 var cartAjaxPageId = GetString("Item.Area.EcomAjaxCartPage"); 296 297 // Mini basket texts 298 bool hasNoProducts = GetBoolean("Ecom:Order.IsEmpty"); 299 var cartCount = (!hasNoProducts) ? GetString("Ecom:Order.OrderLines.TotalProductQuantity") : null; 300 var textMobile = "Cart"; 301 var checkoutPage = GetString("Item.Area.EcomCheckoutPage"); 302 var basketToggle = browserVersion != "ie8" ? "js-basket-open" : ""; 303 } 304 @if(!disableEcommerce) { 305 <div class="header__basket-container js-header-basket js-product-cart" data-basketpage="@cartAjaxPageId"> 306 <a class="header__basket-link--open @basketToggle" href="@checkoutPage"> 307 <span class="header__basket-link-icon"> 308 @if(!hasNoProducts) { 309 <span class="header__basket-link-count"></span> 310 } 311 </span> 312 <span class="header__basket-link-text">Shopping Cart</span> 313 </a> 314 <a class="header__basket-link--close js-basket-close" href="#" data-textmobile="@textMobile"> 315 <span class="header__basket-link-icon"> 316 @if(!hasNoProducts) { 317 <span class="header__basket-link-count"></span> 318 } 319 </span> 320 <span class="header__basket-link-text">Shopping Cart</span> 321 </a> 322 </div> 323 } 324 325 326 @if(GetString("DwAreaID") == "22"){ 327 <div class="header__logo site-eu"> 328 <a class="header__logo-link" href="/" title="Scanpan"> 329 <img class="header__logo-image" src="/Files/Templates/Designs/Scanpan/assets/images/scanpan-logo.svg" alt="Scanpan"> 330 </a> 331 </div> 332 } 333 else 334 { 335 <div class="header__logo"> 336 <a class="header__logo-link" href="/" title="Scanpan"> 337 <img class="header__logo-image" src="/Files/Templates/Designs/Scanpan/assets/images/scanpan-logo.svg" alt="Scanpan"> 338 </a> 339 </div> 340 } 341 342 343 344 @{ 345 var searchAjaxPageId = GetString("Item.Area.SearchAJAXPage"); 346 var searchResultPage = GetString("Item.Area.SearchResultsPage"); 347 } 348 @if(GetString("DwAreaID") == "22"){ 349 <div class="header__search site-eu js-search" data-searchpage="@searchAjaxPageId" data-resultpage="@searchResultPage"> 350 <form class="header__search-form js-search-form" action="/"> 351 <input class="header__search-input js-search-input" type="search" name="q" placeholder="@searchPlaceholderText" autocomplete="off"> 352 <div class="header__search-results js-search-results"><!-- Placeholder for search results loaded through AJAX --></div> 353 354 <input type="hidden" name="eComQuery" class="js-search-form-mirror"> 355 <input type="hidden" name="ID" value="@searchResultPage"> 356 </form> 357 </div> 358 } 359 else 360 { 361 <div class="header__search js-search" data-searchpage="@searchAjaxPageId" data-resultpage="@searchResultPage"> 362 <form class="header__search-form js-search-form" action="/"> 363 <input class="header__search-input js-search-input" type="search" name="q" placeholder="@searchPlaceholderText" autocomplete="off"> 364 <div class="header__search-results js-search-results"><!-- Placeholder for search results loaded through AJAX --></div> 365 366 <input type="hidden" name="eComQuery" class="js-search-form-mirror"> 367 <input type="hidden" name="ID" value="@searchResultPage"> 368 </form> 369 </div> 370 } 371 372 373 </div><!-- .header__inner --> 374 </div> 375 376 <div class="header__navigation"> 377 <div class="header__inner"> 378 379 <div class="header__nav-container"> 380 381 <nav class="header-nav" role="main"> 382 <ul class="header-nav__list has-level-0"> 383 @RenderNavigation(new { 384 StartLevel = 1, 385 EndLevel = 3, 386 expandmode = "all", 387 Template = "TopNavigation.xslt", 388 Id = "header-nav" 389 }) 390 </ul> 391 </nav> 392 393 </div><!-- .header__nav-container --> 394 </div><!-- .header__inner --> 395 </div> 396 @if( GetString("Item.SystemName") == "BlogCategoryPage" ) 397 { 398 @RenderItemList(new { 399 ItemType = "BlogCategoryPage", 400 ListSourceType = "SelfArea", 401 ItemFieldsList = "*", 402 ListTemplate = "/ItemPublisher/List/blog-navigation.cshtml", 403 ListPageSize = 10000, 404 ListOrderBy = "Sort" 405 }) 406 } 407 408 </header><!-- .header --> 409 410 <a class="page-overlay js-overlay" href="#"></a> 411 <div class="page"> 412 @if(!string.IsNullOrWhiteSpace(GetString("DwNavigation(breadcrumb)"))) { 413 <div class="breadcrumb"> 414 <div class="breadcrumb__inside"> 415 <span class="breadcrumb__prefix">You are here:</span> 416 @GetValue("DwNavigation(breadcrumb)") 417 </div> 418 </div><!-- .breadcrumb --> 419 } 420 421 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 422 423 424 @using Dynamicweb.Content; 425 @using Dynamicweb.Content.Items; 426 @using System.Text.RegularExpressions; 427 @* Note that this file will be inserted directly into another one by Dynamicweb IncludeFile 428 before evaluating the Razor code, so keep the syntax right *@ 429 430 @functions { 431 432 /** 433 * Custom date format from string input 434 * String needs to be in a date format, though 435 * @param {String} d 436 */ 437 string FormatDate(string d) { 438 string output = d; 439 // Language 440 string lang = GetGlobalValue("Global:Area.Lang"); 441 // Date format 442 string dateFormat = (lang == "da") ? "d. MMM. yyyy" : "MMM d yyyy"; 443 // Try parsing string as DateTime 444 DateTime dateValue; 445 if (DateTime.TryParse(d, out dateValue)) { 446 output = dateValue.ToString(dateFormat); 447 } 448 // Format date input 449 // Return formatted date 450 return output; 451 } 452 453 /** 454 * Format number form string input 455 * Returns a clean number to be used in sorting loops 456 * @param {String} s 457 */ 458 string FormatNumber(string s) { 459 Regex rgx = new Regex(@"[^0-9.,]"); // match everything but numbers, comma and period 460 // Replace all letters with whitespace 461 s = rgx.Replace(s, " "); 462 // Remove everything after the first space 463 // This takes care of values like "28 x 28 cm" and "20 l" 464 return s.Split(new[]{" "}, StringSplitOptions.None)[0]; 465 } 466 467 /** 468 * Custom number formatting from string input 469 * @param {String} s 470 */ 471 decimal NumberFromString(String s) { 472 decimal output = decimal.Parse("0"); // fallback 473 string inputFormatted = FormatNumber(s); // strip input of anything but numbers 474 // Check if item has a value in the field 475 if( !string.IsNullOrEmpty(inputFormatted) ) { 476 decimal parsed; 477 // Try parsing formatted input as a decimal 478 if (decimal.TryParse(inputFormatted, out parsed)) { 479 output = parsed; 480 } 481 } 482 return output; 483 } 484 485 /** 486 * Order product loop by size field 487 * @param {LoopItem} v 488 */ 489 decimal OrderProductsBySize(LoopItem v) { 490 return NumberFromString(v.GetString("Ecom:Product:Field.SIZ")); 491 } 492 493 /** 494 * Order product loop by volume field 495 * @param {LoopItem} v 496 */ 497 decimal OrderProductsByVolume(LoopItem v) { 498 return NumberFromString(v.GetString("Ecom:Product:Field.VOL")); 499 } 500 501 /** 502 * Check wether a product id exists in a list of ids 503 * @param {List<string>} list 504 * @param {String} productId 505 */ 506 bool HasProduct(List<string> list, string productId) { 507 string productIdFormatted = "p_" + productId; 508 return list.Any(x => x == productIdFormatted); 509 } 510 511 /** 512 * Check wether a blog post page has a product selected 513 * in its related products field 514 * @param {Dynamicweb.Content.Page} blogPostAsPage 515 * @param {String} productId 516 */ 517 bool BlogPostHasRelatedProduct(Page blogPostAsPage, string productId) { 518 // Get page item 519 Item blogItem = ItemManager.Storage.GetById("BlogPost", blogPostAsPage.ItemId.ToString()); 520 // Get products from blog post fields 521 List<string> blogProducts = blogItem["Products"].ToString() 522 .Split(',') 523 .ToList(); 524 // Test wether provided product number matches any in the field 525 return HasProduct(blogProducts, productId); 526 } 527 528 bool BlogPostIsRelated(List<LoopItem> currentPageCategories, List<LoopItem> compareCategories) { 529 530 foreach(var i in compareCategories) { 531 if(currentPageCategories.Any(x => (x.GetInteger("ItemPublisher:Item.Categories.Id") == i.GetInteger("ItemPublisher:Item.Categories.Id")))) { 532 return true; 533 } 534 } 535 536 // No match 537 return false; 538 } 539 540 string ConvertPriceToSouthAfricanFormat(string price, int areaId) 541 { 542 if (areaId == 28) 543 { 544 int place = price.LastIndexOf(','); 545 546 if (place == -1) 547 return price; 548 549 string result = price.Remove(place, 1).Insert(place, "."); 550 return result; 551 } 552 return price; 553 } 554 555 } 556 557 558 @SnippetStart("BodyClose") 559 <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5418262f1f54ac79"></script> 560 @SnippetEnd("BodyClose") 561 562 @{ 563 564 var pageViewModel = new Dynamicweb.Frontend.PageViewModel(); 565 string hostName = GetGlobalValue("Global:Request.Host"); 566 string blogFriendlyUrl = string.Format("https://{0}{1}", hostName, Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl(Pageview.ID)); 567 string blogPublisherLogo = string.Format("https://{0}{1}", hostName, "/Files/Templates/Designs/Scanpan/assets/images/logo.png"); 568 string blogModifiedDate = FormatDate(GetDate("DwPageUpdatedDate").ToString()); 569 string blogDate = FormatDate(GetString("Item.Date")); 570 string blogAuthorImage = GetString("Item.AuthorImage"); 571 string blogHeading = GetString("Item.Heading"); 572 string blogAuthor = GetString("Item.Author"); 573 string authorType = "http://schema.org/Person"; 574 if (string.IsNullOrEmpty(blogAuthor)) 575 { 576 blogAuthor = "Scanpan"; 577 authorType = "http://schema.org/Organization"; 578 } 579 string blogImage = GetString("Item.Image"); 580 string blogShortText = GetString("Item.ShortText"); 581 string blogText = GetString("Item.Text"); 582 bool hasProducts = GetLoop("Item.Products").Any(); 583 } 584 585 <section class="blog-post section--highlight" itemscope="" itemtype="http://schema.org/BlogPosting"> 586 <meta itemprop="headline" content="@blogHeading"> 587 <meta itemprop="dateModified" content="@blogModifiedDate"> 588 <link itemprop="mainEntityOfPage" href="@blogFriendlyUrl"> 589 @if(!string.IsNullOrEmpty(blogImage)) 590 { 591 <div class="blog-topimage" itemscope="" itemprop="image" itemtype="http://schema.org/ImageObject"> 592 <meta itemprop="height" content="727"> 593 <meta itemprop="width" content="1200"> 594 <div class="blog-post__top-content"> 595 <h1 class="blog-post__header" itemprop="name">@blogHeading</h1> 596 <div class="blog-post__details"> 597 @if(!string.IsNullOrWhiteSpace(blogAuthorImage)) 598 { 599 <div class="blog-post__author-image"> 600 <img class="blog-post__author-image-src" src="@blogAuthorImage?height=63"> 601 </div> 602 } 603 @* 604 // Disabled for now. 605 <div class="blog-post__date" itemprop="datePublished">@Translate("WritenBy", "Skrevet af") @blogAuthor</div> 606 *@ 607 <div class="blog-post__date" itemprop="datePublished">@blogDate</div> 608 </div><!--.blog-post__details--> 609 </div> 610 <picture class="hero__image"> 611 <!--[if IE 9]><video style="display: none;"><![endif]--> 612 <source srcset="@blogImage?width=1200&height=727&mode=crop, @blogImage?width=1800&height=1090&mode=crop 2x" media="(min-width: 992px)"></source> 613 <source srcset="@blogImage?width=768&height=359&mode=crop, @blogImage?width=1152&height=539&mode=crop 2x" media="(min-width: 576px)"></source> 614 <!--[if IE 9]></video><![endif]--> 615 <img class="blog-topimage__image" src="@blogImage?width=375&height=250&mode=crop" srcset="@blogImage?width=563&height=375&mode=crop 2x" alt="@blogHeading" itemprop="url"> 616 </picture> 617 </div> 618 } 619 @if(GetLoop("Item.Categories").Any()) 620 { 621 <div class="pt-3"> 622 <div class="blog-nav__tags royalSlider rsDefault js-royal-blog-slider is-loading"> 623 @foreach(var c in GetLoop("Item.Categories")) 624 { 625 string categoryName = c.GetString("Item.Categories.Name"); 626 string link = c.GetString("Item.Categories.Url"); 627 628 <div class="rsContent"> 629 <div class="rsTmb"> 630 <a class="blog-nav__tag" href="@link" title="@categoryName">@categoryName</a> 631 </div> 632 </div> 633 } 634 </div><!--.blog-nav__tags--> 635 </div> 636 } 637 <div itemscope="" itemprop="author" itemtype="@authorType"> 638 <meta itemprop="name" content="@blogAuthor"> 639 </div> 640 <div itemscope="" itemprop="publisher" itemtype="http://schema.org/Organization"> 641 <meta itemprop="name" content="Scanpan"> 642 <meta itemprop="logo" content=""> 643 <div itemscope="" itemprop="logo" itemtype="http://schema.org/ImageObject"> 644 <meta itemprop="height" content="500"> 645 <meta itemprop="width" content="1176"> 646 <meta itemprop="url" content="@blogPublisherLogo"> 647 </div> 648 </div> 649 <div class="blog-post__body"> 650 <h2 class="blog-post__subheader">@blogShortText</h2> 651 <div id="Content">@GetValue("DwContent(Content)")</div> 652 <div class="blog-post__text" itemprop="articleBody">@blogText</div> 653 </div> 654 @if(hasProducts) 655 { 656 <section class="section hide-on-print"> 657 <div class="container"> 658 <header class="section__header--center"> 659 <h1>Products mentioned in this blog post</h1> 660 </header> 661 <div class="products" id="products">@GetValue("DwContent(products)")</div> 662 </div> 663 </section> 664 } 665 666 @if( GetInteger("Comments.Count") > 0 || !string.IsNullOrEmpty(GetString("DwContent(formpost)")) ) 667 { 668 <section class="blog-comment" id="comments">@GetValue("DwContent(comments)")</section> 669 <section class="blog-post__text hide-on-print" id="formpost">@GetValue("DwContent(formpost)")</section> 670 } 671 </section> 672 673 </div> 674 <button class="nav-panel__mobile-button js-nav__button"> 675 <div class="nav-panel__mobile-button-wrapper"> 676 <span class="nav-panel__mobile-button-burger"> </span> 677 <span class="nav-panel__mobile-button-open">Menu</span> 678 <span class="nav-panel__mobile-button-close">Luk</span> 679 </div> 680 </button> 681 682 <div class="nav-panel js-nav-panel" id="nav-panel"> 683 <div class="nav-panel__layout"> 684 <div class="nav-panel__header"> 685 <div class="header__logo"> 686 <a class="header__logo-link" href="/" title="Scanpan"> 687 <img class="header__logo-image" src="/Files/Templates/Designs/Scanpan/assets/images/scanpan-logo.svg" alt="Scanpan"> 688 </a> 689 </div> 690 </div> 691 <div class="nav-panel__body js-nav-panel-body"> 692 <nav class="nav-panel__list-container js-accordion" role="navigation"> 693 @RenderNavigation(new 694 { 695 StartLevel = 1, 696 EndLevel = 3, 697 expandmode = "all", 698 Template = "MobileNavigation.xslt", 699 Id = "mobile-nav" 700 }) 701 </nav> 702 </div> 703 </div> 704 </div> 705 @{ 706 var phoneNumber = GetString("Item.Area.FooterColumn4Phone"); 707 var businessHours = GetString("Item.Area.FooterColumn4BusinessHours").Split(',').ToList(); 708 709 // Footer links 710 var policyLink = GetString("Item.Area.FooterPrivacyPolicyLink"); 711 var facebookLink = GetString("Item.Area.FooterFacebookLink"); 712 var instragramLink = GetString("Item.Area.FooterInstagramLink"); 713 } 714 <footer id="footer" class="footer"> 715 <div class="footer__section--top"> 716 <div class="footer__container--top"> 717 <p class="footer__copyright"> 718 <span class="footer__copyright-text">Copyright &copy; SCANPAN</span> 719 720 @if(!string.IsNullOrWhiteSpace(policyLink)) { 721 <a class="footer__copyright-link" href="@policyLink">Privacy Policy</a> 722 } 723 </p> 724 725 <h1 class="footer__motto">@GetString("Item.Area.FooterPayoff")</h1> 726 727 @if(!string.IsNullOrWhiteSpace(facebookLink) || !string.IsNullOrWhiteSpace(instragramLink)) { 728 <div class="footer__share"> 729 <p class="footer__share-header">Follow on</p> 730 @if(!string.IsNullOrWhiteSpace(facebookLink)) { 731 <a class="footer__share-link--facebook" href="@facebookLink">Facebook</a> 732 } 733 734 @if(!string.IsNullOrWhiteSpace(instragramLink)) { 735 <a class="footer__share-link--instagram" href="@instragramLink">Instagram</a> 736 } 737 </div> 738 } 739 </div><!-- .footer__container--top --> 740 </div><!-- .footer__section--top --> 741 742 <div class="footer__section js-accordion"> 743 <div class="footer__container"> 744 <div class="footer__column--outer"> 745 <div class="footer__column"> 746 <h2 class="footer__column-header--nav js-accordion-button" data-maxwidth="480" data-target="#footer-list-1">@GetString("Item.Area.FooterColumn1Heading")</h2> 747 <ul class="footer__link-list" id="footer-list-1"> 748 @foreach(LoopItem l in GetLoop("Item.Area.FooterColumn1Links")) { 749 var link = l.GetString("Item.Area.FooterColumn1Links.Link"); 750 <li class="footer__link-list-item"> 751 <a class="footer__link" href="@link">@l.GetString("Item.Area.FooterColumn1Links.Text")</a> 752 </li> 753 } 754 </ul> 755 </div> 756 <div class="footer__column"> 757 <h2 class="footer__column-header--nav js-accordion-button" data-maxwidth="480" data-target="#footer-list-2">@GetString("Item.Area.FooterColumn2Heading")</h2> 758 <ul class="footer__link-list" id="footer-list-2"> 759 @foreach(LoopItem l in GetLoop("Item.Area.FooterColumn2Links")) { 760 var link = l.GetString("Item.Area.FooterColumn2Links.Link"); 761 <li class="footer__link-list-item"> 762 <a class="footer__link" href="@link">@l.GetString("Item.Area.FooterColumn2Links.Text")</a> 763 </li> 764 } 765 </ul> 766 </div> 767 </div> 768 <div class="footer__column--outer"> 769 <div class="footer__column"> 770 <h2 class="footer__column-header--nav js-accordion-button" data-maxwidth="480" data-target="#footer-list-3">@GetString("Item.Area.FooterColumn3Heading")</h2> 771 <ul class="footer__link-list" id="footer-list-3"> 772 @foreach(LoopItem l in GetLoop("Item.Area.FooterColumn3Links")) { 773 var link = l.GetString("Item.Area.FooterColumn3Links.Link"); 774 <li class="footer__link-list-item"> 775 <a class="footer__link" href="@link">@l.GetString("Item.Area.FooterColumn3Links.Text")</a> 776 </li> 777 } 778 </ul> 779 </div> 780 781 <div class="footer__column--contact"> 782 <h2 class="footer__column-header--contact">@GetString("Item.Area.FooterColumn4Heading")</h2> 783 <div class="footer__contact-text"> 784 <a class="footer__phone" href="tel:@phoneNumber">@phoneNumber</a> 785 @foreach(var item in businessHours) { 786 <p class="footer__opening">@item</p> 787 } 788 </div> 789 </div> 790 </div> 791 </div><!-- .footer__container --> 792 </div><!-- .footer__section --> 793 </footer><!-- .footer --> 794 795 @{ 796 string formAction = GetString("Item.Area.PermissionBarFormAction"); 797 bool isActive = GetBoolean("Item.Area.PermissionBarIsActive"); 798 799 if( isActive && !string.IsNullOrWhiteSpace(formAction) ) { 800 string headline = GetString("Item.Area.PermissionBarHeadline"); 801 string text = GetString("Item.Area.PermissionBarText"); 802 string nameLabel = "Your name"; 803 string emailLabel = "Your email"; 804 string buttonText = "Subscribe"; 805 806 <div class="permission-bar js-permission-bar-target"> 807 <button class="permission-bar__close js-permission-bar-button">X</button> 808 <a class="permission-bar__headline js-permission-bar-button">@headline</a> 809 <div class="permission-bar__text">@text</div> 810 <form action="@formAction" method="post"> 811 <label class="permission-bar__label" for="permission-bar-name">@nameLabel</label> 812 <input class="permission-bar__input" id="permission-bar-name" name="cm-name" type="text" placeholder="@nameLabel" required=""> 813 <label class="permission-bar__label" for="permission-bar-email">@emailLabel</label> 814 <input class="permission-bar__input" id="permission-bar-email" name="cm-jkiib-jkiib" type="email" placeholder="@emailLabel" required=""> 815 <button class="permission-bar__button" name="subscribe">@buttonText</button> 816 </form> 817 </div> 818 } 819 } 820 821 822 <!-- JavaScript at the bottom for fast page loading --> 823 <script async="" src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script> 824 <script>window.jQuery || document.write('<script src="/Files/Templates/Designs/Scanpan/assets/javascripts/lib/jquery-2.2.4.js"><\/script>')</script> 825 826 <script src="/Files/Templates/Designs/Scanpan/assets/javascripts/main-min.js?nocache=050218" async=""></script> 827 828 @RenderSnippet("BodyClose") 829 @RenderSnippet("Tracking") 830 831 @* Visual Website Optimizer Asynchronous Code *@ 832 @if(!string.IsNullOrWhiteSpace(visualWebsiteOptimizerToken)) { 833 <!-- Start Visual Website Optimizer Asynchronous Code --> 834 <script type='text/javascript'> 835 var _vwo_code=(function(){ 836 var account_id=@visualWebsiteOptimizerToken, 837 settings_tolerance=2000, 838 library_tolerance=2500, 839 use_existing_jquery=false, 840 // DO NOT EDIT BELOW THIS LINE 841 f=false,d=document;return{use_existing_jquery:function(){return use_existing_jquery;},library_tolerance:function(){return library_tolerance;},finish:function(){if(!f){f=true;var a=d.getElementById('_vis_opt_path_hides');if(a)a.parentNode.removeChild(a);}},finished:function(){return f;},load:function(a){var b=d.createElement('script');b.src=a;b.type='text/javascript';b.innerText;b.onerror=function(){_vwo_code.finish();};d.getElementsByTagName('head')[0].appendChild(b);},init:function(){settings_timer=setTimeout('_vwo_code.finish()',settings_tolerance);this.load('//dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&r='+Math.random());var a=d.createElement('style'),b='body{opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important;}',h=d.getElementsByTagName('head')[0];a.setAttribute('id','_vis_opt_path_hides');a.setAttribute('type','text/css');if(a.styleSheet)a.styleSheet.cssText=b;else a.appendChild(d.createTextNode(b));h.appendChild(a);return settings_timer;}};}());_vwo_settings_timer=_vwo_code.init(); 842 </script> 843 <!-- End Visual Website Optimizer Asynchronous Code --> 844 } 845 846 847 @* Raptor tracking script *@ 848 @* Only on Denmark ( area id 1 ) *@ 849 @if( Pageview.Area.ID == 1 ) { 850 <script type="text/javascript" language="javascript"> 851 var rsa; //A global object for use outside the raptorLoaded function 852 var raptorLoaded = function (raptor) { 853 rsa=raptor; 854 raptor.initialize({ customerID: "5187", productIdParamIndex: 2, eventTypeParamIndex: 1 }); 855 @RenderSnippet("raptorScript") 856 } 857 </script> 858 <script> 859 (function (d, t) { 860 var g = d.createElement(t), 861 s = d.getElementsByTagName(t)[0]; 862 g.src = '//az19942.vo.msecnd.net/script/raptor-2.1.0.js'; 863 s.parentNode.insertBefore(g, s); 864 }(document, 'script')); 865 </script> 866 } 867 868 @footerScript 869 870 </body> 871 </html> 872