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_686afc05c1de408e910561e4e64a6f1c.Execute() in C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetImages.cshtml:line 56 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 @using System.Text.RegularExpressions; 6 7 @using Dynamicweb.Content.Items; 8 @using Dynamicweb.Content.Items.Annotations; 9 @using Dynamicweb.Content.Items.Activation; 10 @using Dynamicweb.Content.Items.Editors; 11 @using Dynamicweb.Content.Items.Metadata; 12 @using System.Collections.Generic; 13 @using System.Linq; 14 @using Bluedesk.DynamicWeb.ItemTypes.Extensions; 15 @using Dynamicweb.Ecommerce.ProductCatalog; 16 17 @{ 18 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 19 ProductDetailWidgetImages _data = Dynamicweb.Content.Services.Items.GetItem("ProductDetailWidgetImages", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetImages>() ?? new ProductDetailWidgetImages(); 20 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 21 22 ProductViewModel product = new ProductViewModel(); 23 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 24 { 25 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 26 } 27 28 bool displayRibbon = _data.DisplayRibbon; 29 bool displayManufacturerLogo = _data.DisplayManufacturerLogo; 30 31 string videoUrl = ProductAndVariants?.ProductDetail?.YoutubeProductVideo ?? ""; 32 string videoId = ""; 33 string origin = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 34 35 if (!string.IsNullOrWhiteSpace(videoUrl)) 36 { 37 // regex for https://youtu.be/{videoid} 38 Regex regex = new Regex(@".be\/(.[^?]*)"); 39 Match match = regex.Match(videoUrl); 40 if (match.Success) 41 { 42 videoId = match.Groups[1].Value; 43 } 44 45 // regex for https://www.youtube.com/watch?v={videoid} 46 regex = new Regex(@"v=([^&]+)"); 47 match = regex.Match(videoUrl); 48 if (match.Success) 49 { 50 videoId = match.Groups[1].Value; 51 } 52 } 53 54 var prod = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, product.VariantId, Pageview.Area.EcomLanguageId); 55 string defaultImage = Dynamicweb.Ecommerce.Services.ProductImages.GetImagePath(prod); 56 var imageLoop = ProductAndVariants.Images?.AssetImages?.Where(x => x.Value != defaultImage).ToList() ?? new List<Image>(); 57 bool hasMultipleImages = imageLoop.Count > 0; 58 } 59 60 <div id="@paragraphID" class="pdp-paragraph w-full @_data.CssClass"> 61 62 <section class="product-detailpage__images pdp__images-container"> 63 <section class="productimages pdp__images"> 64 65 @if (!string.IsNullOrWhiteSpace(defaultImage)) 66 { 67 string colorCode = "color:" + _data.ColorPaginationArrows.GetColorCode(Pageview.AreaID) ?? "transparent"; 68 string displayThumbnails = _data.DisplayThumbnails == false ? "display: none;" : ""; 69 string productRibbon = ProductAndVariants?.ProductDetail?.ProductRibbon ?? ""; 70 71 <section class="productimages__wrapper"> 72 73 @if (displayManufacturerLogo && ProductAndVariants.Manufacturer != null && ProductAndVariants.Manufacturer.Logo != "") 74 { 75 <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" /> 76 } 77 78 @if (!string.IsNullOrWhiteSpace(productRibbon) && displayRibbon) 79 { 80 <p class="product-detailpage__ribbon product-detailpage__ribbon--big"><span>@productRibbon</span></p> 81 } 82 83 <div class="swiper product-swiper" thumbs-swiper=".thumbnails-swiper"> 84 <div class="swiper-wrapper"> 85 <div class="swiper-slide"> 86 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@defaultImage&Format=webp&Quality=-1&width=800&height=800" alt="@product.Name" height="800" width="800" /> 87 </div> 88 89 @if(hasMultipleImages) 90 { 91 foreach (Image Image in imageLoop) 92 { 93 <div class="swiper-slide"> 94 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@Image.Value&Format=webp&Quality=-1&width=800&height=800" alt="@product.Name" /> 95 </div> 96 } 97 } 98 99 @if (!string.IsNullOrWhiteSpace(videoId)) 100 { 101 <div class="swiper-slide"> 102 <div> 103 <lite-youtube videoid="@videoId" params="controls=1&loop=0&playlist=@videoId&playsinline=1&modestbranding=1&mute=0&rel=0&enablejsapi=1&origin=@origin&disablekb=0"></lite-youtube> 104 </div> 105 </div> 106 } 107 </div> 108 109 @if (_data.DisplayPaginationDots) 110 { 111 <div class="swiper-pagination"></div> 112 } 113 114 @if (_data.DisplayImageArrows) 115 { 116 <div class="swiper-button-prev" style="@colorCode"></div> 117 <div class="swiper-button-next" style="@colorCode"></div> 118 } 119 </div> 120 121 </section> 122 123 if (_data.ThumbnailQuantity == 0) 124 { 125 _data.ThumbnailQuantity = 3; 126 } 127 128 if(hasMultipleImages || !string.IsNullOrWhiteSpace(videoId)) 129 { 130 <div class="swiper thumbnails-swiper" style="@displayThumbnails" data-previewnumber="@_data.ThumbnailQuantity"> 131 <div class="swiper-wrapper"> 132 @if (_data.ThumbnailWidth == 0) 133 { 134 _data.ThumbnailWidth = 200; 135 } 136 @if (_data.ThumbnailHeight == 0) 137 { 138 _data.ThumbnailHeight = 200; 139 } 140 141 <div class="swiper-slide"> 142 <img class="product-image" src="/Admin/Public/GetImage.ashx?Image=@defaultImage&Format=webp&Quality=-1&width=@_data.ThumbnailWidth&height=@_data.ThumbnailHeight" alt="@product.Name" height="@_data.ThumbnailHeight" width="@_data.ThumbnailWidth" /> 143 </div> 144 145 146 @if(hasMultipleImages) 147 { 148 foreach (Image Thumb in imageLoop) 149 { 150 <div class="swiper-slide"> 151 <img class="product-image" src="/Admin/Public/GetImage.ashx?Image=@Thumb.Value&Crop=7&Format=webp&Quality=90&Compression=80&width=@_data.ThumbnailWidth&height=@_data.ThumbnailHeight" alt="Thumbnail @product.Name" width="@_data.ThumbnailWidth" height="@_data.ThumbnailHeight" /> 152 </div> 153 } 154 } 155 156 @if (!string.IsNullOrWhiteSpace(videoId)) 157 { 158 string thumbnailWidth = "width:" + _data.ThumbnailWidth + "px;"; 159 string thumbnailHeight = "height:" + _data.ThumbnailHeight + "px;"; 160 string iconPositionWidth = "left:" + (_data.ThumbnailWidth / 2 - 12).ToString() + "px;"; 161 string iconPositionHeight = "top:" + (_data.ThumbnailHeight / 2 - 12).ToString() + "px;"; 162 163 <div class="swiper-slide"> 164 <div class="productimages__thumbnail productimages__thumbnail--video" style="@thumbnailWidth @thumbnailHeight"> 165 <img class="h-full" src="https://i.ytimg.com/vi_webp/@videoId/hqdefault.webp" alt="Video preview @ProductAndVariants.ProductInfo.Name" /> 166 <span class="video-icon" style="@iconPositionWidth @iconPositionHeight"> 167 <i class="fas fa-play"></i> 168 </span> 169 </div> 170 </div> 171 } 172 173 </div> 174 175 @if (_data.DisplayThumbnailArrows) 176 { 177 <div class="swiper-button-prev" style="@colorCode"></div> 178 <div class="swiper-button-next" style="@colorCode"></div> 179 } 180 </div> 181 } 182 } 183 </section> 184 </section> 185 </div> 186 187
Article number: 6395-1006-001-N1912
Color
Size
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_686afc05c1de408e910561e4e64a6f1c.Execute() in C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetImages.cshtml:line 56 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 @using System.Text.RegularExpressions; 6 7 @using Dynamicweb.Content.Items; 8 @using Dynamicweb.Content.Items.Annotations; 9 @using Dynamicweb.Content.Items.Activation; 10 @using Dynamicweb.Content.Items.Editors; 11 @using Dynamicweb.Content.Items.Metadata; 12 @using System.Collections.Generic; 13 @using System.Linq; 14 @using Bluedesk.DynamicWeb.ItemTypes.Extensions; 15 @using Dynamicweb.Ecommerce.ProductCatalog; 16 17 @{ 18 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 19 ProductDetailWidgetImages _data = Dynamicweb.Content.Services.Items.GetItem("ProductDetailWidgetImages", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetImages>() ?? new ProductDetailWidgetImages(); 20 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj)Dynamicweb.Context.Current.Session["ProductAndVariants"]; 21 22 ProductViewModel product = new ProductViewModel(); 23 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 24 { 25 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 26 } 27 28 bool displayRibbon = _data.DisplayRibbon; 29 bool displayManufacturerLogo = _data.DisplayManufacturerLogo; 30 31 string videoUrl = ProductAndVariants?.ProductDetail?.YoutubeProductVideo ?? ""; 32 string videoId = ""; 33 string origin = Dynamicweb.Environment.Helpers.LinkHelper.GetHttpDomain(); 34 35 if (!string.IsNullOrWhiteSpace(videoUrl)) 36 { 37 // regex for https://youtu.be/{videoid} 38 Regex regex = new Regex(@".be\/(.[^?]*)"); 39 Match match = regex.Match(videoUrl); 40 if (match.Success) 41 { 42 videoId = match.Groups[1].Value; 43 } 44 45 // regex for https://www.youtube.com/watch?v={videoid} 46 regex = new Regex(@"v=([^&]+)"); 47 match = regex.Match(videoUrl); 48 if (match.Success) 49 { 50 videoId = match.Groups[1].Value; 51 } 52 } 53 54 var prod = Dynamicweb.Ecommerce.Services.Products.GetProductById(product.Id, product.VariantId, Pageview.Area.EcomLanguageId); 55 string defaultImage = Dynamicweb.Ecommerce.Services.ProductImages.GetImagePath(prod); 56 var imageLoop = ProductAndVariants.Images?.AssetImages?.Where(x => x.Value != defaultImage).ToList() ?? new List<Image>(); 57 bool hasMultipleImages = imageLoop.Count > 0; 58 } 59 60 <div id="@paragraphID" class="pdp-paragraph w-full @_data.CssClass"> 61 62 <section class="product-detailpage__images pdp__images-container"> 63 <section class="productimages pdp__images"> 64 65 @if (!string.IsNullOrWhiteSpace(defaultImage)) 66 { 67 string colorCode = "color:" + _data.ColorPaginationArrows.GetColorCode(Pageview.AreaID) ?? "transparent"; 68 string displayThumbnails = _data.DisplayThumbnails == false ? "display: none;" : ""; 69 string productRibbon = ProductAndVariants?.ProductDetail?.ProductRibbon ?? ""; 70 71 <section class="productimages__wrapper"> 72 73 @if (displayManufacturerLogo && ProductAndVariants.Manufacturer != null && ProductAndVariants.Manufacturer.Logo != "") 74 { 75 <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" /> 76 } 77 78 @if (!string.IsNullOrWhiteSpace(productRibbon) && displayRibbon) 79 { 80 <p class="product-detailpage__ribbon product-detailpage__ribbon--big"><span>@productRibbon</span></p> 81 } 82 83 <div class="swiper product-swiper" thumbs-swiper=".thumbnails-swiper"> 84 <div class="swiper-wrapper"> 85 <div class="swiper-slide"> 86 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@defaultImage&Format=webp&Quality=-1&width=800&height=800" alt="@product.Name" height="800" width="800" /> 87 </div> 88 89 @if(hasMultipleImages) 90 { 91 foreach (Image Image in imageLoop) 92 { 93 <div class="swiper-slide"> 94 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=@Image.Value&Format=webp&Quality=-1&width=800&height=800" alt="@product.Name" /> 95 </div> 96 } 97 } 98 99 @if (!string.IsNullOrWhiteSpace(videoId)) 100 { 101 <div class="swiper-slide"> 102 <div> 103 <lite-youtube videoid="@videoId" params="controls=1&loop=0&playlist=@videoId&playsinline=1&modestbranding=1&mute=0&rel=0&enablejsapi=1&origin=@origin&disablekb=0"></lite-youtube> 104 </div> 105 </div> 106 } 107 </div> 108 109 @if (_data.DisplayPaginationDots) 110 { 111 <div class="swiper-pagination"></div> 112 } 113 114 @if (_data.DisplayImageArrows) 115 { 116 <div class="swiper-button-prev" style="@colorCode"></div> 117 <div class="swiper-button-next" style="@colorCode"></div> 118 } 119 </div> 120 121 </section> 122 123 if (_data.ThumbnailQuantity == 0) 124 { 125 _data.ThumbnailQuantity = 3; 126 } 127 128 if(hasMultipleImages || !string.IsNullOrWhiteSpace(videoId)) 129 { 130 <div class="swiper thumbnails-swiper" style="@displayThumbnails" data-previewnumber="@_data.ThumbnailQuantity"> 131 <div class="swiper-wrapper"> 132 @if (_data.ThumbnailWidth == 0) 133 { 134 _data.ThumbnailWidth = 200; 135 } 136 @if (_data.ThumbnailHeight == 0) 137 { 138 _data.ThumbnailHeight = 200; 139 } 140 141 <div class="swiper-slide"> 142 <img class="product-image" src="/Admin/Public/GetImage.ashx?Image=@defaultImage&Format=webp&Quality=-1&width=@_data.ThumbnailWidth&height=@_data.ThumbnailHeight" alt="@product.Name" height="@_data.ThumbnailHeight" width="@_data.ThumbnailWidth" /> 143 </div> 144 145 146 @if(hasMultipleImages) 147 { 148 foreach (Image Thumb in imageLoop) 149 { 150 <div class="swiper-slide"> 151 <img class="product-image" src="/Admin/Public/GetImage.ashx?Image=@Thumb.Value&Crop=7&Format=webp&Quality=90&Compression=80&width=@_data.ThumbnailWidth&height=@_data.ThumbnailHeight" alt="Thumbnail @product.Name" width="@_data.ThumbnailWidth" height="@_data.ThumbnailHeight" /> 152 </div> 153 } 154 } 155 156 @if (!string.IsNullOrWhiteSpace(videoId)) 157 { 158 string thumbnailWidth = "width:" + _data.ThumbnailWidth + "px;"; 159 string thumbnailHeight = "height:" + _data.ThumbnailHeight + "px;"; 160 string iconPositionWidth = "left:" + (_data.ThumbnailWidth / 2 - 12).ToString() + "px;"; 161 string iconPositionHeight = "top:" + (_data.ThumbnailHeight / 2 - 12).ToString() + "px;"; 162 163 <div class="swiper-slide"> 164 <div class="productimages__thumbnail productimages__thumbnail--video" style="@thumbnailWidth @thumbnailHeight"> 165 <img class="h-full" src="https://i.ytimg.com/vi_webp/@videoId/hqdefault.webp" alt="Video preview @ProductAndVariants.ProductInfo.Name" /> 166 <span class="video-icon" style="@iconPositionWidth @iconPositionHeight"> 167 <i class="fas fa-play"></i> 168 </span> 169 </div> 170 </div> 171 } 172 173 </div> 174 175 @if (_data.DisplayThumbnailArrows) 176 { 177 <div class="swiper-button-prev" style="@colorCode"></div> 178 <div class="swiper-button-next" style="@colorCode"></div> 179 } 180 </div> 181 } 182 } 183 </section> 184 </section> 185 </div> 186 187
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque consequat est sed nunc vulputate, ac venenatis mauris faucibus. Nulla sollicitudin nisi varius, sollicitudin tellus vel, ultricies elit. Nunc malesuada sagittis ante, vel blandit odio bibendum sit amet. Aliquam erat volutpat. In eros tellus, gravida sed erat eu, dignissim semper urna. Aenean vulputate tempor fringilla. Suspendisse molestie dictum enim eu dapibus. Mauris id lorem convallis, dictum nibh at, maximus odio. Duis sem arcu, sollicitudin a fermentum ac, elementum aliquet augue. Morbi eget nunc magna. Vivamus lacus nunc, laoreet at venenatis et, rhoncus et est. Duis aliquam condimentum lorem, at convallis massa rhoncus at.
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_e946ce2fffd54fd4a99a20d84aeaef44.Execute() in C:\home\site\wwwroot\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.Content.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
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque consequat est sed nunc vulputate, ac venenatis mauris faucibus. Nulla sollicitudin nisi varius, sollicitudin tellus vel, ultricies elit. Nunc malesuada sagittis ante, vel blandit odio bibendum sit amet. Aliquam erat volutpat. In eros tellus, gravida sed erat eu, dignissim semper urna. Aenean vulputate tempor fringilla. Suspendisse molestie dictum enim eu dapibus. Mauris id lorem convallis, dictum nibh at, maximus odio. Duis sem arcu, sollicitudin a fermentum ac, elementum aliquet augue. Morbi eget nunc magna. Vivamus lacus nunc, laoreet at venenatis et, rhoncus et est. Duis aliquam condimentum lorem, at convallis massa rhoncus at.
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_e946ce2fffd54fd4a99a20d84aeaef44.Execute() in C:\home\site\wwwroot\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.Content.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
Error compiling template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetProductCarousel.cshtml" Line 61: The type or namespace name 'ProductDetailWidgetProductCarousel' could not be found (are you missing a using directive or an assembly reference?) Line 61: 'Services' is obsolete: 'Use Dynamicweb.Content.Services instead.' Line 61: 'Services.Items' is obsolete: 'Use Dynamicweb.Content.Services.Items instead.' Line 61: The type or namespace name 'ProductDetailWidgetProductCarousel' could not be found (are you missing a using directive or an assembly reference?) Line 61: The type or namespace name 'ProductDetailWidgetProductCarousel' could not be found (are you missing a using directive or an assembly reference?)Template file not found (in RenderRazorTemplate()): C:\home\site\wwwroot\files\Templates\Paragraph\ProductDetailWidgetRelatedProductsBasic.cshtml
1 //------------------------------------------------------------------------------ 2 // <auto-generated> 3 // This code was generated by a tool. 4 // Runtime Version:4.0.30319.42000 5 // 6 // Changes to this file may cause incorrect behavior and will be lost if 7 // the code is regenerated. 8 // </auto-generated> 9 //------------------------------------------------------------------------------ 10 11 namespace CompiledRazorTemplates.Dynamic { 12 using System; 13 using System.Collections.Generic; 14 using System.Linq; 15 16 #line 3 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 17 using Dynamicweb.Ecommerce.ProductCatalog; 18 19 #line default 20 #line hidden 21 22 #line 4 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 23 using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 24 25 #line default 26 #line hidden 27 28 #line 5 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 29 using Dynamicweb.Ecommerce.Extensibility.Provider; 30 31 #line default 32 #line hidden 33 34 #line 6 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 35 using Dynamicweb.Ecommerce.Products; 36 37 #line default 38 #line hidden 39 40 #line 7 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 41 using Dynamicweb.Ecommerce.Specialized.RelatedProductListProviders; 42 43 #line default 44 #line hidden 45 46 47 public class RazorEngine_377c6524291a4d96a7f83866b90b8c2a : Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> { 48 49 #line hidden 50 51 public RazorEngine_377c6524291a4d96a7f83866b90b8c2a() { 52 } 53 54 public override void Execute() { 55 WriteLiteral("\r\n"); 56 57 58 #line 9 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 59 60 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 61 ProductDetailWidgetProductCarousel _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetProductCarousel", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetProductCarousel>() ?? new ProductDetailWidgetProductCarousel(); 62 63 ProductViewModel product = new ProductViewModel(); 64 if (Dynamicweb.Context.Current.Items.Contains("ProductDetails")) 65 { 66 product = (ProductViewModel)Dynamicweb.Context.Current.Items["ProductDetails"]; 67 } 68 69 string urlParams = ""; 70 string groupOption = _data.GroupOption; 71 IList<string> relatedProductIds = new List<string> { }; 72 urlParams += "&SortOrder=DESC"; 73 urlParams += $"&PageSize={_data.ProductAmount}"; 74 75 if(groupOption == "popular") 76 { 77 urlParams += "&SortBy=OrderCountGrowth"; 78 } 79 80 if(groupOption == "most-sold") 81 { 82 urlParams += "&SortBy=OrderCount"; 83 } 84 85 if(groupOption == "recently-viewed") 86 { 87 List<Product> YouHaveSeenTheseProductsList = new YouHaveSeenTheseProductsList().GetCollection(new RelatedProductListProviderEventArgs()).Reverse().Take(_data.ProductAmount).ToList(); 88 if(YouHaveSeenTheseProductsList.Any()) 89 { 90 foreach (Product recentProduct in YouHaveSeenTheseProductsList) 91 { 92 relatedProductIds.Add(recentProduct.Id); 93 } 94 string productIds = string.Join(",", relatedProductIds); 95 urlParams += !string.IsNullOrEmpty(productIds) ? "&ProductIDs=" + productIds : ""; 96 } 97 } 98 99 if(groupOption == "related" && product.RelatedGroups != null) 100 { 101 var relatedGroup = product.RelatedGroups.Where(g => g.Id == _data.RelatedGroupID).First(); 102 foreach (var relatedProduct in relatedGroup.Products) 103 { 104 relatedProductIds.Add(relatedProduct.ProductId); 105 } 106 string productIds = string.Join(",", relatedProductIds); 107 urlParams += !string.IsNullOrEmpty(productIds) ? "&ProductIDs=" + productIds : ""; 108 } 109 110 string link = "/Default.aspx?ID=1718&LayoutTemplate=VisualEditorPageAPI.cshtml" + urlParams; 111 string relatedGroupName = _data.Header; 112 113 114 115 #line default 116 #line hidden 117 WriteLiteral("\r\n\r\n<div"); 118 119 WriteAttribute("id", Tuple.Create(" id=\"", 2387), Tuple.Create("\"", 2404) 120 121 #line 65 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 122 , Tuple.Create(Tuple.Create("", 2392), Tuple.Create<System.Object, System.Int32>(paragraphID 123 124 #line default 125 #line hidden 126 , 2392), false) 127 ); 128 129 WriteAttribute("class", Tuple.Create(" class=\"", 2405), Tuple.Create("\"", 2454) 130 , Tuple.Create(Tuple.Create("", 2413), Tuple.Create("pdp-paragraph", 2413), true) 131 , Tuple.Create(Tuple.Create(" ", 2426), Tuple.Create("pdp-paragraph__", 2427), true) 132 133 #line 65 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 134 , Tuple.Create(Tuple.Create("", 2442), Tuple.Create<System.Object, System.Int32>(paragraphID 135 136 #line default 137 #line hidden 138 , 2442), false) 139 ); 140 141 WriteLiteral(">\r\n\t<section"); 142 143 WriteLiteral(" class=\"products-module__container\""); 144 145 WriteLiteral(">\r\n\t\t<div"); 146 147 WriteLiteral(" class=\"container\""); 148 149 WriteLiteral(">\r\n\t\t\t\r\n"); 150 151 152 #line 69 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 153 154 155 #line default 156 #line hidden 157 158 #line 69 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 159 if(!string.IsNullOrWhiteSpace(relatedGroupName)) 160 { 161 162 163 #line default 164 #line hidden 165 WriteLiteral("\t\t\t\t<header"); 166 167 WriteLiteral(" class=\"products-module__header\""); 168 169 WriteLiteral(">\r\n\t\t\t\t\t<h2"); 170 171 WriteLiteral(" class=\"products-module__title\""); 172 173 WriteLiteral(">"); 174 175 176 #line 72 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 177 Write(relatedGroupName); 178 179 180 #line default 181 #line hidden 182 WriteLiteral("</h2>\r\n\t\t\t\t</header>\r\n"); 183 184 185 #line 74 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 186 } 187 188 189 #line default 190 #line hidden 191 WriteLiteral("\r\n\t\t\t<div"); 192 193 WriteLiteral(" class=\"product-carousel\""); 194 195 WriteLiteral(" data-url=\""); 196 197 198 #line 76 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 199 Write(link); 200 201 202 #line default 203 #line hidden 204 WriteLiteral("\""); 205 206 WriteLiteral(" data-id=\""); 207 208 209 #line 76 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 210 Write(paragraphID); 211 212 213 #line default 214 #line hidden 215 WriteLiteral("\""); 216 217 WriteLiteral("></div>\r\n\t\t\r\n\t\t</div>\r\n\t</section>\r\n</div>\r\n\r\n<script"); 218 219 WriteLiteral(" type=\"module\""); 220 221 WriteLiteral(" src=\"https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js\""); 222 223 WriteLiteral("></script>\r\n<script"); 224 225 WriteLiteral(" type=\"module\""); 226 227 WriteLiteral(">\r\n\r\n\tdocument.addEventListener(\'initCarousel__"); 228 229 230 #line 85 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 231 Write(paragraphID); 232 233 234 #line default 235 #line hidden 236 WriteLiteral("\', function () {\r\n\t\tvar carousel = document.querySelector(\".pdp-paragraph__"); 237 238 239 #line 86 "C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductCarousel.cshtml" 240 Write(paragraphID); 241 242 243 #line default 244 #line hidden 245 WriteLiteral(" .products-module__container--carousel\");\r\n\r\n\t\tif(carousel) {\r\n\t\t\tvar flkty = new" + 246 " Flickity(carousel, {\r\n\t\t\t\tcellAlign: \'left\',\r\n\t\t\t\tcontain: true,\r\n\t\t\t\tpageDots:" + 247 " false\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n\r\n</script>\r\n"); 248 249 } 250 } 251 } 252
1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 3 @using Dynamicweb.Ecommerce.ProductCatalog; 4 @using Bluedesk.DynamicWeb.ItemTypes.BaseSolution; 5 @using Dynamicweb.Ecommerce.Extensibility.Provider; 6 @using Dynamicweb.Ecommerce.Products; 7 @using Dynamicweb.Ecommerce.Specialized.RelatedProductListProviders; 8 9 @{ 10 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 11 ProductDetailWidgetProductCarousel _data = Dynamicweb.Services.Items.GetItem("ProductDetailWidgetProductCarousel", Model.ItemId).ToCodeFirstItem<ProductDetailWidgetProductCarousel>() ?? new ProductDetailWidgetProductCarousel(); 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 string urlParams = ""; 20 string groupOption = _data.GroupOption; 21 IList<string> relatedProductIds = new List<string> { }; 22 urlParams += "&SortOrder=DESC"; 23 urlParams += $"&PageSize={_data.ProductAmount}"; 24 25 if(groupOption == "popular") 26 { 27 urlParams += "&SortBy=OrderCountGrowth"; 28 } 29 30 if(groupOption == "most-sold") 31 { 32 urlParams += "&SortBy=OrderCount"; 33 } 34 35 if(groupOption == "recently-viewed") 36 { 37 List<Product> YouHaveSeenTheseProductsList = new YouHaveSeenTheseProductsList().GetCollection(new RelatedProductListProviderEventArgs()).Reverse().Take(_data.ProductAmount).ToList(); 38 if(YouHaveSeenTheseProductsList.Any()) 39 { 40 foreach (Product recentProduct in YouHaveSeenTheseProductsList) 41 { 42 relatedProductIds.Add(recentProduct.Id); 43 } 44 string productIds = string.Join(",", relatedProductIds); 45 urlParams += !string.IsNullOrEmpty(productIds) ? "&ProductIDs=" + productIds : ""; 46 } 47 } 48 49 if(groupOption == "related" && product.RelatedGroups != null) 50 { 51 var relatedGroup = product.RelatedGroups.Where(g => g.Id == _data.RelatedGroupID).First(); 52 foreach (var relatedProduct in relatedGroup.Products) 53 { 54 relatedProductIds.Add(relatedProduct.ProductId); 55 } 56 string productIds = string.Join(",", relatedProductIds); 57 urlParams += !string.IsNullOrEmpty(productIds) ? "&ProductIDs=" + productIds : ""; 58 } 59 60 string link = "/Default.aspx?ID=1718&LayoutTemplate=VisualEditorPageAPI.cshtml" + urlParams; 61 string relatedGroupName = _data.Header; 62 63 } 64 65 <div id="@paragraphID" class="pdp-paragraph pdp-paragraph__@paragraphID"> 66 <section class="products-module__container"> 67 <div class="container"> 68 69 @if(!string.IsNullOrWhiteSpace(relatedGroupName)) 70 { 71 <header class="products-module__header"> 72 <h2 class="products-module__title">@relatedGroupName</h2> 73 </header> 74 } 75 76 <div class="product-carousel" data-url="@link" data-id="@paragraphID"></div> 77 78 </div> 79 </section> 80 </div> 81 82 <script type="module" src="https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js"></script> 83 <script type="module"> 84 85 document.addEventListener('initCarousel__@paragraphID', function () { 86 var carousel = document.querySelector(".pdp-paragraph__@paragraphID .products-module__container--carousel"); 87 88 if(carousel) { 89 var flkty = new Flickity(carousel, { 90 cellAlign: 'left', 91 contain: true, 92 pageDots: false 93 }); 94 } 95 }); 96 97 </script> 98
Article number: 6395-1006-001-N1912
Color
Size
Nieuwe serie Polaris Elements kralen in 4 en 6 mm met glanzende of matte coating. Verwerk de kralen in een trendy armband of in statement oorbellen. Door de kralen op dun artistic wire te wikkelen om dikker om dikker artistic wire, ontwerp je stijlvolle oorbellen!
Nieuwe serie Polaris Elements kralen in 4 en 6 mm met glanzende of matte coating. Verwerk de kralen in een trendy armband of in statement oorbellen. Door de kralen op dun artistic wire te wikkelen om dikker om dikker artistic wire, ontwerp je stijlvolle oorbellen!
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque consequat est sed nunc vulputate, ac venenatis mauris faucibus. Nulla sollicitudin nisi varius, sollicitudin tellus vel, ultricies elit. Nunc malesuada sagittis ante, vel blandit odio bibendum sit amet. Aliquam erat volutpat. In eros tellus, gravida sed erat eu, dignissim semper urna. Aenean vulputate tempor fringilla. Suspendisse molestie dictum enim eu dapibus. Mauris id lorem convallis, dictum nibh at, maximus odio. Duis sem arcu, sollicitudin a fermentum ac, elementum aliquet augue. Morbi eget nunc magna. Vivamus lacus nunc, laoreet at venenatis et, rhoncus et est. Duis aliquam condimentum lorem, at convallis massa rhoncus at.
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_e946ce2fffd54fd4a99a20d84aeaef44.Execute() in C:\home\site\wwwroot\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.Content.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
Heel verhaal...
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque consequat est sed nunc vulputate, ac venenatis mauris faucibus. Nulla sollicitudin nisi varius, sollicitudin tellus vel, ultricies elit. Nunc malesuada sagittis ante, vel blandit odio bibendum sit amet. Aliquam erat volutpat. In eros tellus, gravida sed erat eu, dignissim semper urna. Aenean vulputate tempor fringilla. Suspendisse molestie dictum enim eu dapibus. Mauris id lorem convallis, dictum nibh at, maximus odio. Duis sem arcu, sollicitudin a fermentum ac, elementum aliquet augue. Morbi eget nunc magna. Vivamus lacus nunc, laoreet at venenatis et, rhoncus et est. Duis aliquam condimentum lorem, at convallis massa rhoncus at.
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_e946ce2fffd54fd4a99a20d84aeaef44.Execute() in C:\home\site\wwwroot\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.Content.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
Voeg snel artikelen toe aan de winkelmand door een bestand in XSLX formaat te uploaden.
Een voorbeeldbestand download u hier: Voorbeeld bestand XSLX upload
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetVariants.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_cbb50064f8394fb7bbd42ee868ee2e15.Execute() in C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetVariants.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.Frontend; 4 5 @{ 6 int pageId = Model.PageID; 7 string paragraphID = Pageview.CurrentParagraph.ID.ToString(); 8 9 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj) Dynamicweb.Context.Current.Session["ProductAndVariants"]; 10 } 11 12 @if (ProductAndVariants.Variants != null) 13 { 14 <section class="pdp__block pdp-widget__variants"> 15 16 <article class="pdp__block-item"> 17 <header> 18 <h2>Variants</h2> 19 </header> 20 <div class="pdp__block-item-content"> 21 22 @foreach (ProductAndVariantsObj Variant in ProductAndVariants.Variants) 23 { 24 <a href="@($"default.aspx?ID={Pageview.Page.ID}&ProductID={Variant.ProductInfo.Id}&VariantID={Variant.ProductVariantId}")"> 25 <section class="pdp__block-item-content-element"> 26 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=Files/@Variant.Images.Default&Format=webp&Quality=-1&width=150&height=150" /> 27 <div>@Variant.ProductInfo.Name</div> 28 <div>@Variant.Manufacturer.Name</div> 29 </section> 30 </a> 31 } 32 </div> 33 </article> 34 35 </section> 36 } 37 38 <style> 39 .pdp__block { 40 display: flex; 41 flex-direction: row; 42 padding: 25px; 43 margin: 25px; 44 border: 1px solid #CCC; 45 } 46 47 .pdp__block-item { 48 display: flex; 49 flex-direction: column; 50 flex-grow: 0; 51 flex-basis: 25; 52 } 53 54 .pdp__block-item-content { 55 display: flex; 56 flex-direction: row; 57 flex-grow: 0; 58 flex-basis: 25; 59 } 60 61 .pdp__block-item-content-element { 62 border: 1px solid #CCC; 63 margin: 25px; 64 padding: 25px; 65 } 66 </style> 67
Error executing template "/Designs/ClientBase_generated/Paragraph/ProductDetailWidgetProductItems.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_082587bef8b94955a706fa1a40fbb807.Execute() in C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductItems.cshtml:line 10 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<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.Frontend; 4 5 @{ 6 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj) Dynamicweb.Context.Current.Session["ProductAndVariants"]; 7 } 8 9 10 @if (ProductAndVariants.Items != null) 11 { 12 13 <h2>This set includes the following products</h2> 14 <section class="pdp__product-items"> 15 16 17 @foreach (ProductAndVariantsObj ProductItem in ProductAndVariants.Items) 18 { 19 <text> 20 <div class="pdp__block"> 21 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=Files/@ProductItem.Images.Default&Format=webp&Quality=-1&width=150& height: 150px;" /><br /> 22 <ul> 23 <li>@ProductItem.ProductInfo.Name</li> 24 <li>@ProductItem.ProductInfo.Id</li> 25 <li>@ProductItem.Quantity</li> 26 </ul> 27 </div> 28 </text> 29 } 30 31 </section> 32 33 <style> 34 35 .pdp__block { 36 display: flex; 37 flex-direction: column; 38 padding: 10px; 39 margin: 10px; 40 border: 1px solid #CCC; 41 -webkit-box-shadow: 2px 2px 5px 5px rgba(0,0,0,0.2); 42 -moz-box-shadow: 2px 2px 5px 5px rgba(0,0,0,0.2); 43 box-shadow: 2px 2px 5px 5px rgba(0,0,0,0.2); 44 } 45 46 .pdp__product-items { 47 display: flex; 48 flex-direction: row; 49 flex-basis: 20%; 50 } 51 </style> 52 53 } 54
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetReplacementProduct.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_0950deb83bd540b1aa99e3bf05ed2f13.Execute() in C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetReplacementProduct.cshtml:line 8 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.Frontend; 4 5 @{ 6 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj) Dynamicweb.Context.Current.Session["ProductAndVariants"]; 7 8 if (ProductAndVariants.ReplacementProduct != null) 9 { 10 11 if (ProductAndVariants.ProductInfo.Stock <= 0) 12 { 13 ProductAndVariantsObj ReplacementProduct = ProductAndVariants.ReplacementProduct[0]; 14 15 <section class="pdp__block pdp-widget__replacementproduct"> 16 17 <article class="pdp__block-item"> 18 <header class="pdp-widget__replacementproduct-header"> 19 <h2>Replacement product</h2> 20 </header> 21 <div class="pdp__block-item-content"> 22 <a href="@($"default.aspx?ID={Pageview.Page.ID}&ProductID={ReplacementProduct.ProductInfo.Id}&VariantID={ReplacementProduct.ProductVariantId}")"> 23 <section class="pdp__block-item-content-element"> 24 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=Files/@ReplacementProduct.Images.Default&Format=webp&Quality=-1&width=150&height=150" /> 25 <div>@ReplacementProduct.ProductInfo.Name</div> 26 </section> 27 </a> 28 </div> 29 </article> 30 31 </section> 32 } 33 34 } 35 } 36 37 <style> 38 .pdp__block { 39 display: flex; 40 flex-direction: row; 41 padding: 25px; 42 margin: 25px; 43 border: 1px solid #CCC; 44 } 45 46 .pdp__block-item { 47 display: flex; 48 flex-direction: column; 49 flex-grow: 0; 50 flex-basis: 25; 51 } 52 53 .pdp__block-item-content { 54 display: flex; 55 flex-direction: row; 56 flex-grow: 0; 57 flex-basis: 25; 58 } 59 60 .pdp__block-item-content-element { 61 border: 1px solid #CCC; 62 margin: 25px; 63 padding: 25px; 64 } 65 </style> 66
Lorem ipsum dolor sit amet, consectetur adipiscing elit. In tincidunt mauris elit, eget iaculis risus egestas eget. Etiam iaculis vehicula tortor ut viverra. Mauris venenatis lectus diam, eget ultricies arcu volutpat at. Suspendisse ac dolor varius, consectetur nisl id, tristique ipsum. Maecenas sed nunc in sapien posuere semper.
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_e946ce2fffd54fd4a99a20d84aeaef44.Execute() in C:\home\site\wwwroot\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.Content.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
Article number: 6395-1006-001-N1912
Color
Size
Error executing template "Designs/ClientBase_generated/Paragraph/ProductDetailWidgetProductItems.cshtml" System.NullReferenceException: Object reference not set to an instance of an object. at CompiledRazorTemplates.Dynamic.RazorEngine_082587bef8b94955a706fa1a40fbb807.Execute() in C:\home\site\wwwroot\files\Templates\Designs\ClientBase_generated\Paragraph\ProductDetailWidgetProductItems.cshtml:line 10 at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context, TextWriter reader) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<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.Frontend; 4 5 @{ 6 ProductAndVariantsObj ProductAndVariants = (ProductAndVariantsObj) Dynamicweb.Context.Current.Session["ProductAndVariants"]; 7 } 8 9 10 @if (ProductAndVariants.Items != null) 11 { 12 13 <h2>This set includes the following products</h2> 14 <section class="pdp__product-items"> 15 16 17 @foreach (ProductAndVariantsObj ProductItem in ProductAndVariants.Items) 18 { 19 <text> 20 <div class="pdp__block"> 21 <img class="w-auto" src="/Admin/Public/GetImage.ashx?Image=Files/@ProductItem.Images.Default&Format=webp&Quality=-1&width=150& height: 150px;" /><br /> 22 <ul> 23 <li>@ProductItem.ProductInfo.Name</li> 24 <li>@ProductItem.ProductInfo.Id</li> 25 <li>@ProductItem.Quantity</li> 26 </ul> 27 </div> 28 </text> 29 } 30 31 </section> 32 33 <style> 34 35 .pdp__block { 36 display: flex; 37 flex-direction: column; 38 padding: 10px; 39 margin: 10px; 40 border: 1px solid #CCC; 41 -webkit-box-shadow: 2px 2px 5px 5px rgba(0,0,0,0.2); 42 -moz-box-shadow: 2px 2px 5px 5px rgba(0,0,0,0.2); 43 box-shadow: 2px 2px 5px 5px rgba(0,0,0,0.2); 44 } 45 46 .pdp__product-items { 47 display: flex; 48 flex-direction: row; 49 flex-basis: 20%; 50 } 51 </style> 52 53 } 54
Voor 12:00 uur besteld, morgen in huis
Select your variant
SEO Suite 5 Inch tests
6395-1006-001-N1912
SEO Suite 5 Inch tests
6395-1006-001-N1912
SEO Suite 5 Inch tests
6395-1006-001-N1912