Error executing template "Designs/isabella/_parsed/espresso.parsed.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
at CompiledRazorTemplates.Dynamic.RazorEngine_60e1c724dea143679d9234afa344d3cc.Execute() in F:\dynamicweb.net\Solutions\isabella.espresso4.dk\Files\Templates\Designs\isabella\_parsed\espresso.parsed.cshtml:line 59
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader)
at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 2 @using System.IO 3 @using System.Web 4 @using Co3.Espresso.Website.Services 5 @using Dynamicweb.Admin.dk.dynamicweb.templates 6 @using Dynamicweb.Ecommerce.Common 7 @using Dynamicweb.Frontend 8 @using System.Net 9 @using System.Net.Sockets 10 @{ 11 string globalAreaLang = PageView.Current().Area.CultureInfo.TwoLetterISOLanguageName; 12 string globalAreaName = string.Empty; 13 globalAreaName = PageView.Current().Area.Name; 14 string currencySeparatorDecimal = PageView.Current().Area.CultureInfo.NumberFormat.NumberDecimalSeparator; 15 string currencySeparatorInteger = PageView.Current().Area.CultureInfo.NumberFormat.NumberGroupSeparator; 16 bool isProductPage = !string.IsNullOrEmpty(Dynamicweb.Context.Current.Request["productid"]); 17 string openGraphUrl = PageView.Current().SearchFriendlyUrl; 18 string openGraphImage = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + Espresso.OpenGraphImage; 19 string openGraphTitle = Espresso.OpenGraphTitle; 20 string openGraphDescription = Espresso.OpenGraphDescription; 21 if (string.IsNullOrEmpty(openGraphImage)) 22 { 23 openGraphImage = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host + (string)PageView.Current().Area.Item["OpenGraphImage"]; 24 } 25 if (string.IsNullOrEmpty(openGraphTitle)) 26 { 27 openGraphTitle = (string)PageView.Current().Area.Item["OpenGraphTitle"]; 28 } 29 if (string.IsNullOrEmpty(openGraphDescription)) 30 { 31 openGraphDescription = (string)PageView.Current().Area.Item["OpenGraphDescription"]; 32 } 33 34 35 bool isUserAuthenticated = PageView.Current().User != null; 36 string webfontsSnippetHtml = RenderSnippet( "webfonts" ).ToString().Trim(); 37 string customWebsite = PageView.Current().Area.Item["CustomWebsite"]?.ToString(); 38 string shopType = PageView.Current().Area.Item["ShopType"]?.ToString(); 39 string isOutletClass = shopType == "Outlet" ? "is-outlet" : string.Empty; 40 bool isCamplet = customWebsite == "camplet-website"; 41 42 } 43 44 <!DOCTYPE html> 45 <html lang="@globalAreaLang" data-separator-integer="@currencySeparatorInteger" data-separator-decimal="@currencySeparatorDecimal" data-area="@globalAreaName" data-shop="@shopType"> 46 <head> 47 @GetValue( "CopyRightNotice" ) 48 <meta charset="utf-8"> 49 <meta content="width=device-width, initial-scale=1, shrink-to-fit=no, minimal-ui" name="viewport"> 50 <meta content="ie=edge" http-equiv="x-ua-compatible"> 51 <title>@GetValue("Title")</title> 52 @Espresso.CriticalCSS 53 @if ( webfontsSnippetHtml != "<!--$$Snippet(webfonts)-->" ) 54 { 55 @webfontsSnippetHtml 56 } 57 <link href="/Files/Templates/Designs/isabella/_assets/_dist/css/default.css?v=1.17" media="@Espresso.StylesheetAttributeMedia" rel="@Espresso.StylesheetAttributeRel" as="style"> 58 59 @Espresso.CriticalJS 60 @*<meta name="description" content="@Espresso.DynamicwebPage.Description">*@ 61 <link rel="shortcut icon" href="@Espresso.Area.Item.Favicon"> 62 @GetValue( "MetaTags" ) 63 @if ( Espresso.IsStagingUrl ) 64 { 65 <meta content="noindex,nofollow" name="robots"> 66 } 67 68 <meta property="og:site_name" content="Isabella"> 69 70 @if (isProductPage) 71 { 72 @RenderSnippet( "ProductOpenGraph" ) 73 } 74 else 75 { 76 <meta property="og:title" content="@openGraphTitle"> 77 <meta property="og:description" content="@openGraphDescription"> 78 <meta property="og:image" content="@openGraphImage"> 79 } 80 <meta property="og:url" content="@openGraphUrl"> 81 <meta property="og:type" content="website"> 82 83 <meta name="facebook-domain-verification" content="8kymtn6m9jq0t3gqsk3y6dqbadc3qf"> 84 @if ( string.IsNullOrEmpty( Espresso.Area.Item.GoogleSiteVerification ) == false ) 85 { 86 <meta name="google-site-verification" content="@Espresso.Area.Item.GoogleSiteVerification"> 87 } 88 @{ 89 if ( 1 == 2 ) 90 { 91 @GetValue( "Stylesheets" ) 92 } 93 } 94 95 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 96 @using System.Web; 97 @using System.IO 98 @using Dynamicweb.Content 99 @using Dynamicweb.Content.Items 100 @using Dynamicweb.Rendering 101 @using Dynamicweb.Frontend 102103 <!-- Hreflang --> 104 @{ 105 @* Get areas from service *@ 106 Dynamicweb.Content.AreaService areaService = new Dynamicweb.Content.AreaService(); 107 IList<Area> areas = areaService.GetAreas(); 108 @* Get current page's relation-text from page-item *@ 109 string currentPageRelation = PageView.Current().Page.Item["PageRelation"] != null ? PageView.Current().Page.Item["PageRelation"].ToString() : string.Empty; 110 @* Frontpage must have 'frontpage' as relation-text *@ 111112 string frontpageRelation = "i-frontpage"; 113 int REDIRECT_ID = 1; 114 if (PageView.Current().Area.Item["CustomWebsite"] != null && PageView.Current().Area.Item["CustomWebsite"].ToString() == "timeout-website") 115 { 116 frontpageRelation = "t-frontpage"; 117 REDIRECT_ID = 63; 118 } 119 if (PageView.Current().Area.Item["CustomWebsite"] != null && PageView.Current().Area.Item["CustomWebsite"].ToString() == "camplet-website") 120 { 121 frontpageRelation = "c-frontpage"; 122 REDIRECT_ID = 76; 123 } 124 string domainBase = areas.FirstOrDefault( a => a?.ID == REDIRECT_ID ).DomainLock; 125 List<dynamic> areaInfoList = new List< dynamic >(); 126127 @* Iterate areas *@ 128 foreach ( Area area in areas ) 129 { 130 if ( area.Active == true && area.ID != REDIRECT_ID ) 131 { 132133 @* Get current area's culture *@ 134 string culture = area.Culture; 135 string name = area.Name; 136 @* Check for IsDefault Hreflang on area *@ 137 string isDefaultHrefLang = area.Item[ "IsDefaultHrefLang" ] != null ? area.Item[ "IsDefaultHrefLang" ].ToString() : string.Empty; 138 @* Check for override-culture text on area *@ 139 string hreflangCultureOverride = area.Item[ "HreflangLanguageOverride" ] != null ? area.Item[ "HreflangLanguageOverride" ].ToString() : string.Empty; 140141 string isWebsiteExcluded = area.Item["ExcludeFromHreflang"] != null ? area.Item["ExcludeFromHreflang"]?.ToString() : string.Empty; 142 @* Get scheme and domain *@ 143 string scheme = GetGlobalValue("Global:Request.Scheme"); 144 string domain = domainBase; 145 @* If we have a primary domain call pageservice and get pages *@ 146147 string productId = HttpContext.Current.Request[ "productid" ]; 148 if (string.IsNullOrEmpty(productId) == false) 149 { 150 if (PageView.Current().Page.Parent != null && PageView.Current().Page.Parent.Item != null && PageView.Current().Page.Parent.Item["PageRelation"] != null) 151 { 152 currentPageRelation = PageView.Current().Page.Parent.Item["PageRelation"].ToString(); 153 } 154155 } 156157 if ( string.IsNullOrEmpty(currentPageRelation) == false && string.IsNullOrEmpty(domain) == false ) 158 { 159160161 Dynamicweb.Content.PageService pageService = new Dynamicweb.Content.PageService(); 162 IEnumerable< Dynamicweb.Content.Page > pages = pageService.GetPagesByAreaID(area.ID); 163 @* Iterate pages in area - check if is active + has item + has item-pagerelation + item-pagerelation equals current pagerelation *@ 164 foreach ( Dynamicweb.Content.Page page in pages.Where(p => p.Published && p.Item != null && p.Item[ "PageRelation" ] != null && p.Item[ "PageRelation" ].ToString().Equals(currentPageRelation)) ) 165 { 166167 string url = string.Empty; 168 if ( string.IsNullOrEmpty(productId) == false ) 169 { 170 @* Build url to area product page *@ 171 string prodUrl = string.Format("Default.aspx?ID={0}&ProductId={1}", pageService.GetPagesByParentID(page.ID)?.FirstOrDefault()?.ID, productId); 172 url = string.Format("{0}://{1}{2}", scheme, domain, SearchEngineFriendlyURLs.GetFriendlyUrl(prodUrl, area.EcomLanguageId)); 173 } 174 else 175 { 176 @* Build url to area page *@ 177 url = string.Format("{0}://{1}{2}", scheme, domain, SearchEngineFriendlyURLs.GetFriendlyUrl(page.GetPageHrefValue())); 178 } 179 @* If our current page relation match frontpage - set link to domain only *@ 180 if ( currentPageRelation == frontpageRelation ) 181 { 182 url = string.Format("{0}://{1}/{2}", scheme, domain, name); 183 } 184185 @* If our area item has checked in Default hreflang, we render x-default link *@ 186 if ( isDefaultHrefLang == "True" ) 187 { 188 <link rel="alternate" hreflang="x-default" href="@url"> 189 } 190 @* If we have a value in the area-item to overrule the culture, override the value here *@ 191 if ( string.IsNullOrEmpty(hreflangCultureOverride) == false ) 192 { 193 culture = hreflangCultureOverride; 194 } 195 @* Render hreflang-link *@ 196 if ( isWebsiteExcluded != "True") 197 { 198 <link rel="alternate" hreflang="@culture.ToLower()" href="@url"> 199 } 200201 } 202 } 203 } 204 } 205206 } 207 <!-- End Hreflang --> 208209 @if (!isCamplet) 210 { 211 <!-- Google Tag Manager --> 212 <script>!function(){"use strict";function l(e){for(var t=e,r=0,n=document.cookie.split(";");r<n.length;r++){var o=n[r].split("=");if(o[0].trim()===t)return o[1]}}function s(e){return localStorage.getItem(e)}function u(e){return window[e]}function d(e,t){e=document.querySelector(e);return t?null==e?void 0:e.getAttribute(t):null==e?void 0:e.textContent}var e=window,t=document,r="script",n="dataLayer",o="TT2Z6XF",a="https://ss.isabella.net",i="",c="vchxjrma",E="stapeUserId",I="",v="",g=!1;try{var g=!!E&&(m=navigator.userAgent,!!(m=new RegExp("Version/([0-9._]+)(.*Mobile)?.*Safari.*").exec(m)))&&16.4<=parseFloat(m[1]),A="stapeUserId"===E,f=g&&!A?function(e,t,r){void 0===t&&(t="");var n={cookie:l,localStorage:s,jsVariable:u,cssSelector:d},t=Array.isArray(t)?t:[t];if(e&&n[e])for(var o=n[e],a=0,i=t;a<i.length;a++){var c=i[a],c=r?o(c,r):o(c);if(c)return c}else console.warn("invalid uid source",e)}(E,I,v):void 0;g=g&&(!!f||A)}catch(e){console.error(e)}var m=e,E=(m[n]=m[n]||[],m[n].push({"gtm.start":(new Date).getTime(),event:"gtm.js"}),t.getElementsByTagName(r)[0]),I="dataLayer"===n?"":"&l="+n,v=f?"&bi="+encodeURIComponent(f):"",A=t.createElement(r),e=g?"kp"+c:c,n=!g&&i?i:a;A.async=!0,A.src=n+"/"+e+".js?st="+o+I+v,null!=(f=E.parentNode)&&f.insertBefore(A,E)}();</script> 213 <!-- End Google Tag Manager --> 214 } 215 else 216 { 217 if ( string.IsNullOrEmpty( Espresso.Area.GoogleTagManagerID ) == false && Espresso.Area.GoogleTagManagerID != "GTM-XXXX" ) 218 { 219 <!-- Google Tag Manager --> 220 <script> 221 (function(w, d, s, l, i) { 222 w[l] = w[l] || []; 223 w[l].push({ 224 'gtm.start': 225 new Date().getTime(), 226 event: 'gtm.js' 227 }); 228 var f = d.getElementsByTagName(s)[0], 229 j = d.createElement(s), 230 dl = l != 'dataLayer' ? '&l=' + l : ''; 231 j.async = true; 232 j.src = 233 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; 234 f.parentNode.insertBefore(j, f); 235 })(window, document, 'script', 'dataLayer', '@Espresso.Area.GoogleTagManagerID'); 236 </script> 237 <!-- End Google Tag Manager --> 238 } 239 } 240241242243244 <meta name="p:domain_verify" content="f3602094bd5d9d79dad3925721bc1ae4"> 245 <meta name="msvalidate.01" content="DF1E6C310BF3052B5579FABC80E4444D"> 246 <!-- ActiveCampaign --> 247 <script type="text/javascript" defer=""> 248249 (function(e,t,o,n,p,r,i){e.visitorGlobalObjectAlias=n; 250 e[e.visitorGlobalObjectAlias]=e[e.visitorGlobalObjectAlias]||function(){(e[e.visitorGlobalObjectAlias].q=e[e.visitorGlobalObjectAlias].q||[]).push(arguments)}; 251 e[e.visitorGlobalObjectAlias].l=(new Date).getTime(); 252 r=t.createElement("script"); 253 r.src=o;r.async=true; 254 i=t.getElementsByTagName("script")[0]; 255 i.parentNode.insertBefore(r,i)})(window,document,"https://diffuser-cdn.app-us1.com/diffuser/diffuser.js","vgo"); 256 vgo('setAccount', '254430349'); 257 vgo('setTrackByDefault', true); 258 vgo('process'); 259 </script> 260 <!-- ActiveCampaign --> 261262263 </dynamic></head> 264265 <body class="@Espresso.Item.CustomClasses @customWebsite @isOutletClass" data-cart-currencycode="@Context.Currency.Code" data-shop-currencycode="@Pageview.Area.EcomCurrencyId" data-userauthenticated="@isUserAuthenticated.ToString().ToLower()"> 266267 @if (!isCamplet) 268 { 269 <!-- Google Tag Manager (noscript) --> 270 <noscript><iframe src="https://ss.isabella.net/ns.html?id=GTM-TT2Z6XF" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> 271 <!-- End Google Tag Manager (noscript) --> 272 } 273 else 274 { 275 if ( string.IsNullOrEmpty( Espresso.Area.GoogleTagManagerID ) == false && Espresso.Area.GoogleTagManagerID != "GTM-XXXX" ) 276 { 277 <!-- Google Tag Manager (noscript) --> 278 <noscript> 279 <iframe src="https://www.googletagmanager.com/ns.html?id=@Espresso.Area.GoogleTagManagerID" height="0" width="0" style="display: none; visibility: hidden"></iframe> 280 </noscript> 281 <!-- End Google Tag Manager (noscript) --> 282 } 283 } 284285 @using Dynamicweb.Frontend 286 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 287 @{ 288 Espresso.Canvas.ClassList.AddClasses( "js-e-canvas is-loading" ); 289 if ( Espresso.Item.CanvasFullscreen == "True" ) 290 { 291 Espresso.Canvas.ClassList.AddClasses( "is-fullscreen" ); 292 } 293294 } 295296297298 @using System.Globalization 299 @using System.Security.Cryptography.X509Certificates 300 @using System.Web.Razor.Parser.SyntaxTree 301 @using Co3.Espresso.Base.Extensions 302 @using Co3.Espresso.Website.Models.FrontEnd 303 @using Co3.Espresso.Website.Services 304 @using Co3.Isabella.Dw.Models.FrontEnd.Ecommerce 305 @using Dynamicweb.Content 306 @using Dynamicweb.Ecommerce.Products 307 @using Dynamicweb.Frontend 308 @using Dynamicweb.Rendering 309 @using Dynamicweb.Rendering.Translation 310 @using Dynamicweb.SystemTools 311 @using EcomContext = Dynamicweb.Ecommerce.Common.Context 312 @using eProductService = Co3.Espresso.Website.Services.ProductService 313 @using Page = Dynamicweb.Content.Page 314 @using PageService = Dynamicweb.Content.PageService 315316 @functions { 317318 public string getCountryCodeFromArea(Area area) 319 { 320 RegionInfo regionInfo = new RegionInfo( area.CultureInfo.LCID ); 321 return regionInfo.TwoLetterISORegionName; 322 } 323324 public string getCheckoutSetup(string shopType = "") 325 { 326 bool isB2bCheckout = PageView.Current().User != null; 327 if (isB2bCheckout) 328 { 329 return "shipping,customer,approve"; 330 } else if (shopType == "B2C") 331 { 332 return "shipping,payment,approve"; 333 } else if (shopType == "Outlet") 334 { 335 return "shipping,customer,payment,approve"; 336 } 337338 return "customer,approve"; 339 } 340341 public static string GetStandardCollapseToggleTextExpand() 342 { 343 return "Se mere"; 344 } 345346 public static string GetStandardCollapseToggleTextCollapse() 347 { 348 return "Se mindre"; 349 } 350351 public string getModelTypeLink() 352 { 353 bool isUserAuthenticated = PageView.Current().User != null; 354 string eComCountryCode = PageView.Current().Area.Item[ "EcommerceCountryCode" ] != null ? PageView.Current().Area.Item[ "EcommerceCountryCode" ].ToString() : ""; 355 string returnValue = string.Empty; 356357 if ( isUserAuthenticated == false ) 358 { 359 if ( string.IsNullOrEmpty(eComCountryCode) == false) 360 { 361 { 362 returnValue = string.Format( "Ecom:Product.CategoryField.ModelType.ModelTypeLink_{0}.Value", eComCountryCode ); 363 } 364 } 365 else 366 { 367 returnValue = "Ecom:Product.CategoryField.ModelType.ModelTypeLink.Value"; 368 } 369 } 370 else 371 { 372 if ( string.IsNullOrEmpty(eComCountryCode) == false) 373 { 374 { 375 returnValue = string.Format( "Ecom:Product.CategoryField.ModelType.ModelTypeLinkB2B_{0}.Value", eComCountryCode ); 376 } 377 } 378 else 379 { 380 returnValue = "Ecom:Product.CategoryField.ModelType.ModelTypeLinkB2B.Value"; 381 } 382 } 383384 return returnValue; 385 } 386387 } 388389 @helper ProductDescription(string sectionClasses = "e-section", bool sectionCollapse = false, string contentClasses = null, string heading = null, string content = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null) 390 { 391 if ( string.IsNullOrEmpty( content ) == false ) 392 { 393 ClassList headingClassList = new ClassList(); 394 headingClassList.AddClasses( "col-12" ); 395 ClassList contentClassList = new ClassList(); 396 contentClassList.AddClasses( "col-12" ); 397398 @sectionStart( sectionClasses: sectionClasses, sectionCollapse: sectionCollapse, contentClasses: contentClasses, collapseToggleTextCollapse: collapseToggleTextCollapse, collapseToggleTextExpand: collapseToggleTextExpand ) 399400 if ( string.IsNullOrEmpty( heading ) == false ) 401 { 402 <div class="@headingClassList"> 403 <h2>@heading</h2> 404 </div> 405 } 406 <div class="@contentClassList"> 407 @content 408 </div> 409410 @sectionEnd() 411 } 412 } 413414415 @helper ProductVideo(string sectionClasses = "e-section", string contentClasses = null, string heading = null, string videoURL = null) 416 { 417 if ( string.IsNullOrEmpty( videoURL ) == false ) 418 { 419 ClassList headingClassList = new ClassList(); 420 headingClassList.AddClasses( "col-12" ); 421 ClassList contentClassList = new ClassList(); 422 contentClassList.AddClasses( "col-12" ); 423424425 @sectionStart( sectionClasses: sectionClasses, contentClasses: contentClasses ) 426427 if ( string.IsNullOrEmpty( heading ) == false ) 428 { 429 <div class="@headingClassList"> 430 <h2>@heading</h2> 431 </div> 432 } 433434 <div class="@contentClassList"> 435 <div class="embed-responsive embed-responsive-16by9 mb-2"> 436 <iframe class="embed-responsive-item cookieconsent-optin-marketing" data-cookieconsent="marketing" data-cookieblock-src="@videoURL" width="1080" height="608" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe> 437 <div class="cookieconsent-optout-marketing"> 438 <div> 439 <a class="btn btn-primary" href="javascript:Cookiebot.renew()"> 440 @Dynamicweb.Rendering.Translation.Translation.GetTranslation("CookieBot - Video - accept marketing-cookies", PageView.Current().Area.Layout.Design) 441 </a> 442443 </div> 444 </div> 445 </div> 446 </div> 447 @sectionEnd() 448 } 449 } 450451 @helper ProductRelatedProducts(string sectionClasses = "e-section", bool sectionCollapse = false, string contentClasses = null, string heading = null, string content = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null, 452 IEnumerable< Product > productLoop = null) 453 { 454 if ( productLoop != null && productLoop.Any() == true ) 455 { 456 ClassList headingClassList = new ClassList(); 457 headingClassList.AddClasses( "col-12" ); 458 ClassList contentClassList = new ClassList(); 459 contentClassList.AddClasses( "col-12" ); 460461 @sectionStart( sectionClasses: sectionClasses, sectionCollapse: sectionCollapse, contentClasses: contentClasses, collapseToggleTextCollapse: collapseToggleTextCollapse, collapseToggleTextExpand: collapseToggleTextExpand ) 462463 if ( string.IsNullOrEmpty( heading ) == false ) 464 { 465 <div class="@headingClassList"> 466 <h4 class="isabella-text-bullets-left mb-3">@heading</h4> 467 </div> 468 } 469 <div class="@contentClassList"> 470 <div class="e-products mb-2"> 471 <div class="row"> 472 @{ 473 string productlistItemClassList = "col-12 col-sm-6 col-md-3 col-lg-3 col-xl-3"; 474 } 475 @foreach ( Product product in productLoop.Where(p => p.Groups.Any(g => g.ShopId.Equals("SHOP1")) && (bool) p.GetCategoryValue( "ProductsGeneral", "PIMActive" ) != false && (bool) p.ShowInProductList && p.Active) ) 476 { 477 @ProductlistItem(product, productlistItemClassList) 478 } 479 </div> 480 </div> 481 </div> 482483 @sectionEnd() 484 } 485 } 486487488 @helper ProductlistItem(Product product, string productlistItemClassList = null, string isModelProductList = null) 489 { 490 Dynamicweb.Ecommerce.Products.ProductService dwProductService = new Dynamicweb.Ecommerce.Products.ProductService(); 491 string shopType = PageView.Current().Area.Item["ShopType"]?.ToString(); 492 string productLink = eProductService.Instance.GetProductLink( product.GetDefaultGroupByShopId( product.DefaultShopId ).Id, product.Id, product.VariantId ); 493494495 productLink = SearchEngineFriendlyURLs.GetFriendlyUrl( productLink ); 496497 if (shopType == "Outlet") 498 { 499 Page page = new PageService().GetPageByNavigationTag(PageView.Current().AreaID, "outletdisplaypage"); 500 if (page != null) 501 { 502 productLink = SearchEngineFriendlyURLs.GetFriendlyUrl( $"Default.aspx?ID={page.ID}&productId={product.Id}" ); 503 } 504505 } 506507 IsabellaProductImageUrl primaryImage = Co3.Isabella.Dw.Services.ProductService.Instance.GetImagePrimary(product); 508 List<IsabellaProductImageUrl> detailsImages = Co3.Isabella.Dw.Services.ProductService.Instance.GetImageDetails(product); 509 string detailsImage = detailsImages?.FirstOrDefault( pd => pd.Type == 0 && pd.GroupId == 4 )?.Medium ?? string.Empty; 510511 //string productlistDetailImage = product.Details.FirstOrDefault( pd => pd.Type == 0 && pd.GroupId == 4 )?.Value; 512513514515 string image = "/Files/Templates/Designs/isabella/_assets/img/NoImage.gif"; 516517 if (primaryImage != null) 518 { 519 image = primaryImage.Medium; 520 } 521522 if ( product != null ) 523 { 524 dynamic productData = new 525 { 526 id = product.Id, 527 url = productLink, 528 number = product.Number, 529 name = product.Name, 530 imageDefault = image, 531 price = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice( product.Id ).Format(), 532 priceClean = Co3.Isabella.Dw.Services.ProductService.Instance.GetPrice( product.Id ).Price, 533 productIntroText = product.GetCategoryValue( "ProductsGeneral", "ProductIntroText" )?.ToString(), 534 news = product.GetCategoryValue( "ProductsGeneral", "News" )?.ToString(), 535 productType = product.GetCategoryValue( "ProductsGeneral", "ProductType" )?.ToString(), 536 isModelProductList = isModelProductList, 537 productlistDetailImage = detailsImage, 538 shopType 539 }; 540541 <div class="@productlistItemClassList"> 542 <div class="border-1 card mb-6"> 543 <a href="@productData.url"> 544 @if ( productData.isModelProductList == "True" ) 545 { 546 <img src="@productData.productlistDetailImage" alt="@productData.name @productData.productType" class="col-12 p-0"> 547 } 548 else 549 { 550 <img src="@productData.imageDefault" alt="@productData.name @productData.productType" class="col-12 p-0"> 551 } 552 @if ( productData.news == "True" ) 553 { 554 <div class="isabella-product-item-news"> 555 @Dynamicweb.Rendering.Translation.Translation.GetTranslation( "Ecom Product - News Badge - Text" ) 556 </div> 557 } 558 </a> 559 <div class="card-body p-1 p-lg-3"> 560 <h4 class="e-products-item-name mb-0"> 561 <a href="@productData.url"> 562 @productData.name 563 </a> 564 </h4> 565566 </div> 567 </div> 568 </div> 569 } 570 } 571572573 @helper sectionStart(string sectionClasses = "e-section", string contentClasses = null, bool sectionCollapse = false, string sectionId = null, string collapseToggleTextExpand = null, string collapseToggleTextCollapse = null) 574 { 575 sectionId = string.IsNullOrEmpty( sectionId ) ? Guid.NewGuid().ToString( "N" ) : sectionId; 576 ClassList sectionClassList = new ClassList(); 577 sectionClassList.AddClasses( sectionClasses ); 578 ClassList contentClassList; 579580 if ( contentClasses == null ) 581 { 582 contentClassList = Co3.Espresso.Website.Services.PageService.Instance.GetResponsiveClassesFromPageItem( PageView.Current().Page.Item ); 583 } 584 else 585 { 586 contentClassList = new ClassList(); 587 contentClassList.AddClasses( contentClasses ); 588 } 589590 // TODO: Split collapse logic into separate helper function. 591 string collapseId = Guid.NewGuid().ToString( "N" ); 592 ClassList collapseToggleClassList = new ClassList(); 593 if ( sectionCollapse ) 594 { 595 sectionClassList.AddClasses( "p-section-collapse js-p-section-collapse" ); 596 collapseToggleClassList.AddClasses( contentClasses ); 597 collapseToggleClassList.AddClasses( "p-section-collapse-toggle collapsed order-last text-center" ); 598 contentClassList.AddClasses( "p-section-collapse-content collapse is-md" ); 599 } 600601 @:<section class="@sectionClassList" id="@sectionId"> 602 @:<div class="container-fluid"> 603 @:<div class="row"> 604605 // TODO: Split collapse logic into separate helper function. 606 if ( sectionCollapse ) 607 { 608 <div class="@collapseToggleClassList" data-toggle="collapse" data-target="#@collapseId"> 609 <button class="btn btn-primary p-section-collapse-toggle-btn" type="button"> 610 <i class="material-icons p-section-collapse-toggle-icon">keyboard_arrow_down</i> 611 </button> 612 <small class="h4 p-section-collapse-toggle-text" data-expand-text="@( string.IsNullOrEmpty( collapseToggleTextExpand ) ? GetStandardCollapseToggleTextExpand() : collapseToggleTextExpand )" data-collapse-text="@( string.IsNullOrEmpty( collapseToggleTextCollapse ) ? GetStandardCollapseToggleTextCollapse() : collapseToggleTextCollapse )"></small> 613 </div> 614 } 615616 @:<div class="@contentClassList" id="@collapseId"> 617 @:<div class="row"> 618 } 619620 @helper sectionEnd() 621 { 622 @:</div> 623 @:</div> 624 @:</div> 625 @:</div> 626 @:</section> 627 } 628629630631632633 <div class="e-loading-overlay e-page-loading-overlay is-loading js-e-page-loading-overlay"> 634 <svg class="e-loading-spinner isabella-loading-spinner-logo" viewbox="0 0 316.9 383"> 635 <path class="isabella-logo crown-top" d="M264.2,150.9l-30.5,45.4L220.2,57.9l-18.5-5l-45.4,122.8L113.7,52.9l-17,5L81.1,196.3l-27.7-46.1 636 c-10,5.1-10,5.1-10,5.1s0,0-5.7,3.4c14.9,39.8,28.4,91.6,35.5,142c45.4-11.4,120.7-12.8,168.3-1.4c8.5-47.6,22-102.9,37.6-140.6 637 L264.2,150.9z"></path> 638 <path class="isabella-logo crown-bottom" d="M76.1,324.8c64.6-14.2,102.2-14.2,163.3-0.7c-2.1,21.3-4.3,40.5-5.7,57.5c-43.3-9.2-105.1-9.2-154.1,1.4 639 C79.6,364.6,78.2,345.4,76.1,324.8"></path> 640 <path class="isabella-logo circle-1" d="M54,153.1c0,0,19-23-1.9-44S0.7,110.7,0,127.7s10.4,25.4,10.4,25.4S33.8,172.8,54,153.1z"></path> 641 <path class="isabella-logo circle-3" d="M241.2,52.4c0,0,19-23-1.9-44s-51.4,1.6-52.1,18.6s10.4,25.4,10.4,25.4S221,72.2,241.2,52.4z"></path> 642 <path class="isabella-logo circle-4" d="M309,110.4c0,0,19,23-1.9,44s-51.4-1.6-52.1-18.6c-0.6-17.1,10.4-25.4,10.4-25.4S288.8,90.7,309,110.4z"></path> 643 <path class="isabella-logo circle-2" d="M122.1,8.8c0,0,19,23-1.9,44s-51.4-1.6-52.1-18.6S78.5,8.8,78.5,8.8S101.9-11,122.1,8.8z"></path> 644 </svg> 645646647 </div> 648 @* https://medium.com/clio-calliope/making-google-fonts-faster-aadf3c02a36d *@ 649 @SnippetStart("webfonts") 650 <link crossorigin="" href="https://fonts.gstatic.com/" rel="preconnect"> 651 <link href="https://fonts.googleapis.com/css?family=IBM+Plex+Sans:400,700%7CMaterial+Icons" media="@Espresso.StylesheetAttributeMedia" rel="@Espresso.StylesheetAttributeRel" as="style"> 652 @SnippetEnd("webfonts") 653654655656 <div class="@Espresso.Canvas.ClassList"> 657 @using Co3.Espresso.Base.Extensions 658 @using Co3.Espresso.Website.Models.FrontEnd 659 @using Dynamicweb.Ecommerce.Orders 660 @using Dynamicweb.Frontend 661 @using Dynamicweb.Frontend.Navigation 662 @{ 663 ClassList headerClassList = new ClassList(); 664 headerClassList.AddClasses( "e-header js-e-header is-sticky" ); 665 if ( Espresso.Item.HeaderTransparent == "True" ) 666 { 667 headerClassList.AddClasses( "is-transparent" ); 668 } 669670 ClassList logoClassList = new ClassList(); 671 logoClassList.AddClasses( "e-logo" ); 672673 string backButtonLink = Espresso.Item.BackButtonLink; 674 ClassList backButtonClassList = new ClassList(); 675 ClassList backButtonIconClassList = new ClassList(); 676 if ( Espresso.Item.BackButton == "True" ) 677 { 678 backButtonClassList.AddClasses( "btn btn-sm btn-secondary my-1 align-self-center" ); 679 if ( backButtonLink == "" || backButtonLink == "/" ) 680 { 681 backButtonLink = "/"; 682 backButtonClassList.AddClasses( "js-e-back-link" ); 683 } 684 backButtonIconClassList.AddClasses( "material-icons material-icons-large" ); 685 if ( Espresso.Item.BackButtonPosition == "right" ) 686 { 687 backButtonClassList.AddClasses( "mr-0 ml-auto order-last" ); 688 logoClassList.AddClasses( "order-first" ); 689 } 690 else 691 { 692 backButtonClassList.AddClasses( "order-first" ); 693 logoClassList.AddClasses( "mr-0 ml-auto order-last" ); 694 } 695 if ( Espresso.Item.BackButtonIcon == "arrow_back" ) 696 { 697 backButtonClassList.AddClasses( "arrow-left" ); 698 backButtonIconClassList.AddClasses( "d-none" ); 699 } 700 else if ( Espresso.Item.BackButtonIcon == "arrow_forward" ) 701 { 702 backButtonClassList.AddClasses( "arrow-right" ); 703 backButtonIconClassList.AddClasses( "d-none" ); 704 } 705 } 706707 string logoPrimary = Espresso.Area.Item.LogoPrimary; 708 string logoSecondary = Espresso.Area.Item.LogoSecondary; 709710 if ( string.IsNullOrEmpty( logoSecondary ) == true ) 711 { 712 logoSecondary = logoPrimary; 713 } 714 string tagline = Espresso.Area.Item.Tagline; 715716 Dictionary< string, string > navigationHtml = new Dictionary< string, string > 717 { 718 { 719 "global", Navigation.RenderNavigation( "navigation/espresso.cshtml", new NavigationSettings() 720 { 721 StartLevel = 1, 722 StopLevel = 8, 723 ExpandMode = ExpandMode.All, 724 Parameters = new Dictionary< string, object >() 725 { 726 { "id", "dwnav-global" } 727 } 728 } ) 729 }, 730 { 731 "utilities-primary", Navigation.RenderNavigation( "navigation/espresso.cshtml", new NavigationSettings() 732 { 733 StartLevel = 4, 734 StopLevel = 5, 735 ExpandMode = ExpandMode.All, 736 RootNavigationTag = "utilities-primary", 737 Parameters = new Dictionary< string, object >() 738 { 739 { "id", "dwnav-utilities-primary" } 740 } 741 } ) 742 }, 743 { 744 "utilities-secondary", Navigation.RenderNavigation( "navigation/espresso.cshtml", new NavigationSettings() 745 { 746 StartLevel = 4, 747 StopLevel = 4, 748 ExpandMode = ExpandMode.All, 749 RootNavigationTag = "utilities-secondary", 750 Parameters = new Dictionary< string, object >() 751 { 752 { "id", "dwnav-utilities-secondary" } 753 } 754 } ) 755 }, 756 { 757 "hamburger-header", Navigation.RenderNavigation( "navigation/espresso.cshtml", new NavigationSettings() 758 { 759 StartLevel = 4, 760 StopLevel = 4, 761 ExpandMode = ExpandMode.All, 762 RootNavigationTag = "hamburger-header", 763 Parameters = new Dictionary< string, object >() 764 { 765 { "id", "dwnav-hamburger-header" } 766 } 767 } ) 768 }, 769 { 770 "hamburger-aside", Navigation.RenderNavigation( "navigation/espresso.cshtml", new NavigationSettings() 771 { 772 StartLevel = 4, 773 StopLevel = 4, 774 ExpandMode = ExpandMode.All, 775 RootNavigationTag = "hamburger-aside", 776 Parameters = new Dictionary< string, object >() 777 { 778 { "id", "dwnav-hamburger-aside" } 779 } 780 } ) 781 } 782 }; 783784 double cartQuantity = 0; 785 var areaCartContext = PageView.Current().Area.Item[ "ContextCart" ]?.ToString(); 786787 Dynamicweb.Ecommerce.Common.Context.CartContext = OrderContext.GetOrderContextById(areaCartContext); 788 Order cart = Dynamicweb.Ecommerce.Common.Context.Cart; 789 if (cart != null ) 790 { 791 cartQuantity = cart.ProductOrderLines.Count(ol => !ol.Product.GetProductFieldValue<bool>("IsRequiredAddOn")); 792 } 793 } 794795 @SnippetStart("CartQuantity") 796 @cartQuantity 797 @SnippetEnd("CartQuantity") 798799 @if ( Espresso.Item.HeaderHide != "True" ) 800 { 801 <header class="@headerClassList" data-autohide="true"> 802803 <div class="e-header-hamburger"> 804 @sectionStart( "e-header-section e-section", "col-12" ) 805 <div class="col-12 e-header-section-content"> 806 <div class="@logoClassList"> 807 <a class="e-logo-link" href="/@globalAreaName/"> 808 <img src="@logoPrimary" class="e-logo-img e-logo-img-primary" alt="@Espresso.Area.Item.CompanyName"> 809 <img src="@logoSecondary" class="e-logo-img e-logo-img-secondary" alt="@Espresso.Area.Item.CompanyName"> 810 @if ( string.IsNullOrEmpty( tagline ) == false ) 811 { 812 <p class="e-logo-tagline">@tagline</p> 813 } 814 </a> 815 </div> 816 @if ( Espresso.Item.NavigationHide != "True" ) 817 { 818 <section class="e-nav-hamburger-header"> 819 <ul class="nav"> 820 @navigationHtml[ "hamburger-header" ] 821 @* TODO: Move to xslt *@ 822 <li class="e-nav-item-hamburger-open nav-item"> 823 <a class="nav-link" data-target=".modal.e-nav" data-toggle="modal" href="#"> 824 <i class="e-nav-pageicon material-icons">menu</i> 825 <span class="e-nav-pagename">@Translate( "Header - Hamburger menu open - Button", "Menu" )</span> 826 </a> 827 </li> 828 </ul> 829 </section> 830 } 831 @if ( Espresso.Item.BackButton == "True" ) 832 { 833 <a class="@backButtonClassList" href="@backButtonLink"> 834 @if ( Espresso.Item.BackButtonIcon != "" ) 835 { 836 <i class="@backButtonIconClassList">@Espresso.Item.BackButtonIcon</i> 837 } 838 @Espresso.Item.BackButtonText 839 </a> 840 } 841 </div> 842 @sectionEnd() 843 </div> 844 <div class="e-nav js-e-nav modal p-0" data-backdrop="false"> 845 <div class="e-nav-container navbar flex-column d-flex"> 846847 @sectionStart( "e-header-section e-header-section-primary e-section order-xl-2", "col-12" ) 848 <div class="col-12 e-header-section-content"> 849 <div class="@logoClassList"> 850 <a class="e-logo-link" href="/@globalAreaName/"> 851 <img src="@logoPrimary" class="e-logo-img e-logo-img-primary" alt="@Espresso.Area.Item.CompanyName"> 852 <img src="@logoSecondary" class="e-logo-img e-logo-img-secondary" alt="@Espresso.Area.Item.CompanyName"> 853 @if (string.IsNullOrEmpty(tagline) == false) 854 { 855 <p class="e-logo-tagline">@tagline</p> 856 } 857 </a> 858 </div> 859860 @if ( Espresso.Item.NavigationHide != "True" ) 861 { 862 <nav class="e-nav-global js-e-nav-global"> 863 <ul class="nav"> 864 @navigationHtml[ "global" ] 865 </ul> 866 </nav> 867868 <div class="e-nav-item-hamburger-close"> 869 <a class="nav-link" data-target=".modal.e-nav" data-toggle="modal" href="#"> 870 <i class="e-nav-pageicon material-icons">close</i> 871 <span class="e-nav-pagename">@Translate( "Header - Hamburger menu close - Button", "Close" )</span> 872 </a> 873 </div> 874875 if ( string.IsNullOrEmpty( navigationHtml[ "utilities-primary" ] ) == false ) 876 { 877 @:</div> 878 @sectionEnd() 879 @sectionStart( "e-header-section e-header-section-secondary e-section order-xl-1", "col-12" ) 880 @:<div class="col-12 e-header-section-content"> 881882 <nav class="e-nav-utilities-primary js-e-nav-utilities-primary"> 883 <ul class="nav"> 884 @navigationHtml[ "utilities-primary" ] 885 </ul> 886 </nav> 887 } 888889 if ( string.IsNullOrEmpty( navigationHtml[ "utilities-secondary" ] ) == false ) 890 { 891 <nav class="e-nav-utilities-secondary"> 892 <ul class="nav"> 893 @navigationHtml[ "utilities-secondary" ] 894 </ul> 895 </nav> 896 } 897 if ( string.IsNullOrEmpty( navigationHtml[ "hamburger-aside" ] ) == false ) 898 { 899 <nav class="e-nav-hamburger-aside"> 900 <ul class="nav"> 901 @navigationHtml[ "hamburger-aside" ] 902 </ul> 903 </nav> 904 } 905 } 906 @if ( Espresso.Item.BackButton == "True" ) 907 { 908 <a class="@backButtonClassList" href="@backButtonLink"> 909 @if ( Espresso.Item.BackButtonIcon != "" ) 910 { 911 <i class="@backButtonIconClassList">@Espresso.Item.BackButtonIcon</i> 912 } 913 @Espresso.Item.BackButtonText 914 </a> 915 } 916 </div> 917 @sectionEnd() 918919 </div> 920 </div> 921922 </header> 923 } 924925 @helper GetSvgFileData(string svgfile) 926 { 927 string rtnValue = svgfile; 928 if (!string.IsNullOrEmpty(svgfile)) 929 { 930 string FilePath = svgfile; 931932 if (System.IO.Path.GetExtension(FilePath) == ".svg") 933 { 934 System.Xml.XmlReaderSettings settings = new System.Xml.XmlReaderSettings(); 935 settings.DtdProcessing = System.Xml.DtdProcessing.Ignore; 936 string svgFilePath = System.Web.HttpContext.Current.Server.MapPath(FilePath) ?? string.Empty; 937 if (System.IO.File.Exists(svgFilePath)) 938 { 939 using (System.IO.StreamReader sr = new System.IO.StreamReader(svgFilePath)) 940 { 941 using (System.Xml.XmlReader xr = System.Xml.XmlReader.Create(sr, settings)) 942 { 943 bool done = false; 944 while (xr.Read() && !done) 945 { 946 if (xr.NodeType == System.Xml.XmlNodeType.Element && xr.Name == "svg") 947 { 948 rtnValue = xr.ReadOuterXml(); 949 done = true; 950 } 951 } 952 } 953 } 954 } 955 } 956 } 957 @rtnValue; 958 } 959960961 @*General - Website Settings*@ 962963 @if ( Espresso.Item.Notificationbar != "True" ) 964 { 965 if ( !string.IsNullOrEmpty(Espresso.Area.Item.NotificationbarPageId) ) 966 { 967 <section class="e-section"> 968 <div class="container-fluid"> 969 <div class="row"> 970 <div class="col-12"> 971 <div class="row"> 972 @RenderPageContent(int.Parse(Espresso.Area.Item.NotificationbarPageId)) 973 </div> 974 </div> 975 </div> 976 </div> 977 </section> 978 } 979 } 980981 @*Specific - Page*@ 982983 @if ( !string.IsNullOrEmpty(Espresso.Item.NotificationbarPageId) ) 984 { 985 <section class="e-section"> 986 <div class="container-fluid"> 987 <div class="row"> 988 <div class="col-12"> 989 <div class="row"> 990 @RenderPageContent(int.Parse(Espresso.Item.NotificationbarPageId)) 991 </div> 992 </div> 993 </div> 994 </div> 995 </section> 996 } 997 @using Dynamicweb.Frontend 998 @using Dynamicweb.Security.UserManagement 999 @{ 1000 User currentUser = PageView.Current().User; 1001 if ( currentUser != null ) 1002 { 1003 User currentSecondaryUser = currentUser.CurrentSecondaryUser; 1004 if ( currentSecondaryUser != null ) 1005 { 1006 @sectionStart( "e-section bg-warning e-text-dark js-e-section is-sticky zi-fixed py-1", "col-12 small" ) 1007 <div class="align-self-center col-12 col-lg-9 col-md-8"> 1008 <p class="line-height-sm mb-1 mb-md-0 text-center text-md-left"> 1009 <i class="material-icons material-icons-2x">supervisor_account</i>&nbsp;@Translate( "Extranet Impersonation - Active impersonation message - Text", "You are currently impersonating this user:" ) <strong>@currentUser.Name &mdash; @currentUser.Company </strong> 1010 </p> 1011 </div> 1012 <div class="align-self-center col-12 col-lg-3 col-md-4"> 1013 <form class="mb-0 small text-center text-md-right" method="post" action="@Espresso.Area.Item.ExtranetImpersonationPage"> 1014 <button class="btn btn-primary" name="DwExtranetRemoveSecondaryUser" type="submit">@Translate( "Extranet Impersonation - Stop impersonation - Button", "Stop impersonation" )</button> 1015 </form> 1016 </div> 1017 @sectionEnd() 1018 } 1019 } 1020 } 102110221023 <main id="dwcontentmain" class="e-content js-e-content @Espresso.ContentArea.ClassList"> 1024 @using Dynamicweb.Content; 1025 @using Dynamicweb.Extensibility; 1026 @using Dynamicweb.Frontend 1027 @{ 1028 string eBreadcrumbClasslist = "e-breadcrumb js-e-breadcrumb d-none d-lg-block"; 1029 if ( Espresso.Item.Breadcrumb != "auto" && Espresso.Item.Breadcrumb != "none" && String.IsNullOrEmpty( Espresso.Item.Breadcrumb ) == false ) 1030 { 1031 eBreadcrumbClasslist += string.Format( " e-breadcrumb-{0}", Espresso.Item.Breadcrumb ); 1032 } 1033 string navigationHtmlBreadcrumb = RenderNavigation( new 1034 { 1035 id = "dwnav-breadcrumb", 1036 template = "breadcrumb.xslt", 1037 startlevel = 1, 1038 endlevel = 10, 1039 expandmode = "pathonly", 1040 sitemapmode = true 1041 } ); 10421043 var urlName = PageView.Current().Area.Name; 1044 } 10451046 @if ( string.IsNullOrEmpty( navigationHtmlBreadcrumb ) == false && Espresso.Item.Breadcrumb != "none" && string.IsNullOrEmpty( Espresso.Item.Breadcrumb ) == false ) 1047 { 1048 <section class="e-section @eBreadcrumbClasslist"> 1049 <div class="container-fluid"> 1050 <div class="row"> 1051 <div class="col-12"> 1052 <div class="row"> 10531054 <div class="col-12"> 1055 <nav class="e-breadcrumb-container"> 1056 <ol class="breadcrumb nav text-muted" itemscope="" itemtype="https://schema.org/BreadcrumbList"> 1057 <li class="breadcrumb-item m-0 p-0"> 1058 <a class="arrow-left breadcrumb-back-link js-e-back-link px-0" href="/@urlName">@Translate( "Breadcrumb - Back link", "Back" )</a> 1059 <span class="breadcrumb-prefix-text"> 1060 @Translate( "Breadcrumb - Prefix - Text", "You are here:" ) 1061 </span> 1062 <a href="/@urlName"> 1063 @ServiceLocator.Current.GetPageService().GetFirstPageForArea( GetInteger( "DwAreaID" ) ).MenuText 1064 </a> 1065 </li> 1066 @navigationHtmlBreadcrumb 1067 </ol> 1068 </nav> 1069 </div> 10701071 </div> 1072 </div> 1073 </div> 1074 </div> 1075 </section> 1076 } 10771078 <article class="e-content-article"> 1079 @{ 1080 int NavigationLocalHorizontalParentPageId = 0; 1081 if ( !string.IsNullOrEmpty( Espresso.Item.NavigationLocalParentPage ) ) 1082 { 1083 int.TryParse( Espresso.Item.NavigationLocalParentPage, out NavigationLocalHorizontalParentPageId ); 1084 } 1085 if ( NavigationLocalHorizontalParentPageId == 0 ) 1086 { 1087 NavigationLocalHorizontalParentPageId = PageView.Current().Page.ID; 1088 if ( !Dynamicweb.Services.Pages.GetPagesByParentID( NavigationLocalHorizontalParentPageId ).Any() ) 1089 { 1090 NavigationLocalHorizontalParentPageId = PageView.Current().Page.ParentPageId; 1091 } 1092 } 1093 string NavigationLocalHorizontalClassList = "e-nav-local e-nav-local-horizontal js-e-nav-local-horizontal"; 1094 string NavigationLocalHorizontalContainerClassList = "e-nav-local-container"; 1095 string NavigationLocalHorizontalTemplate = "local-" + Espresso.Item.NavigationLocalLayout + ".xslt"; 1096 if ( string.IsNullOrEmpty( Espresso.Item.NavigationLocalTemplate ) == false && Path.GetExtension( Espresso.Item.NavigationLocalTemplate ) == ".xslt" ) 1097 { 1098 NavigationLocalHorizontalTemplate = Path.GetFileName( Espresso.Item.NavigationLocalTemplate ); 1099 } 11001101 if ( Espresso.Item.NavigationLocalShow == "True" && Espresso.Item.NavigationLocalLayout == "horizontal" ) 1102 { 1103 NavigationLocalHorizontalClassList += " " + Espresso.Item.NavigationLocalCustomClasses; 1104 if ( Espresso.Item.NavigationLocalSticky == "True" ) 1105 { 1106 NavigationLocalHorizontalClassList += " is-sticky"; 1107 } 1108 if ( Espresso.Item.NavigationLocalAbsolute == "True" ) 1109 { 1110 NavigationLocalHorizontalClassList += " is-absolute"; 1111 } 1112 else 1113 { 1114 if ( Espresso.Item.NavigationLocalMarginTop != "0" && Espresso.Item.NavigationLocalMarginTop != "" ) 1115 { 1116 NavigationLocalHorizontalClassList += " mt-" + Espresso.Item.NavigationLocalMarginTop; 1117 } 1118 if ( Espresso.Item.NavigationLocalMarginBottom != "0" && Espresso.Item.NavigationLocalMarginBottom != "" ) 1119 { 1120 NavigationLocalHorizontalClassList += " mb-" + Espresso.Item.NavigationLocalMarginBottom; 1121 } 1122 } 1123 } 1124 } 1125 @if ( Espresso.Item.NavigationLocalShow == "True" && Espresso.Item.NavigationLocalLayout == "horizontal" ) 1126 { 1127 <section class="e-section @NavigationLocalHorizontalClassList"> 1128 <div class="container-fluid"> 1129 <div class="row"> 1130 <div class="col-12"> 1131 <div class="row"> 11321133 <div class="col-12"> 1134 <nav id="dwnav-local-horizontal-@NavigationLocalHorizontalParentPageId" class="@NavigationLocalHorizontalContainerClassList"> 1135 <ul class="justify-content-start nav"> 1136 @if ( Espresso.Item.NavigationLocalHeading != "" ) 1137 { 1138 <li class="e-nav-local-heading"> 1139 <h2>@Espresso.Item.NavigationLocalHeading</h2> 1140 </li> 1141 } 1142 @RenderNavigation( new 1143 { 1144 id = "dwnav-local-horizontal-" + NavigationLocalHorizontalParentPageId, 1145 parentid = NavigationLocalHorizontalParentPageId, 1146 template = NavigationLocalHorizontalTemplate, 1147 startlevel = Espresso.Item.NavigationLocalLevelStart, 1148 endlevel = Espresso.Item.NavigationLocalLevelEnd, 1149 expandmode = Espresso.Item.NavigationLocalPageTreeExpand == "True" ? "all" : "path" 1150 } ) 1151 </ul> 1152 </nav> 1153 </div> 11541155 </div> 1156 </div> 1157 </div> 1158 </div> 1159 </section> 1160 } 116111621163 @{ 1164 int NavigationLocalVerticalParentPageId = 0; 1165 if ( !string.IsNullOrEmpty( Espresso.Item.NavigationLocalParentPage ) ) 1166 { 1167 int.TryParse( Espresso.Item.NavigationLocalParentPage, out NavigationLocalVerticalParentPageId ); 1168 } 1169 if ( NavigationLocalVerticalParentPageId == 0 ) 1170 { 1171 NavigationLocalVerticalParentPageId = PageView.Current().Page.ID; 1172 if ( !Dynamicweb.Services.Pages.GetPagesByParentID( NavigationLocalVerticalParentPageId ).Any() ) 1173 { 1174 NavigationLocalVerticalParentPageId = PageView.Current().Page.ParentPageId; 1175 } 1176 } 11771178 string NavigationLocalVerticalClassList = "e-nav-local e-nav-local-vertical js-e-nav-local-vertical"; 1179 string NavigationLocalVerticalContainerClassList = "e-nav-local-container"; 1180 string NavigationLocalVerticalTemplate = "local-" + Espresso.Item.NavigationLocalLayout + ".xslt"; 1181 if ( string.IsNullOrEmpty( Espresso.Item.NavigationLocalTemplate ) == false && Path.GetExtension( Espresso.Item.NavigationLocalTemplate ) == ".xslt" ) 1182 { 1183 NavigationLocalVerticalTemplate = Path.GetFileName( Espresso.Item.NavigationLocalTemplate ); 1184 } 11851186 if ( Espresso.Item.NavigationLocalShow == "True" && Espresso.Item.NavigationLocalLayout == "vertical" ) 1187 { 1188 NavigationLocalVerticalClassList += " " + Espresso.Item.NavigationLocalCustomClasses; 11891190 if ( Espresso.Item.NavigationLocalMarginTop != "0" && Espresso.Item.NavigationLocalMarginTop != "" ) 1191 { 1192 NavigationLocalVerticalClassList += " mt-" + Espresso.Item.NavigationLocalMarginTop; 1193 } 1194 if ( Espresso.Item.NavigationLocalMarginBottom != "0" && Espresso.Item.NavigationLocalMarginBottom != "" ) 1195 { 1196 NavigationLocalVerticalClassList += " mb-" + Espresso.Item.NavigationLocalMarginBottom; 1197 } 11981199 if ( Espresso.Item.NavigationLocalSticky == "True" ) 1200 { 1201 NavigationLocalVerticalClassList += " is-sticky"; 1202 } 12031204 if ( Espresso.Item.NavigationLocalAbsolute == "True" ) 1205 { 1206 NavigationLocalVerticalClassList += " is-absolute"; 1207 } 1208 else 1209 { 1210 Espresso.ContentSection.ClassList.Clear(); 1211 Espresso.ContentSection.ClassList.AddClasses( "wtf col-12 col-lg-9 ml-auto" ); 1212 } 1213 } 1214 } 12151216 @if ( Espresso.Item.NavigationLocalShow == "True" && Espresso.Item.NavigationLocalLayout == "vertical" ) 1217 { 1218 <section class="e-section @NavigationLocalVerticalClassList"> 1219 <div class="container-fluid"> 1220 <div class="row"> 1221 <div class="col-12"> 1222 <div class="row"> 12231224 <div class="col-3"> 1225 <nav id="dwnav-local-@NavigationLocalVerticalParentPageId" class="@NavigationLocalVerticalContainerClassList"> 1226 <ul class="flex-column nav"> 1227 @if ( Espresso.Item.NavigationLocalHeading != "" ) 1228 { 1229 <li class="e-nav-local-heading"> 1230 <h2>@Espresso.Item.NavigationLocalHeading</h2> 1231 </li> 1232 } 1233 @RenderNavigation( new 1234 { 1235 id = "dwnav-local-" + NavigationLocalVerticalParentPageId, 1236 parentid = NavigationLocalVerticalParentPageId, 1237 template = NavigationLocalVerticalTemplate, 1238 startlevel = Espresso.Item.NavigationLocalLevelStart, 1239 endlevel = Espresso.Item.NavigationLocalLevelEnd, 1240 expandmode = Espresso.Item.NavigationLocalPageTreeExpand == "True" ? "all" : "path", 1241 } ) 1242 </ul> 1243 </nav> 1244 </div> 12451246 </div> 1247 </div> 1248 </div> 1249 </div> 1250 </section> 1251 } 125212531254 @sectionStart() 1255 @GetValue("DwContent(dwcontentmain)") 1256 @sectionEnd() 1257 </article> 1258 </main> 1259 @using Dynamicweb.Frontend 1260 @{ 1261 string FooterContentClassList = "e-footer-content e-section"; 12621263 bool isOutlet = shopType == "Outlet"; 1264 } 1265 @if ( Espresso.Item.FooterHide != "True" ) 1266 { 1267 <footer class="e-footer"> 1268 <article class="e-footer-wrapper"> 1269 <section class="@FooterContentClassList"> 1270 <div class="container-fluid"> 1271 <div class="row"> 1272 @if ( !string.IsNullOrEmpty( Espresso.Area.Item.FooterPageId ) ) 1273 { 1274 @RenderPageContent( int.Parse( Espresso.Area.Item.FooterPageId ) ) 1275 } 1276 </div> 1277 </div> 1278 </section> 1279 @if (!isOutlet) 1280 { 1281 <section class="e-footer-copyright e-section"> 1282 <div class="container-fluid"> 1283 <div class="align-items-baseline row"> 1284 <div class="col-12 col-lg-5"> 1285 @if (string.IsNullOrEmpty(Espresso.Area.Item.Adresse) == false) 1286 { 1287 @Espresso.Area.Item.Adresse 1288 } 1289 </div> 12901291 <div class="col-12 col-lg-4"> 1292 @if (string.IsNullOrEmpty(GetString("DwNavigation(dwnavutilitiessecondaryfooter)")) == false) 1293 { 1294 <div class="col-12 p-0"> 1295 <aside class="e-nav-utilities-secondary"> 1296 <ul class="nav nav-inline"> 1297 @GetValue("DwNavigation(dwnavutilitiessecondaryfooter)") 1298 </ul> 1299 </aside> 1300 </div> 1301 } 1302 </div> 130313041305 <div class="col-12 col-lg-3 text-lg-right"> 1306 <p class="e-copyright nav-link"> 1307 @*@Translate( "Footer - Copyright - Text", "Copyright &copy;" )&nbsp;*@ 1308 @*@DateTime.Now.Year.ToString()&nbsp;*@ 1309 @Translate("Footer - All Rights Reserved - Text", "All rights reserved.")&nbsp; 1310 @Espresso.Area.Item.CompanyName.&nbsp; 1311 </p> 1312 </div> 1313 </div> 1314 </div> 1315 </section> 1316 } 1317 </article> 1318 </footer> 1319 } 1320 @if( string.IsNullOrEmpty( GetString("DwContent(dwcontentcta)") ) == false ) { 1321 <aside id="dwcontentcta" class="js-e-cta e-cta is-hidden fixed-top"> 1322 <section class="e-section"> 1323 <div class="container-fluid"> 1324 <div class="row no-gutters"> 1325 <div class="col-12"> 1326 <div class="row no-gutters justify-content-center align-items-center"> 1327 @GetValue("DwContent(dwcontentcta)") 1328 @* <p><a class="d-flex align-items-center justify-content-center justify-content-lg-left text-black text-decoration-none small" href="/bliv-ringet-op"><i class="material-icons material-icons-large text-primary mr-1">phone</i>Bliv ringet op</a></p> *@ 1329 </div> 1330 </div> 1331 </div> 1332 </div> 1333 </section> 1334 </aside> 1335 } 13361337 @using Dynamicweb.Frontend 13381339 @{ 1340 string cartUrl = "/cart"; 13411342 if ( PageView.Current().Area.Name.Contains( "webshop" ) == false ) 1343 { 1344 cartUrl = string.Format("{0}{1}", PageView.Current().Area.Name, cartUrl); 1345 } 1346 else 1347 { 1348 cartUrl = string.Format("{0}/shop{1}", PageView.Current().Area.Name.ToLower(), cartUrl); 1349 } 13501351 var ShopType = PageView.Current().Area.Item["ShopType"]; 1352 } 1353 <div class="e-cart-msg modal fade small" id="js-e-cart-msg" data-backdrop="false"> 1354 <div class="modal-dialog e-cart-msg-modal-dialog"> 1355 <div class="modal-content"> 1356 <div class="modal-header"> 1357 <h4 class="js-e-cart-msg-heading modal-title"> 1358 <i class="material-icons material-icons-large text-success">check_circle</i> 1359 <span>@Translate( "eCom Cart - Product Added - Heading", "Added to your cart" )</span> 1360 </h4> 1361 <button class="close" data-dismiss="modal" type="button"> 1362 <i class="material-icons">close</i> 1363 </button> 1364 </div> 1365 <div class="modal-body"> 1366 <div class="js-e-cart-msg-content"> 1367 <script id="js-e-handlebars-tmpl-cart-msg-lastadded" type="text/x-handlebars-template"> 1368 <div class="row"> 1369 {{#each cart.lastAdded}} 1370 <div class="col-12 py-1"> 1371 <div class="row"> 1372 <div class="col-4"> 1373 <a class="" href="{{url}}"> 1374 <img alt="" class="img-fluid" src="{{imageDefault}}"> 1375 </a> 1376 </div> 1377 <div class="col-8"> 1378 <h3 class="mb-0"> 1379 <a href="{{url}}" class="text-decoration-none">{{name}}</a> 1380 </h3> 1381 <p class="mb-0"> 1382 <a href="{{url}}" class="text-auto text-decoration-none"> 1383 {{{price}}} 1384 @if (ShopType?.ToString() != "B2C") 1385 { 1386 <span> 1387 <br> 1388 {{{stock.text}}}<br> 1389 {{{stock.delivery}}}<br> 1390 </span> 1391 } 13921393 </a> 1394 </p> 1395 </div> 1396 </div> 1397 </div> 1398 {{/each}} 1399 </div> 1400 </script> 1401 </div> 1402 </div> 1403 <div class="bg-info e-cart-msg-footer modal-footer border-top-0"> 1404 <a class="btn btn-secondary mr-1" href="/" data-dismiss="modal">@Translate( "eCom Cart - Continue Shopping - Button", "Continue shopping" )</a> 1405 <a class="arrow-right btn btn-primary" href="@cartUrl">@Translate( "eCom Cart - Checkout - Button", "Checkout" )</a> 1406 </div> 1407 </div> 1408 </div> 1409 </div> 14101411 </div> 14121413 @using Co3.Espresso.Base.Extensions 1414 @using Co3.Espresso.Website.Services 1415 @using Dynamicweb.Frontend 14161417 <div class="modal fade e-search js-e-search js-e-search-modal modal-fullscreen" data-backdrop="false" data-keyboard="true" data-focus="true"> 1418 <div class="modal-dialog"> 1419 <div class="modal-content"> 142014211422 <div class="modal-header"> 1423 <a class="btn btn-sm btn-secondary js-e-back-link arrow-left" href="/" data-dismiss="modal"> 1424 @Translate("Search - Back button", "Back") 1425 </a> 1426 <div class="e-logo"> 1427 <a href="/" class="e-logo-link my-0"> 1428 <img src="@logoPrimary" class="e-logo-img e-logo-img-primary" alt="@Espresso.Area.Item.CompanyName"> 1429 <img src="@logoSecondary" class="e-logo-img e-logo-img-secondary" alt="@Espresso.Area.Item.CompanyName"> 1430 </a> 1431 </div> 1432 </div> 14331434 <div class="modal-body"> 14351436 <div class="container-fluid"> 14371438 <div class="e-search-form-container"> 1439 <div class="row justify-content-center"> 1440 <div class="col-12 col-md-10 col-lg-8 col-xl-6 mt-3"> 1441 <form action="" class="e-search-form js-e-search-form"> 1442 <div class="js-e-search-input-group e-search-input-group is-empty"> 1443 <label class="e-search-label" for="e-search-input"><i class="material-icons">search</i></label> 1444 @{ string Translate_Search_InputText = Translate("Search - Input Placeholder - Text", "Search"); } 1445 <input type="text" class="js-e-search-input e-search-input form-control-plaintext border-0" name="q" id="e-search-input" placeholder="@Translate_Search_InputText"> 1446 <span class="js-e-search-clear e-search-clear"><i class="material-icons">close</i></span> 1447 <button class="e-search-submit btn btn-primary" type="submit"><i class="material-icons">search</i></button> 1448 </div> 1449 </form> 1450 </div> 1451 </div> 1452 </div> 14531454 <div class="js-e-search-result-container e-search-result-container"> 14551456 <div class="row justify-content-center"> 1457 <div class="col-12 col-md-10 col-lg-8 col-xl-6"> 1458 <p class="e-search-result-info small text-muted mt-1 mb-3"><span class="js-e-search-result-count">0</span> @Translate("Search - Result Count - Text", "results")</p> 1459 </div> 1460 </div> 14611462 <div class="row justify-content-center"> 1463 <div class="col-12 col-xl-10"> 1464 <div class="js-e-search-result-products e-search-result-products is-empty mb-4"> 1465 @{string productlistItemClassList = ProductlistService.Instance.GetGridItemWidth(null).ToResponsiveClasses();} 1466 <script id="js-e-handlebars-tmpl-search-result-item-product" type="text/x-handlebars-template"> 1467 <div class="e-products"> 1468 <div class="row justify-content-center"> 1469 {{#each products}} 1470 <div class="@productlistItemClassList"> 1471 <div class="card border-1 mb-6"> 1472 <a href="{{url}}"> 1473 @if (Espresso.Item.ModelProductlist == "True") 1474 { 1475 <img src="{{productlistDetailImage}}" alt="{{name}}" class="col-12 p-0"> 1476 } 1477 else 1478 { 1479 <img src="{{imageDefault}}" alt="{{name}}" class="col-12 p-0"> 1480 } 1481 {{#if news}} 1482 <div class="isabella-product-item-news"> 1483 @Translate("Ecom Product - News Badge - Text", "Nyhed") 1484 </div> 1485 {{/if}} 1486 </a> 1487 <div class="card-body p-1 p-lg-3"> 1488 <h4 class="e-products-item-name mb-0"> 1489 <a href="{{url}}"> 1490 {{{name}}} 1491 </a> 1492 </h4> 1493 {{#if shortDescription}} 1494 {{{shortDescription}}} 1495 {{/if}} 1496 @* @if (PageView.Current().Area.Name.Contains("webshop") != false) 1497 { 1498 <p class="e-products-item-text mt-2 mb-0 @Co3.Isabella.Dw.Services.ProductService.Instance.GetNoBuyB2CandB2B()" style="display: flex"> 1499 <small class="e-products-item-price small"> 1500 <a href="{{url}}" class="text-dark" style="text-decoration: none"> 1501 {{#if pimActive}}{{{price}}}{{else}}@Translate("eCom Product - Add To Cart Form Table - Accessory Discontinued - Text", "Udgået"){{/if}} 1502 </a> 1503 </small> 1504 <a href="{{url}}" style="left: 0" class="isabella-arrow arrow-primary-small ml-auto"></a> 1505 </p> 1506 } 1507 *@ 1508 </div> 1509 </div> 1510 </div> 1511 {{/each}} 1512 </div> 1513 <p class="js-e-search-products-show-all text-center"><a href="" class="btn btn-secondary px-6">@Translate("Search - View All Products - Button", "View All Products")</a></p> 1514 </div> 1515 </script> 1516 </div> 1517 </div> 1518 </div> 15191520 <div class="row justify-content-center"> 1521 <div class="col-12 col-md-10 col-lg-8 col-xl-6"> 1522 <div class="js-e-search-result-pages e-search-result-pages is-empty mb-3"> 1523 <script id="js-e-handlebars-tmpl-search-result-item-page" type="text/x-handlebars-template"> 1524 <div class="row"> 1525 {{#each pages}} 1526 <div class="col-12"> 1527 <p class="mb-0"><a href="{{{url}}}" class="text-bold">{{{title}}}</a></p> 1528 <p class="mb-0 small text-truncate"> 1529 <a href="{{{url}}}" class="text-auto text-muted text-decoration-none"><span class="d-none d-sm-inline">@HttpContext.Current.Request.Url.Host</span>{{{url}}}</a></p> 1530 <p class="small">{{{text}}}...</p> 1531 </div> 1532 {{/each}} 1533 </div> 1534 </script> 1535 </div> 1536 </div> 1537 </div> 15381539 <div class="js-e-search-loading-overlay e-loading-overlay e-search-loading-overlay"> 1540 <div class="e-loading-spinner"></div> 1541 </div> 15421543 </div> 15441545 </div> 1546 </div> 1547 </div> 1548 </div> 1549 </div> 15501551 @if( Espresso.Area.Item.BackToTopLink == "True" ){ 1552 <a href="#top" class="e-back-to-top js-e-back-to-top"><i class="material-icons">keyboard_arrow_up</i></a> 1553 } 155415551556 @* @using System.Web; 1557 @inherits Co3.Espresso.Website.TemplateBases.Pages.PageBase 15581559 @{ 1560 HttpCookie optInLevel = HttpContext.Current.Request.Cookies[ "Dynamicweb.CookieOptInLevel" ]; 1561 bool showCookieWarning = optInLevel == null; 1562 if ( optInLevel != null ) 1563 { 1564 showCookieWarning = optInLevel.Value != "2"; 1565 } 1566 } 15671568 @if ( showCookieWarning ) 1569 { 1570 <div class="e-cookie js-e-cookie py-1" hidden=""> 1571 <aside class="e-cookie-wrapper"> 1572 <section class="e-section"> 1573 <div class="container-fluid"> 1574 <div class="align-items-center row"> 1575 <div class="col-12 col-lg-10 col-md-9 my-1"> 1576 <p class="line-height-sm mb-0 small text-center text-md-left"> 1577 <span class="d-md-inline d-none"> 1578 @Translate( "Cookie Warning - Message Long - Text", "This website uses cookies to provide necessary site functionality and improve your experience. By using our website, you agree to our" ) 1579 </span> 1580 <span class="d-md-none"> 1581 @Translate( "Cookie Warning - Message Short - Text", "This website uses cookies to improve your experience. Learn more about our" ) 1582 </span> 1583 &nbsp; 1584 <a href="@Espresso.Area.Item.CookieMessage">@Translate( "Cookie Warning - Policy - Link", "cookie policy" )</a> 1585 </p> 1586 </div> 1587 <div class="col-12 col-lg-2 col-md-3 my-1"> 1588 <p class="mb-0 text-center text-md-right"> 1589 <button class="btn e-cookie-accept-btn js-e-cookie-accept-btn" type="button"> 1590 @Translate( "Cookie Warning - Accept - Button", "OKAY" ) 1591 </button> 1592 </p> 1593 </div> 1594 </div> 1595 </div> 1596 </section> 1597 </aside> 1598 </div> 1599 } 16001601 @if ( 1 == 2 ) 1602 { 1603 @GetValue( "DwCookieWarning" ) 1604 } 16051606 *@ 16071608 <script data-cookieconsent="ignore" async="" src="/Files/Templates/Designs/isabella/_assets/_dist/js/default.js?v=3.1.4"></script> 1609 <script> 16101611 window.dataLayer.push({ 1612 'event':'ipEvent', 1613 'ipAddress' : '@Dynamicweb.Context.Current.Request.UserHostAddress' 1614 }); 1615 </script> 1616 </body> 16171618 @GetValue( "CopyRightNotice" ) 1619 </html> 1620