Branding Stylesheet || ProductId : PROD313 VariantId :

pdp - offerte

Product detail configuration page

Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetName.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_15d72cdcd2c44353bb3b20e9a12b3fb2.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetName.cshtml:line 15
   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 Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 3 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 5 6 @{ 7 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 8 9 ProductDetailWidgetName _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetName", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetName>() ?? new ProductDetailWidgetName(); 10 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj) Dynamicweb.Context.Current.Session["ProductAndVariants"]; 11 } 12 13 <div id="@paragraphID" class="pdp__ProductName @_data.CssClass"> 14 <h1 class="pdp-header__title"> 15 @if (_data.DisplayManufacturer && ProductAndVariants.Manufacturer != null) 16 { 17 <span class="pdp-header__manufacturer">@ProductAndVariants.Manufacturer.Name</span> 18 } 19 <span class="pdp-header__productname">@ProductAndVariants.ProductInfo.Name</span> 20 </h1> 21 </div> 22 23 <style> 24 25 .pdp__ProductName .pdp-header__productname { 26 color: var(--Color); 27 @_data.FontConfigurationProductName.InlineStyles 28 } 29 30 </style> 31
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetImages.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_e9d4e0ddbdfe4224870ed90eebae62b4.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetImages.cshtml:line 21
   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 Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Ecommerce.ProductCatalog; 3 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 5 @using System.Text.RegularExpressions; 6 7 8 @{ 9 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 10 ProductDetailWidgetImages _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetImages", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetImages>() ?? new ProductDetailWidgetImages(); 11 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj) Dynamicweb.Context.Current.Session["ProductAndVariants"]; 12 13 ProductViewModel product = new ProductViewModel(); 14 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 15 { 16 product = (ProductViewModel) Dynamicweb.Context.Current.Items["ProductDetails"]; 17 } 18 19 List<FieldOptionValueViewModel> productRibbons = null; 20 21 if (product.ProductFields["ProductRibbon"] != null) 22 { 23 productRibbons = (List<FieldOptionValueViewModel>)product.ProductFields["ProductRibbon"].Value; 24 } 25 26 //ProductObj ProductObj = (ProductObj)HttpContext.Current.Session["ProductDetails"]; 27 28 //ProductDetailObj DefaultProduct = ProductObj.Default[0]; 29 30 //ProductInfoObj DefaultProductInfo = DefaultProduct.ProductInfo; 31 32 //List<ProductAssetsObj> Assets = DefaultProduct.ProductImages.ProductAssets; 33 34 bool displayRibbon = _data.DisplayRibbon; 35 bool displayManufacturerLogo = _data.DisplayManufacturerLogo; 36 37 string videoUrl = ProductAndVariants?.ProductDetail?.YoutubeProductVideo ?? ""; 38 string videoId = ""; 39 string origin = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 40 41 if (!string.IsNullOrWhiteSpace(videoUrl)) 42 { 43 // regex for https://youtu.be/{videoid} 44 Regex regex = new Regex(@".be\/(.[^?]*)"); 45 Match match = regex.Match(videoUrl); 46 if (match.Success) 47 { 48 videoId = match.Groups[1].Value; 49 } 50 51 // regex for https://www.youtube.com/watch?v={videoid} 52 regex = new Regex(@"v=([^&]+)"); 53 match = regex.Match(videoUrl); 54 if (match.Success) 55 { 56 videoId = match.Groups[1].Value; 57 } 58 } 59 } 60 61 <div id="@paragraphID" class="pdp-paragraph w-full @_data.CssClass"> 62 63 @if (!string.IsNullOrWhiteSpace(ProductAndVariants.ProductDetail.ProductRibbon) && displayRibbon) 64 { 65 <p class="product-detailpage__ribbon product-detailpage__ribbon--big"><span>@ProductAndVariants.ProductDetail.ProductRibbon</span></p> 66 } 67 68 <section class="product-detailpage__images pdp__images-container"> 69 <section class="productimages pdp__images"> 70 71 <section class="productimages__wrapper"> 72 73 <div class="productimages__carousel-big hidden"> 74 75 <div class="productimages__item"> 76 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@ProductAndVariants.Images.Default&Format=webp&Quality=-1&width=800&height=800" alt="@ProductAndVariants.Images.Default" height="800" width="800" /> 77 </div> 78 79 @if (ProductAndVariants.Images.AssetImages != null) 80 { 81 foreach (Image Image in ProductAndVariants.Images.AssetImages) 82 { 83 <div class="productimages__item"> 84 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@Image.Value&Format=webp&Quality=-1&width=800&height=800" alt="@Image.Value" /> 85 </div> 86 } 87 88 } 89 90 @if (!string.IsNullOrWhiteSpace(videoId)) 91 { 92 <div class="productimages__item"> 93 <div class="productimages__carousel__video-container"> 94 <lite-youtube 95 videoid="@videoId" 96 params="controls=1&loop=0&playlist=@videoId&playsinline=1&modestbranding=1&mute=0&rel=0&enablejsapi=1&origin=@origin&disablekb=0"> 97 </lite-youtube> 98 </div> 99 </div> 100 } 101 102 </div> 103 </section> 104 105 <div class="productimages__carousel-thumbnails hidden"> 106 107 <div class="productimages__thumbnail"> 108 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@ProductAndVariants.Images.Default&Format=webp&Quality=-1&width=100&height=100" alt="@ProductAndVariants.Images.Default" height="100" width="100" /> 109 </div> 110 111 @if (ProductAndVariants.Images.AssetImages != null) 112 { 113 foreach (Image Thumb in ProductAndVariants.Images.AssetImages) 114 { 115 <div class="productimages__thumbnail"> 116 <img class="product-image" src="/Admin/Public/GetImage.ashx?Image=@Thumb.Value&Crop=7&Format=webp&Quality=90&Compression=80&width=100&height=100" alt="Thumbnail @Thumb.Value" width="100" height="100" /> 117 </div> 118 } 119 } 120 121 @if(!string.IsNullOrWhiteSpace(videoId)) 122 { 123 <div class="productimages__thumbnail productimages__thumbnail--video pin-t mr-4" aria-hidden="true"> 124 <img class="h-full" src="https://img.youtube.com/vi/@videoId/0.jpg" alt="Video preview" height="84" width="84"> 125 <span class="video-icon"> 126 <i class="fas fa-play"></i> 127 </span> 128 </div> 129 } 130 </div> 131 132 <section class="productimages__wrapper"> 133 @if (displayManufacturerLogo && ProductAndVariants.Manufacturer != null && ProductAndVariants.Manufacturer.Logo != "") 134 { 135 <img src="/Admin/Public/GetImage.ashx?Image=/Files/@ProductAndVariants.Manufacturer.Logo&Crop=7&Format=webp&Quality=90&Compression=80&width=150" class="manufacturer__logo" alt="Manufacturer" width="150" height="50" /> 136 } 137 </section> 138 139 </section> 140 </section> 141 </div> 142 143 <style> 144 .productimages__item { 145 height: 400px; 146 } 147 </style> 148
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetProductUsps.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_757e4199392c4fb7bb4206df036cecf8.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductUsps.cshtml:line 13
   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 Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 3 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 5 6 @{ 7 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 8 ProductDetailWidgetProductUsps _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetProductUsps", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetProductUsps>() ?? new ProductDetailWidgetProductUsps(); 9 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 10 string uspIcon = _data.USPIcon; 11 12 var productUsps = new List<String>(); 13 if (ProductAndVariants.USP != null && !string.IsNullOrWhiteSpace(ProductAndVariants.USP.USP1)) { productUsps.Add(ProductAndVariants.USP.USP1.ToString()); } 14 if (ProductAndVariants.USP != null && !string.IsNullOrWhiteSpace(ProductAndVariants.USP.USP2)) { productUsps.Add(ProductAndVariants.USP.USP2); } 15 if (ProductAndVariants.USP != null && !string.IsNullOrWhiteSpace(ProductAndVariants.USP.USP3)) { productUsps.Add(ProductAndVariants.USP.USP3); } 16 if (ProductAndVariants.USP != null && !string.IsNullOrWhiteSpace(ProductAndVariants.USP.USP4)) { productUsps.Add(ProductAndVariants.USP.USP4); } 17 if (ProductAndVariants.USP != null && !string.IsNullOrWhiteSpace(ProductAndVariants.USP.USP5)) { productUsps.Add(ProductAndVariants.USP.USP5); } 18 19 /* 20 21 ProductViewModel product = new ProductViewModel(); 22 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 23 { 24 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 25 } 26 27 var productUsps = new List<String>(); 28 29 if (product.ProductFields != null && product.ProductFields.ContainsKey("ProductUSP1")) 30 { 31 productUsps.Add(product.ProductFields["ProductUSP1"].Value.ToString()); 32 } 33 if (product.ProductFields != null && product.ProductFields.ContainsKey("ProductUSP2")) 34 { 35 productUsps.Add(product.ProductFields["ProductUSP2"].Value.ToString()); 36 } 37 if (product.ProductFields != null && product.ProductFields.ContainsKey("ProductUSP3")) 38 { 39 productUsps.Add(product.ProductFields["ProductUSP3"].Value.ToString()); 40 } 41 if (product.ProductFields != null && product.ProductFields.ContainsKey("ProductUSP4")) 42 { 43 productUsps.Add(product.ProductFields["ProductUSP4"].Value.ToString()); 44 } 45 if (product.ProductFields != null && product.ProductFields.ContainsKey("ProductUSP5")) 46 { 47 productUsps.Add(product.ProductFields["ProductUSP5"].Value.ToString()); 48 } 49 50 */ 51 52 } 53 54 <div id="@paragraphID" class="pdp-paragraph @_data.CssClass"> 55 56 <ul class="pdp-usplist"> 57 @foreach (string usp in productUsps) 58 { 59 if (!string.IsNullOrWhiteSpace(usp)) 60 { 61 <li class="pdp-usplist__item"> 62 @if (!string.IsNullOrWhiteSpace(uspIcon)) 63 { 64 <i class="pdp-usplist__uspicon @uspIcon"></i> 65 } 66 <span>@usp</span> 67 </li> 68 } 69 } 70 </ul> 71 72 </div> 73
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetShortDescription.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_ccb628cdf8d14e5aaed289f4ba090e1d.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetShortDescription.cshtml:line 12
   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 Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 3 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 4 5 @{ 6 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 7 8 ProductDetailWidgetShortDescription _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetShortDescription", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetShortDescription>() ?? new ProductDetailWidgetShortDescription(); 9 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj) Dynamicweb.Context.Current.Session["ProductAndVariants"]; 10 11 string readMoreTarget = _data.ButtonTarget; 12 string shortDescription = ProductAndVariants.ProductInfo.ShortDescription; 13 } 14 15 <div id="@paragraphID" class="pdp-paragraph pdp-paragraph-short-description ProductShortDescription"> 16 @if(!string.IsNullOrWhiteSpace(shortDescription)) 17 { 18 <p class="pdp-header__productname">@shortDescription</p> 19 if(!string.IsNullOrWhiteSpace(readMoreTarget)) 20 { 21 <a href="@readMoreTarget" class="btn default-btn" target="_self"> 22 <span class="btn__text">@Translate("Productdetail.Readmore", "Read more")</span> 23 <i class="btn__icon fa-chevron-right"></i> 24 </a> 25 } 26 } 27 </div> 28
Benötigen Sie professionellen Rat?

Fragen Sie einen unserer Spezialisten.

Tel.: +31 (0)72 540 66 99

E-mail: info@koks.com

 

Rufen Sie mich zurück
  • Productinformatie
  • Specificaties
  • Reviews
  • Accessoires
  • Andere uitvoeringen
  • Opties
  • Voordelen
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetLongDescription.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_40ddb05f1ffb4a3db7cc35e459a8b5eb.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetLongDescription.cshtml:line 41
   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 Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 3 @using Dynamicweb; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Configuration.AdvancedGrid.Elements; 5 6 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 7 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 8 9 @{ 10 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 11 12 ProductDetailWidgetLongDescription _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetLongDescription", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetLongDescription>() ?? new ProductDetailWidgetLongDescription(); 13 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 14 15 bool IsNotContentManager = false; 16 bool isVisualEditor = Pageview.IsVisualEditorMode; 17 18 if (isVisualEditor) 19 { 20 System.Web.HttpContext.Current.Session["PreviousPage"] = Pageview.Page.ID; 21 IsNotContentManager = (Dynamicweb.Security.UserManagement.User.GetCurrentBackendUser()?.Groups?.All(g => g.Name != "Content managers") ?? true); 22 } 23 24 if (ProductAndVariants != null && ProductAndVariants.ProductInfo != null && ProductAndVariants.ProductInfo.LongDescription != null) 25 { 26 27 <div id="@paragraphID" class="ProductLongDescription @_data.CssClass"> 28 <div class="ProductLongDescription__header">@Translate("ProductDetailWidget.LongDescription.Header", "Productinformatie")</div> 29 30 <p>@ProductAndVariants.ProductInfo.LongDescription</p> 31 </div> 32 33 <style> 34 @_data.FontConfigurationProductName.InlineStyles 35 </style> 36 37 } 38 else 39 { 40 41 <script>console.dir(@ProductAndVariants.Template.Json)</script> 42 43 <placeholder id="@paragraphID" class="ProductLongDescription @_data.CssClass"></placeholder> 44 45 if (_data.HideTabWhenEmpty) 46 { 47 <script> 48 49 document.addEventListener('DOMContentLoaded', function () { 50 51 var Element = document.getElementById("@paragraphID"); 52 console.dir(Element); 53 var parentElement = Element.closest('.content-tab'); 54 console.dir(parentElement); 55 var TabElement = document.querySelector('[data-tab-target=' + parentElement.id + ']'); 56 console.dir(TabElement); 57 58 @{ 59 if (isVisualEditor && IsNotContentManager) 60 { 61 <text>TabElement.style.display = 'flex';</text> 62 } 63 else 64 { 65 <text>TabElement.style.display = 'none';</text> 66 } 67 } 68 69 }); 70 71 </script> 72 } 73 74 } 75 76 } 77
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetDownloadProductsheet.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_6ee29e6c5d51400ab45d4b4bee6c29e4.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetDownloadProductsheet.cshtml:line 12
   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 Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 3 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 5 6 @{ 7 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 8 ProductDetailWidgetDownloadProductsheet _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetDownloadProductsheet", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetDownloadProductsheet>() ?? new ProductDetailWidgetDownloadProductsheet(); 9 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 10 } 11 12 @if (!string.IsNullOrWhiteSpace(ProductAndVariants.ProductDetail.DownloadProductsheet)) 13 { 14 15 <nav id="@paragraphID" class="cta-paragraph__btn-navigation @_data.CssClass"> 16 <a href="/Files/Images/@ProductAndVariants.ProductDetail.DownloadProductsheet" class="btn default-btn btn--@paragraphID" target="_blank"> 17 <i class="btn__icon fa-download cta-paragraph__btn-icon"></i> 18 <span class="btn__text cta-paragraph__btn cta-paragraph__btn-label">@_data.Label</span> 19 </a> 20 </nav> 21 22 } 23
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetVideo.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_2bec8427bd7e4a4ea0a2fddbe26215ed.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetVideo.cshtml:line 12
   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 Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 3 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Configuration.EcomConfiguration.ProductDetail.Widgets; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 5 @using System.Text.RegularExpressions; 6 7 @{ 8 var paragraphID = Pageview.CurrentParagraph.ID; 9 ProductDetailWidgetVideo _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetVideo", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetVideo>() ?? new ProductDetailWidgetVideo(); 10 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 11 12 string videoUrl = ProductAndVariants.ProductDetail == null ? null : ProductAndVariants.ProductDetail.YoutubeProductVideo; 13 string videoId = ""; 14 string origin = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 15 16 } 17 18 <div id="@paragraphID" class="pdp-paragraph w-full @_data.CssClass"> 19 @{ 20 if (!string.IsNullOrWhiteSpace(videoUrl)) 21 { 22 // Regex for https://youtu.be/{videoId} 23 Match match = new Regex(@".be\/(.[^?]*)").Match(videoUrl); 24 if (match.Success) 25 { 26 videoId = match.Groups[1].Value; 27 28 <div class="product-video"> 29 <iframe loading="lazy" data-video="@videoId" frameborder="0" allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" src="https://www.youtube-nocookie.com/embed/@videoId?autoplay=0&controls=1&loop=0&playlist=@videoId&playsinline=1&modestbranding=0o&mute=1&rel=0&enablejsapi=1&origin=@origin&disablekb=1"></iframe> 30 </div> 31 } 32 33 // Regex for https://www.youtube.com/watch?v={videoId} 34 match = new Regex(@"v=([^&]+)").Match(videoUrl); 35 if (match.Success) 36 { 37 videoId = match.Groups[1].Value; 38 39 <div class="product-video"> 40 <iframe loading="lazy" data-video="@videoId" frameborder="0" allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" src="https://www.youtube-nocookie.com/embed/@videoId?autoplay=0&controls=1&loop=0&playlist=@videoId&playsinline=1&modestbranding=0o&mute=1&rel=0&enablejsapi=1&origin=@origin&disablekb=1"></iframe> 41 </div> 42 } 43 44 // Regex for https://player.vimeo.com/video/{videoId} 45 match = new Regex("(?:http:|https:|)\\/\\/(?:player.|www.)?vimeo\\.com\\/(?:video\\/|embed\\/|watch\\?\\S*v=|v\\/)?(\\d*)", RegexOptions.IgnoreCase).Match(videoUrl); 46 if (match.Success) 47 { 48 videoId = match.Groups[1].Value; 49 50 <div class="product-video"> 51 <iframe loading="lazy" data-video="@videoId" frameborder="0" allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="Vimeo video player" src="https://player.vimeo.com/video/@videoId?title=0&byline=0&portrait=0&autoplay=0&controls=1&loop=0&muted=1"></iframe> 52 </div> 53 } 54 55 if (string.IsNullOrWhiteSpace(videoId)) 56 { 57 <div class="product-video"> 58 <iframe loading="lazy" data-video="@videoUrl" frameborder="0" allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" src="https://www.youtube-nocookie.com/embed/@videoUrl?autoplay=0&controls=1&loop=0&playlist=@videoUrl&playsinline=1&modestbranding=0o&mute=1&rel=0&enablejsapi=1&origin=@origin&disablekb=1"></iframe> 59 </div> 60 } 61 } 62 } 63 </div> 64 65 <style> 66 .product-video iframe { 67 aspect-ratio: 16 / 9; 68 width: 50%; 69 height: auto; 70 min-width: 325px; 71 } 72 </style> 73 74 @{ 75 76 } 77
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetVideo.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_2bec8427bd7e4a4ea0a2fddbe26215ed.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetVideo.cshtml:line 12
   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 Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 3 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Configuration.EcomConfiguration.ProductDetail.Widgets; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 5 @using System.Text.RegularExpressions; 6 7 @{ 8 var paragraphID = Pageview.CurrentParagraph.ID; 9 ProductDetailWidgetVideo _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetVideo", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetVideo>() ?? new ProductDetailWidgetVideo(); 10 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 11 12 string videoUrl = ProductAndVariants.ProductDetail == null ? null : ProductAndVariants.ProductDetail.YoutubeProductVideo; 13 string videoId = ""; 14 string origin = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 15 16 } 17 18 <div id="@paragraphID" class="pdp-paragraph w-full @_data.CssClass"> 19 @{ 20 if (!string.IsNullOrWhiteSpace(videoUrl)) 21 { 22 // Regex for https://youtu.be/{videoId} 23 Match match = new Regex(@".be\/(.[^?]*)").Match(videoUrl); 24 if (match.Success) 25 { 26 videoId = match.Groups[1].Value; 27 28 <div class="product-video"> 29 <iframe loading="lazy" data-video="@videoId" frameborder="0" allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" src="https://www.youtube-nocookie.com/embed/@videoId?autoplay=0&controls=1&loop=0&playlist=@videoId&playsinline=1&modestbranding=0o&mute=1&rel=0&enablejsapi=1&origin=@origin&disablekb=1"></iframe> 30 </div> 31 } 32 33 // Regex for https://www.youtube.com/watch?v={videoId} 34 match = new Regex(@"v=([^&]+)").Match(videoUrl); 35 if (match.Success) 36 { 37 videoId = match.Groups[1].Value; 38 39 <div class="product-video"> 40 <iframe loading="lazy" data-video="@videoId" frameborder="0" allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" src="https://www.youtube-nocookie.com/embed/@videoId?autoplay=0&controls=1&loop=0&playlist=@videoId&playsinline=1&modestbranding=0o&mute=1&rel=0&enablejsapi=1&origin=@origin&disablekb=1"></iframe> 41 </div> 42 } 43 44 // Regex for https://player.vimeo.com/video/{videoId} 45 match = new Regex("(?:http:|https:|)\\/\\/(?:player.|www.)?vimeo\\.com\\/(?:video\\/|embed\\/|watch\\?\\S*v=|v\\/)?(\\d*)", RegexOptions.IgnoreCase).Match(videoUrl); 46 if (match.Success) 47 { 48 videoId = match.Groups[1].Value; 49 50 <div class="product-video"> 51 <iframe loading="lazy" data-video="@videoId" frameborder="0" allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="Vimeo video player" src="https://player.vimeo.com/video/@videoId?title=0&byline=0&portrait=0&autoplay=0&controls=1&loop=0&muted=1"></iframe> 52 </div> 53 } 54 55 if (string.IsNullOrWhiteSpace(videoId)) 56 { 57 <div class="product-video"> 58 <iframe loading="lazy" data-video="@videoUrl" frameborder="0" allowfullscreen allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" src="https://www.youtube-nocookie.com/embed/@videoUrl?autoplay=0&controls=1&loop=0&playlist=@videoUrl&playsinline=1&modestbranding=0o&mute=1&rel=0&enablejsapi=1&origin=@origin&disablekb=1"></iframe> 59 </div> 60 } 61 } 62 } 63 </div> 64 65 <style> 66 .product-video iframe { 67 aspect-ratio: 16 / 9; 68 width: 50%; 69 height: auto; 70 min-width: 325px; 71 } 72 </style> 73 74 @{ 75 76 } 77

Vereinbaren Sie einen Beratungstermin mit einem unserer Spezialisten

 Lassen Sie sich von einem Spezialisten beraten
 Lernen Sie uns und unsere Produkte kennen
 Finden Sie heraus, welche Lösung am besten zu Ihnen passt

Reviews

5 / 5 (2 reviews)
5 / 5

Test

5 / 5