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_59bbfbf1e2e647aaac62eb4b930596fa.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_672bf76d46e24ee49388959a4d109b2f.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetImages.cshtml:line 20
   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.Ecommerce.ProductCatalog; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 5 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 6 7 @{ 8 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 9 ProductDetailWidgetImages _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetImages", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetImages>() ?? new ProductDetailWidgetImages(); 10 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj) Dynamicweb.Context.Current.Session["ProductAndVariants"]; 11 12 ProductViewModel product = new ProductViewModel(); 13 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 14 { 15 product = (ProductViewModel) Dynamicweb.Context.Current.Items["ProductDetails"]; 16 } 17 18 List<FieldOptionValueViewModel> productRibbons = null; 19 20 if (product != null && product.ProductFields["ProductRibbon"] != null) 21 { 22 productRibbons = (List<FieldOptionValueViewModel>)product.ProductFields["ProductRibbon"].Value; 23 } 24 25 //ProductObj ProductObj = (ProductObj)HttpContext.Current.Session["ProductDetails"]; 26 27 //ProductDetailObj DefaultProduct = ProductObj.Default[0]; 28 29 //ProductInfoObj DefaultProductInfo = DefaultProduct.ProductInfo; 30 31 //List<ProductAssetsObj> Assets = DefaultProduct.ProductImages.ProductAssets; 32 33 bool displayRibbon = _data.DisplayRibbon; 34 bool displayManufacturerLogo = _data.DisplayManufacturerLogo; 35 } 36 37 <div id="@paragraphID" class="pdp-paragraph w-full @_data.CssClass"> 38 39 @if (!string.IsNullOrWhiteSpace(ProductAndVariants.ProductDetail.ProductRibbon) && displayRibbon) 40 { 41 <p class="product-detailpage__ribbon product-detailpage__ribbon--big"><span>@ProductAndVariants.ProductDetail.ProductRibbon</span></p> 42 } 43 44 <section class="product-detailpage__images pdp__images-container"> 45 <section class="productimages pdp__images"> 46 47 <section class="productimages__wrapper"> 48 49 <div class="productimages__carousel-big hidden"> 50 51 <div class="productimages__item"> 52 <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" /> 53 </div> 54 55 @if (ProductAndVariants.Images.AssetImages != null) 56 { 57 foreach (Image Image in ProductAndVariants.Images.AssetImages) 58 { 59 <div class="productimages__item"> 60 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@Image.Value&Format=webp&Quality=-1&width=800&height=800" alt="@Image.Value" /> 61 </div> 62 } 63 64 } 65 @if (!string.IsNullOrWhiteSpace(ProductAndVariants.ProductDetail.YoutubeProductVideo)) 66 { 67 68 string YoutubeProductVideo = ProductAndVariants.ProductDetail.YoutubeProductVideo; 69 70 <div class="productimages__item"> 71 <div class="productimages__carousel__video-container"> 72 <lite-youtube videoid="@YoutubeProductVideo" params="controls=1&loop=0&playlist=@YoutubeProductVideo&playsinline=1&modestbranding=1&mute=0&rel=0&enablejsapi=1& origin=@Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain()&disablekb=0"></lite-youtube> 73 </div> 74 </div> 75 76 } 77 78 </div> 79 80 </section> 81 82 <div class="productimages__carousel-thumbnails hidden"> 83 84 <div class="productimages__thumbnail"> 85 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@ProductAndVariants.Images.Default&Crop=7&Format=webp&Quality=-1&width=160&height=100" alt="@ProductAndVariants.Images.Default" height="100" width="100" /> 86 </div> 87 88 @if (ProductAndVariants.Images.AssetImages != null) 89 { 90 91 foreach (Image Thumb in ProductAndVariants.Images.AssetImages) 92 { 93 <div class="productimages__thumbnail"> 94 <img class="product-image" src="/Admin/Public/GetImage.ashx?Image=@Thumb.Value&Crop=7&Format=webp&Quality=90&Compression=80&width=160&height=100" alt="Thumbnail @Thumb.Value" width="100" height="100" /> 95 </div> 96 } 97 } 98 99 <div class="productimages__thumbnail productimages__thumbnail--video pin-t mr-4" aria-hidden="true" style="position: absolute; left: 0px; transform: translateX(232%);"> 100 <img class="h-full" src="https://img.youtube.com/vi/@ProductAndVariants.ProductDetail.YoutubeProductVideo/0.jpg" alt="Video preview RIDGID K-45 AF-5 3" height="84" width="84"> 101 <span class="video-icon"> 102 <i class="fas fa-play"></i> 103 </span> 104 </div> 105 </div> 106 107 108 <section class="productimages__wrapper"> 109 110 @if (displayManufacturerLogo && ProductAndVariants.Manufacturer != null && ProductAndVariants.Manufacturer.Logo != "") 111 { 112 <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" /> 113 } 114 115 @*<div class="productimages__carousel-big hidden"> 116 @foreach (var i in product.AssetCategories) 117 { 118 foreach (var image in i.Assets) 119 { 120 <div class="productimages__item"> 121 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@image.Value&Format=webp&Quality=-1&width=800&height=800" alt="@image.Name" /> 122 </div> 123 } 124 } 125 </div>*@ 126 </section> 127 128 @*<div class="productimages__carousel-thumbnails hidden"> 129 @foreach (var i in product.AssetCategories) 130 { 131 foreach (var image in i.Assets) 132 { 133 <div class="productimages__thumbnail"> 134 <img class="product-image" src="/Admin/Public/GetImage.ashx?Image=@image.Value&Crop=7&Format=webp&Quality=90&Compression=80&width=160&height=100" alt="Thumbnail @image.Name" width="100" height="100" /> 135 </div> 136 } 137 } 138 </div>*@ 139 140 141 </section> 142 </section> 143 </div> 144 145 <style> 146 .productimages__item { 147 height: 400px; 148 } 149 </style> 150
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_c55091d2075e4ae490d8589c68c70e7e.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_ed3d2fa0e7d347e8b9560411e6e92cea.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_f250ee2e3a654ecd891acc96aabeeb4a.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/ProductDetailWidgetVideo.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_a982c9a3261f460bafefeb97345813c9.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

Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetReviews.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_b83f4aeffdd9470aa2e96520cf455ea7.Execute() in D:\dynamicweb.net\Solutions\Bluedesk\koksgroup.cloud.dynamicweb-cms.com\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetReviews.cshtml:line 34
   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.Content.Commenting; 4 @using Dynamicweb.Ecommerce.ProductCatalog; 5 6 @using Dynamicweb; 7 @using System; 8 @using Dynamicweb.Rendering 9 @using System.Collections.Generic; 10 @using Bluedesk.DynamicWeb.ItemTypes.Pages; 11 @using Bluedesk.Tools.DynamicWeb.ExtensionMethods; 12 @using System.Linq; 13 @using Dynamicweb.Content; 14 @using Dynamicweb.Ecommerce.Prices; 15 @using System.Text.RegularExpressions; 16 17 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 18 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution.Frontend; 19 20 @{ 21 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 22 ProductDetailWidgetReviews _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetReviews", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetReviews>() ?? new ProductDetailWidgetReviews(); 23 ProductAndVariantsObj _product = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 24 25 ProductViewModel product = new ProductViewModel(); 26 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 27 { 28 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 29 } 30 31 CommentCollection comments = Comment.GetComments("ecomProduct", product.Id, Pageview.Area.EcomLanguageId); 32 33 string reviewTranslationKey = Translate("Reviews.Amount.Multiple", "{0} reviews"); 34 if (_product.ProductInfo.ReviewCount == 1) 35 { 36 reviewTranslationKey = Translate("Reviews.Amount.Singular", "{0} review"); 37 } 38 39 // bool displayCommentCount = _data.DisplayCommentCount; 40 } 41 @if (_product.ProductInfo.ReviewCount > 0) { 42 43 <div id="PdpReviewModule" class="review-paragraph"> 44 <div class="container review-paragraph__container"> 45 <div class="review-paragraph__summary"> 46 47 <div class="review-summary__column"> 48 <h2 class="review-summary__title">@Translate("Reviews.Title", "Customer reviews")</h2> 49 <div class="review-summary__container"> 50 <div class="review-summary__indicator GeneralIndicator"> 51 @renderReviewIndicator("var(--BaseColorSecondary)", _product.ProductInfo.Rating, "row", true, _product.ProductInfo.ReviewCount) 52 </div> 53 </div> 54 </div> 55 56 @{ 57 if (_product.ProductInfo.CommentsAndReviews != null) 58 { 59 60 <div class="review-paragraph__comments"> 61 62 @foreach (Comments Comment in _product.ProductInfo.CommentsAndReviews) 63 { 64 <section class="review-comment__list-item"> 65 <div class="review-comment__header"> 66 <div class="review-comment__rating-wrapper"> 67 @renderReviewIndicator("var(--BaseColorContrast)", Comment.CommentRating, "row", false, 0) 68 <label class="review-comment__name">@Comment.CommentName</label> 69 </div> 70 </div> 71 <div class="review-comment__message"> 72 <p>@Comment.CommentText</p> 73 </div> 74 <p class="review-comment__meta"> 75 @if (_data.ShowCreateDate) {<text> - @Comment.CommentCreatedDate</text>} 76 </p> 77 </section> 78 } 79 80 </div> 81 82 } 83 } 84 85 @*<div class="review-summary__column"> 86 @if (Dynamicweb.Context.Current.Request["reviewcmd"] != null && Dynamicweb.Context.Current.Request["reviewcmd"] == "created") 87 { 88 <h2 class="review-summary__title">@Translate("Reviews.Submitted.Title", "Thanks for your review")</h2> 89 <p>@Translate("Reviews.Submitted.Text", "Thank you for submitting your review.")</p> 90 } 91 else 92 { 93 <h2 class="review-summary__title">@Translate("Reviews.Create.Text", "Write a review")</h2> 94 <p>@Translate("Reviews.Create.Text", "Share your thoughts about this product with other customers.")</p> 95 <div class="review-summary__btn-wrapper"> 96 <a href="#" class="btn btn__primary toggle-of-canvas-menu" data-offcanvas-target="reviewcreate"> 97 <span class="btn__text">@Translate("Reviews.Create.Button", "Write a review")</span> 98 <i class="btn__icon fal fa-plus"></i> 99 </a> 100 </div> 101 } 102 </div>*@ 103 </div> 104 105 </div> 106 </div> 107 108 } 109 110 @functions{ 111 112 public string renderReviewIndicator(string progressbarColor, float value, string flexDirection, bool boolReviews, int CommentCount) 113 { 114 115 float ratingPercentage = (100 / 5) * value; 116 string CommentCountString = boolReviews == true ? $"({CommentCount} reviews)" : ""; 117 118 string Template = $@" 119 <section style='display: flex; flex-direction: {flexDirection}; position: relative; align - items: center;'> 120 <div class='reviews__indicator' style='display: flex; flex-direction: row;'> 121 <div class='reviews__indicator-progressbar' style='width: {ratingPercentage.ToString()}%; background-color: {progressbarColor};' ></div> 122 <ul class='reviews__indicator-star-list'> 123 <li class='reviews__indicator-star-list-item'></li> 124 <li class='reviews__indicator-star-list-item'></li> 125 <li class='reviews__indicator-star-list-item'></li> 126 <li class='reviews__indicator-star-list-item'></li> 127 <li class='reviews__indicator-star-list-item'></li> 128 </ul> 129 </div> 130 <span class='CommentCountString' style='display: flex; position: relative; font-size: 12px; line-height: initial;'> 131 {value} / 5 {CommentCountString} 132 </span> 133 </section> 134 "; 135 136 return Template; 137 } 138 139 } 140