Exception in template (Designs\Plus\eCom/Productlist/Grouplist.cshtml): System.NullReferenceException: Objektreferencen er ikke indstillet til en forekomst af et objekt.
   ved CompiledRazorTemplates.Dynamic.cfcfbdffde.Execute()
   ved RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   ved RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
   ved RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
   ved RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   ved Dynamicweb.Rendering.Template.RenderRazorTemplate()
@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System.Web; @using Dynamicweb.Rendering; @using Plus.Files; @functions{ string[] facetMaterial = string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Material"]) ? null : HttpContext.Current.Request.QueryString["Material"].Split(','); string[] facetColor = string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Color"]) ? null : HttpContext.Current.Request.QueryString["Color"].Split(','); string[] facetWidth = string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Width"]) ? null : HttpContext.Current.Request.QueryString["Width"].Split(','); string[] facetHeight = string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Height"]) ? null : HttpContext.Current.Request.QueryString["Height"].Split(','); string[] facetLength = string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Length"]) ? null : HttpContext.Current.Request.QueryString["Length"].Split(','); string[] facetType = string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Type"]) ? null : HttpContext.Current.Request.QueryString["Type"].Split(','); List<string[]> facets = new List<string[]>(); } @{ Dynamicweb.Ecommerce.Products.Group group = Dynamicweb.Ecommerce.Products.Group.GetGroupById(GetString("Ecom:Group.ID")); } @if (group != null && group.IsTopGroup) { string tempSelected = ""; if (facetMaterial != null) { facets.Add(facetMaterial); tempSelected = "Material"; } if (facetColor != null) { facets.Add(facetColor); tempSelected = "Color"; } if (facetWidth != null) { facets.Add(facetWidth); tempSelected = "Width"; } if (facetHeight != null) { facets.Add(facetHeight); tempSelected = "Height"; } if (facetLength != null) { facets.Add(facetLength); tempSelected = "Length"; } if (facetType != null) { facets.Add(facetType); tempSelected = "Type"; } if (facets.Count == 1) { HttpContext.Current.Session["PrimaryFacet"] = tempSelected; } if (facets.Count == 0) { HttpContext.Current.Session["PrimaryFacet"] = ""; } string primaryFacet = HttpContext.Current.Session["PrimaryFacet"].ToString(); List<RazorTemplateBase<RazorTemplateModel<Template>>.LoopItem> productGroups = GetLoop("Childgroups").Where(g => (facetMaterial == null || (facetMaterial.Any() && g.GetString("Ecom:Group:Field.ProductMaterial").Split(',').Any(t => facetMaterial.Contains(t.ToString())))) && (facetColor == null || (facetColor.Any() && g.GetString("Ecom:Group:Field.ProductColor").Split(',').Any(t => facetColor.Contains(t.ToString())))) && (facetWidth == null || (facetWidth.Any() && g.GetString("Ecom:Group:Field.WidthCm").Split(',').Any(t => facetWidth.Contains(t.ToString())))) && (facetHeight == null || (facetHeight.Any() && g.GetString("Ecom:Group:Field.HeightCm").Split(',').Any(t => facetHeight.Contains(t.ToString())))) && (facetLength == null || (facetLength.Any() && g.GetString("Ecom:Group:Field.LengthCm").Split(',').Any(t => facetLength.Contains(t.ToString())))) && (facetType == null || (facetType.Any() && g.GetString("Ecom:Group:Field.ProductType").Split(',').Any(t => facetType.Contains(t.ToString())))) ).ToList(); //ProductColor ProductMaterial WidthCm HeightCm LengthCm var matList = string.Join(",", productGroups.Select(g => g.GetString("Ecom:Group:Field.ProductMaterial")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); if (primaryFacet == "Material") { matList = string.Join(",", GetLoop("Childgroups").Select(g => g.GetString("Ecom:Group:Field.ProductMaterial")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); } var colList = string.Join(",", productGroups.Select(g => g.GetString("Ecom:Group:Field.ProductColor")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); if (primaryFacet == "Color") { colList = string.Join(",", GetLoop("Childgroups").Select(g => g.GetString("Ecom:Group:Field.ProductColor")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); } var widthList = string.Join(",", productGroups.Select(g => g.GetString("Ecom:Group:Field.WidthCm")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); if (primaryFacet == "Width") { widthList = string.Join(",", GetLoop("Childgroups").Select(g => g.GetString("Ecom:Group:Field.WidthCm")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); } var lengthList = string.Join(",", productGroups.Select(g => g.GetString("Ecom:Group:Field.LengthCm")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); if (primaryFacet == "Length") { lengthList = string.Join(",", GetLoop("Childgroups").Select(g => g.GetString("Ecom:Group:Field.LengthCm")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); } var heightList = string.Join(",", productGroups.Select(g => g.GetString("Ecom:Group:Field.HeightCm")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); if (primaryFacet == "Height") { heightList = string.Join(",", GetLoop("Childgroups").Select(g => g.GetString("Ecom:Group:Field.HeightCm")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); } var typeList = string.Join(",", productGroups.Select(g => g.GetString("Ecom:Group:Field.ProductType")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); if (primaryFacet == "Type") { typeList = string.Join(",", GetLoop("Childgroups").Select(g => g.GetString("Ecom:Group:Field.ProductType")).Distinct()).Split(',').Where(s => !string.IsNullOrEmpty(s)).Distinct(); } int groupCount = productGroups.Count(); //Breadcrumb @RenderSnippet("breadcrumb") //Header if (!string.IsNullOrWhiteSpace(GetString("Ecom:Group:Field.groupHeader"))) { <section class="grid-page-header "> <div class="grid-container grid-container--site-width"> <div class="grid-row grid-row--two-columns "> <div class="grid-column "> <div class="grid-page-header__content"> <h1 class="heading heading--main">@GetString("Ecom:Group:Field.groupHeader")</h1> </div> </div> <div class="grid-column "> @GetString("Ecom:Group:Field.groupLongDescription") </div> </div> </div> </section> } //Filter <section class="filter-bar"> <div class="grid-container grid-container--site-width"> <div class="filter-bar__inner"> <ul class="filter-bar__list" id="filter-bar__list" data-groupid="@GetString("Ecom:Group.ID")" data-path="@Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + Pageview.Area.Item.FirstOrDefault(i => i.Key == "GroupsFilterPageId").Value.ToString())"> @if (typeList.Any()) { <li class="filter-bar__item"> <div class="filter filter--checkbox filter--default"> <div class="filter__chosen"> <span class="filter__default-header">@Translate("Vælg type", "Vælg type")</span> <span class="filter__chosen-header">@Translate("Type", "Type"): </span> <span class="filter__chosen-items"></span> </div> <div class="filter__options"> <span class="filter__close"></span> <div class="filter__options-inner"> <div class="filter__options-content"> <div class="filter__options-header">@Translate("Vælg type", "Vælg type")</div> <ul class="filter__list"> @foreach (var type in typeList) { <li class="filter__item"> <input type="checkbox" onchange="updateGroupList()" name="Type" id="Type-@type" class="filter__input" value="@type" @(facetType != null && facetType.Contains(type) ? "checked=\"checked\"" : "")> <label for="Type-@type" class="filter__label">@Translate(type, type)</label> </li> } </ul> </div> </div> </div> </div> </li> } @if(matList.Any()){ <li class="filter-bar__item"> <div class="filter filter--checkbox filter--default"> <div class="filter__chosen"> <span class="filter__default-header">@Translate("Vælg materiale", "Vælg materiale")</span> <span class="filter__chosen-header">@Translate("Materiale", "Materiale"): </span> <span class="filter__chosen-items"></span> </div> <div class="filter__options"> <span class="filter__close"></span> <div class="filter__options-inner"> <div class="filter__options-content"> <div class="filter__options-header">@Translate("Vælg materiale", "Vælg materiale")</div> <ul class="filter__list"> @foreach (var mat in matList) { <li class="filter__item"> <input type="checkbox" onchange="updateGroupList()" name="Material" id="Material-@mat" class="filter__input" value="@mat" @(facetMaterial != null && facetMaterial.Contains(mat) ? "checked=\"checked\"" : "")> <label for="Material-@mat" class="filter__label">@Translate(mat, mat)</label> </li> } </ul> </div> </div> </div> </div> </li> } @if (colList.Any()) { <li class="filter-bar__item"> <div class="filter filter--checkbox filter--default"> <div class="filter__chosen"> <span class="filter__default-header">@Translate("Vælg farve", "Vælg farve")</span> <span class="filter__chosen-header">@Translate("Farve", "Farve"): </span> <span class="filter__chosen-items"></span> </div> <div class="filter__options"> <span class="filter__close"></span> <div class="filter__options-inner"> <div class="filter__options-content"> <div class="filter__options-header">@Translate("Vælg farve", "Vælg farve")</div> <ul class="filter__list"> @foreach (var col in colList) { <li class="filter__item"> <input type="checkbox" onchange="updateGroupList()" name="Color" id="Color-@col" class="filter__input" value="@col" @(facetColor != null && facetColor.Contains(col) ? "checked=\"checked\"" : "")> <label for="Color-@col" class="filter__label">@Translate(col, col)</label> </li> } </ul> </div> </div> </div> </div> </li> } @if (widthList.Any()) { <li class="filter-bar__item"> <div class="filter filter--checkbox filter--default"> <div class="filter__chosen"> <span class="filter__default-header">@Translate("Vælg bredde", "Vælg bredde")</span> <span class="filter__chosen-header">@Translate("Bredde", "Bredde"): </span> <span class="filter__chosen-items"></span> </div> <div class="filter__options"> <span class="filter__close"></span> <div class="filter__options-inner"> <div class="filter__options-content"> <div class="filter__options-header">@Translate("Vælg bredde", "Vælg bredde")</div> <ul class="filter__list"> @foreach (var width in widthList) { <li class="filter__item"> <input type="checkbox" onchange="updateGroupList()" name="Width" id="Width-@width" class="filter__input" value="@width" @(facetWidth != null && facetWidth.Contains(width) ? "checked=\"checked\"" : "")> <label for="Width-@width" class="filter__label">@width</label> </li> } </ul> </div> </div> </div> </div> </li> } @if (heightList.Any()) { <li class="filter-bar__item"> <div class="filter filter--checkbox filter--default"> <div class="filter__chosen"> <span class="filter__default-header">@Translate("Vælg højde", "Vælg højde")</span> <span class="filter__chosen-header">@Translate("Højde", "Højde"): </span> <span class="filter__chosen-items"></span> </div> <div class="filter__options"> <span class="filter__close"></span> <div class="filter__options-inner"> <div class="filter__options-content"> <div class="filter__options-header">@Translate("Vælg højde", "Vælg højde")</div> <ul class="filter__list"> @foreach (var height in heightList) { <li class="filter__item"> <input type="checkbox" onchange="updateGroupList()" name="Height" id="Height-@height" class="filter__input" value="@height" @(facetHeight != null && facetHeight.Contains(height) ? "checked=\"checked\"" : "")> <label for="Height-@height" class="filter__label">@height</label> </li> } </ul> </div> </div> </div> </div> </li> } @if (lengthList.Any()) { <li class="filter-bar__item"> <div class="filter filter--checkbox filter--default"> <div class="filter__chosen"> <span class="filter__default-header">@Translate("Vælg længde", "Vælg længde")</span> <span class="filter__chosen-header">@Translate("Længde", "Længde"): </span> <span class="filter__chosen-items"></span> </div> <div class="filter__options"> <span class="filter__close"></span> <div class="filter__options-inner"> <div class="filter__options-content"> <div class="filter__options-header">@Translate("Vælg længde", "Vælg længde")</div> <ul class="filter__list"> @foreach (var length in lengthList) { <li class="filter__item"> <input type="checkbox" onchange="updateGroupList()" name="Length" id="Length-@length" class="filter__input" value="@length" @(facetLength != null && facetLength.Contains(length) ? "checked=\"checked\"" : "")> <label for="Length-@length" class="filter__label">@length</label> </li> } </ul> </div> </div> </div> </div> </li> } </ul> <div class="filter-bar__result-info"> <div class="filter-result-amount">@groupCount @Translate("produktserier", "produktserier")</div> </div> </div> </div> </section> //Groups list <section class="list-cards-simple list-cards-simple--3cols"> <div class="grid-container grid-container--site-width"> <ul class="grid-row grid-row--three-columns-113333 list-cards-simple__list"> @DisplayGroups(productGroups) </ul> </div> </section> } else { //Top image string topImage = GetString("Ecom:Group:Field.groupBannerImage.Clean").Replace(" ", "%20"); if (!string.IsNullOrWhiteSpace(topImage)) { <section class="full-width-banner full-width-banner--top"> <div class="full-width-banner__fallback full-width-banner__fallback--mobile"> <div class="full-width-banner__fallback-image" style="background-image: url(@topImage?mode=crop&width=767&quality=80);"></div> </div> <div class="full-width-banner__fallback full-width-banner__fallback--tablet"> <div class="full-width-banner__fallback-image" style="background-image: url(@topImage?mode=crop&width=1199&quality=80);"></div> </div> <div class="full-width-banner__fallback full-width-banner__fallback--desktop"> <div class="full-width-banner__fallback-image" style="background-image: url(@topImage?mode=crop&width=2000&quality=80);"></div> </div> <div class="full-width-banner__bg-holder"> <div class="full-width-banner__bg lazyload" data-bgset="@topImage?mode=crop&amp;width&#x3D;575&quality=80 [(max-width: 575px)] | @topImage?mode=crop&amp;width&#x3D;767&quality=80 [(max-width: 767px)] | @topImage?mode=crop&amp;width&#x3D;991&quality=80 [(max-width: 991px)] | @topImage?mode=crop&amp;width&#x3D;1199&quality=80 [(max-width: 1199px)] | @topImage?mode=crop&amp;width&#x3D;1399&quality=80 [(max-width: 1399px)] | @topImage?mode=crop&amp;width&#x3D;1599&quality=80 [(max-width: 1599x)] | @topImage?mode=crop&amp;width&#x3D;2000&quality=80" data-sizes="auto"></div> </div> <div class="grid-container grid-container--site-width-fh"> <div class="full-width-banner__content"> <div class="grid-row grid-row--two-columns"> <div class="grid-column"> @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Group:Field.groupBannerPreHeader"))) { <p class="preheading preheading--fw-banner">@GetString("Ecom:Group:Field.groupBannerPreHeader")</p> } <h1 class="heading heading--main heading--main-fw-banner-top">@GetString("Ecom:Group:Field.groupBannerHeader")</h1> <div class="body-text body-text--fw-banner-top"> <p>@GetString("Ecom:Group:Field.GroupBannerText")</p> </div> @if (GetString("Ecom:Group:Field.groupBannerButton1Link") != "") { <a href="@GetString("Ecom:Group:Field.groupBannerButton1Link")" class="button button--fw-banner"> <span class="button__text">@GetString("Ecom:Group:Field.groupBannerButton1Text")</span> </a> } @if (GetString("Ecom:Group:Field.groupBannerButton2Link") != "") { <a href="@GetString("Ecom:Group:Field.groupBannerButton2Link")" class="button button--arrow button--fw-banner"> <span class="button__text">@GetString("Ecom:Group:Field.groupBannerButton2Text")</span><span class="arrow arrow--right "></span> </a> } </div> </div> </div> </div> </section> } //Breadcrumb @RenderSnippet("breadcrumb") //Downloads if (Dynamicweb.Security.UserManagement.User.IsExtranetUserLoggedIn()) { <section class="downloads"> <div class="grid-container grid-container--site-width"> <ul class="downloads-list"> <li class="downloads-list__item"> <input type="hidden" id="productsIDs" value="@string.Join(",", group.Products.Select(p => p.Id).ToArray())" /> <label for="selectCustomFileNameTypes" class="downloads-list__label">@Translate("Hent billeder for alle produkter i gruppen (zip-fil)", "Hent billeder for alle produkter i gruppen (.zip-fil):")</label> <div class="select-custom"> <input type="checkbox" class="select-custom__check" id="selectCustomFileNameTypes" /> <label for="selectCustomFileNameTypes" class="select-custom__selected-item" title="@Translate("Vælg type af filnavn", "Vælg type af filnavn")"> <span class="select-custom__selected-item-text"> @Translate("Vælg type af filnavn", "Vælg type af filnavn") <span class="select-custom__icon"> <svg class="select-custom__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/icons/icons.svg#arrow-down"></use></svg> </span> </span> </label> <div class="select-custom__option-holder"> <ul class="link-list link-list--custom-select"> <li class="link-list__item "> <a href="#" title="@Translate("EAN nummer", "EAN nummer")" class="link--custom-select " imagetype="ean" property="url">@Translate("EAN nummer", "EAN nummer")</a> </li> <li class="link-list__item "> <a href="#" title="@Translate("DB nummer", "DB nummer")" class="link--custom-select " imagetype="db" property="url">@Translate("DB nummer", "DB nummer")</a> </li> <li class="link-list__item "> <a href="#" title="@Translate("PLUS nummer", "PLUS nummer")" class="link--custom-select "imagetype="plus" property="url">@Translate("PLUS nummer", "PLUS nummer")</a> </li> <li class="link-list__item "> <a href="#" title="@Translate("PLUS + Varenavn + vejl pris", "PLUS + Varenavn + vejl pris")" class="link--custom-select " imagetype="presse" property="url">@Translate("PLUS + Varenavn + vejl pris", "PLUS + Varenavn + vejl pris")</a> </li> </ul> </div> </div> </li> <li class="downloads-list__item"> <a href="#" title="@Translate("Hent produktinfo for alle produkter i gruppen (.xml-fil)", "Hent produktinfo for alle produkter i gruppen (.xml-fil)")" class="downloads-list__link " property="url">@Translate("Hent produktinfo for alle produkter i gruppen (.xml-fil)", "Hent produktinfo for alle produkter i gruppen (.xml-fil)")</a> </li> </ul> </div> </section> } //Gallery if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image1.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image2.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image3.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image4.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image5.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image6.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image7.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image8.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image9.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image10.Clean")) || !String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image11.Clean"))) { <section class="gallery"> <div class="grid-container grid-container--site-width"> <ul class="gallery__list" id="gallery"> @{ if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image1.Clean"))) { @DisplayGalleryImage(GetString("Ecom:Group:Field.Image1.Clean")) } if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image2.Clean"))) { @DisplayGalleryImage(GetString("Ecom:Group:Field.Image2.Clean")) } if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image3.Clean"))) { @DisplayGalleryImage(GetString("Ecom:Group:Field.Image3.Clean")) } if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image4.Clean"))) { @DisplayGalleryImage(GetString("Ecom:Group:Field.Image4.Clean")) } if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image5.Clean"))) { @DisplayGalleryImage(GetString("Ecom:Group:Field.Image5.Clean")) } if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image6.Clean"))) { @DisplayGalleryImage(GetString("Ecom:Group:Field.Image6.Clean")) } if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image7.Clean"))) { @DisplayGalleryImage(GetString("Ecom:Group:Field.Image7.Clean")) } if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image8.Clean"))) { @DisplayGalleryImage(GetString("Ecom:Group:Field.Image8.Clean")) } if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image9.Clean"))) { @DisplayGalleryImage(GetString("Ecom:Group:Field.Image9.Clean")) } if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image10.Clean"))) { @DisplayGalleryImage(GetString("Ecom:Group:Field.Image10.Clean")) } if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.Image11.Clean"))) { @DisplayGalleryImage(GetString("Ecom:Group:Field.Image11.Clean")) } } </ul> <button class="gallery__nav-button gallery__nav-button--prev"> <span class="arrow arrow--left arrow--show-always"></span> </button> <button class="gallery__nav-button gallery__nav-button--next"> <span class="arrow arrow--right arrow--show-always"></span> </button> <span class="gallery__counter-box"> <span class="gallery__counter"></span>/<span class="gallery__sum"></span> </span> </div> <div class="gallery__overlay-tags"> <ul class="gallery-overlay__list"></ul> <!-- important: arrow buttons must be above all other buttons inside gallery__overlay-tags --> <button type="button" class="button button--ghost button--ghost-thin button--large button--slideshow button--color-gray " property="url"> <span class="button__text"></span><span class="arrow arrow--left arrow--show-always"></span> </button> <button type="button" class="button button--ghost button--ghost-thin button--large button--slideshow button--color-gray " property="url"> <span class="button__text"></span><span class="arrow arrow--right arrow--show-always"></span> </button> <button class="gallery-overlay__close" type="button"> <span class="gallery-overlay__close-text">Luk (esc)</span> <span class="gallery-overlay__x"></span> </button> <span class="gallery-overlay__counter-item"> <span class="gallery-overlay__count"></span>/<span class="gallery-overlay__sum"></span> </span> </div> </section> } //Description <section class="text-text-facts"> <div class="grid-container grid-container--site-width"> <div class="grid-row grid-row--three-columns-122333 "> <div class="grid-column "> <h3 class="heading heading--fw-element">@GetString("Ecom:Group:Field.groupDescriptionHeaderColumn1")</h3> <div class="body-text "> @GetString("Ecom:Group:Field.groupDescriptionTextColumn1") </div> </div> <div class="grid-column grid-column--2"> <div class="grid-row grid-row--two-columns-111222 grid-column--2"> <div class="grid-column "> <div class="text-text-facts__small-content"> <h4 class="heading heading--small heading--small-text-col2">@GetString("Ecom:Group:Field.groupDescriptionHeaderColumn2")</h4> <div class="body-text body-text--text-col2"> @GetString("Ecom:Group:Field.groupDescriptionTextColumn2") </div> </div> </div> <div class="grid-column "> @if (!string.IsNullOrWhiteSpace(GetString("Ecom:Group:Field.groupDescriptionFactboxColumn3"))) { <div class="facts-box "> <div class="body-text body-text--facts-box"> @GetString("Ecom:Group:Field.groupDescriptionFactboxColumn3") </div> </div> } </div> </div> </div> </div> </div> </section> <section class="divider "> <span class="divider__icon"> <svg class="divider__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#logo"></use></svg> </span> </section> string productPageId = Pageview.Area.Item.FirstOrDefault(i => i.Key == "ProductPageId").Value.ToString(); foreach (var subgroups in GetLoop("Subgroups").Where(sg => sg.GetString("Ecom:Group:Field.categoryType") == "BOMProducts")) { //BOM products if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.BOMListHeader"))) { <section class="grid-sub-header "> <div class="grid-container grid-container--site-width"> <div class="grid-row "> <div class="grid-column "> <div class="grid-sub-header__content"> <h2 class="heading heading--sub heading--centered">@GetString("Ecom:Group:Field.BOMListHeader")</h2> <p class="teaser teaser--centered">@GetString("Ecom:Group:Field.BOMListText")</p> </div> </div> </div> </div> </section> } var bomProductList = Dynamicweb.Ecommerce.Products.Group.GetGroupById(subgroups.GetString("Ecom:Group.ID")); @DisplayBOMProductList(bomProductList, productPageId) <section class="divider "> <span class="divider__icon"> <svg class="divider__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#logo"></use></svg> </span> </section> } //Products var productList = Dynamicweb.Ecommerce.Products.Group.GetGroupById(GetString("Ecom:Group.ID")); if (productList.ProductCount > 0) { if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.ProductListHeader"))) { <a name="products" id="products"></a> <section class="grid-sub-header "> <div class="grid-container grid-container--site-width"> <div class="grid-row "> <div class="grid-column "> <div class="grid-sub-header__content"> <h2 class="heading heading--sub heading--centered">@GetString("Ecom:Group:Field.ProductListHeader")</h2> <p class="teaser teaser--centered">@GetString("Ecom:Group:Field.ProductListText")</p> </div> </div> </div> </div> </section> } @DisplayProductList(productList, productPageId) } //Accessories var accessoriesList = new List<Dynamicweb.Ecommerce.Products.Product>(); var tempList = new List<string>(); foreach (var p in productList.Products) { tempList.AddRange(p.RelatedProducts().Where(rp => rp.RelatedGroupId == "Addon").Select(pr => pr.Product.Id).ToList()); } accessoriesList = Dynamicweb.Ecommerce.Products.Product.GetProductsByProductIDs(tempList.ToArray(), false, Pageview.Area.EcomLanguageId).ToList(); // accessoriesList = accessoriesList.ToList(); if (accessoriesList.Count > 0) { if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.AccessoriesListHeader"))) { <a name="accessories" id="accessories"></a> <section class="grid-sub-header "> <div class="grid-container grid-container--site-width"> <div class="grid-row "> <div class="grid-column "> <div class="grid-sub-header__content"> <h2 class="heading heading--sub heading--centered">@GetString("Ecom:Group:Field.AccessoriesListHeader")</h2> <p class="teaser teaser--centered">@GetString("Ecom:Group:Field.AccessoriesListText")</p> </div> </div> </div> </div> </section> } @DisplayProductList(null, productPageId, accessoriesList) } } @helper DisplayGroups(List<LoopItem> productGroups) { foreach (var group in productGroups) { string image = group.GetString("Ecom:Group.LargeImage").Replace(" ", "%20"); string productPageId = Pageview.Area.Item.FirstOrDefault(i => i.Key == "ProductPageId").Value.ToString(); string groupLink = "Default.aspx?ID=" + productPageId + "&GroupID=" + group.GetString("Ecom:Group.ID"); if (string.IsNullOrWhiteSpace(image)) { image = "/Files/Images/Ecommerce/Products/no-image.jpeg"; } <li class="grid-column list-cards-simple__item"> <article class="card-simple"> <a href="@groupLink" title="@Translate("Se mulighederne", "Se mulighederne")" class="card-simple__link" property="url"> <figure vocab="http://schema.org/" typeof="ImageObject" class="image-lazyload__figure"> <img class="lazyload image-lazyload__image " src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="@group.GetString("Ecom:Group.Name")" property="contentUrl" data-src="@image?mode=crop&width=535&height=535&quality=80" data-query-obj='{ "mode":"crop" }' data-srcset="@image?mode=crop&width=431&height=431&quality=80 431w, @image?mode=crop&width=360&height=360&quality=80 360w, @image?mode=crop&width=294&height=294&quality=80 294w, @image?mode=crop&width=220&height=220&quality=80 220w, @image?mode=crop&width=727&height=727&quality=80 727w, @image?mode=crop&width=535&height=535&quality=80 535w, @image?mode=crop&width=424&height=424&quality=80 424w, @image?mode=crop&width=280&height=280&quality=80 280w" sizes="(min-width: 1400px) 431px, (min-width: 1200px) 360px, (min-width: 992px) 294px, (min-width: 768px) 220px, (min-width: 576px) 727px, (min-width: 465px) 535px, (min-width: 321px) 424px, (min-width: 320px) 280px"> <noscript><img src="@image?mode=crop&width=535&quality=80" alt="@group.GetString("Ecom:Group.Name")"></noscript> </figure> <h3 class="heading heading--col-element">@group.GetString("Ecom:Group.Name")</h3> <div class="body-text body-text--card-std"> @group.GetString("Ecom:Group:Field.groupTeaser") </div> <button class="button button--arrow button--color-puff"> <span class="button__text">@Translate("Se mulighederne", "Se mulighederne")</span><span class="arrow arrow--right "></span> </button> </a> </article> </li> } } @helper DisplayGalleryImage(string image) { <li class="gallery__item"> <a href="@image?width=300" data-gallery="" class="gallery__link"> <figure vocab="http://schema.org/" typeof="ImageObject" class="image-lazyload__figure image-lazyload__figure--gallery "> <img class="lazyload image-lazyload__image lazyload-bg-special image-lazyload__image--gallery" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" property="contentUrl" data-src="@image?mode=crop&width=535&quality=80" data-query-obj='{ "mode":"crop" }' data-srcset="@image?mode=crop&width=438&quality=80 438w, @image?mode=crop&width=367&quality=80 367w, @image?mode=crop&width=300&quality=80 300w, @image?mode=crop&width=227&quality=80 227w, @image?mode=crop&width=364&quality=80 364w, @image?mode=crop&width=535&quality=80 535w, @image?mode=crop&width=424&quality=80 424w, @image?mode=crop&width=280&quality=80 280w" sizes="(min-width: 1400px) 438px, (min-width: 1200px) 367px, (min-width: 992px) 300px, (min-width: 768px) 227px, (min-width: 576px) 364px, (min-width: 465px) 535px, (min-width: 321px) 424px, (min-width: 320px) 280px"> <noscript><img src="@image?mode=crop&width=535&quality=80"></noscript> </figure> </a> </li> } @helper DisplayBOMProductList(Dynamicweb.Ecommerce.Products.Group bomProductList, string productPageId) { string baseUrl = Pageview.Area.Item.FirstOrDefault(i => i.Key == "Base_Link").Value.ToString(); var prods = bomProductList.Products; var filProds = prods.Where(p => p.Number.Split('-').Last() == "1" || p.ProductFieldValues.GetProductFieldValue("PrimaryBOM").Value.ToString() != "False"); var tempProds = filProds.Where(p => bool.Parse(p.ProductFieldValues.GetProductFieldValue("PrimaryBOM").Value.ToString()) == true && p.Number.Split('-').Last() != "1"); if (tempProds.Any()) { foreach (var tP in tempProds) { var baseID = tP.Number.Split('-'); string remId = string.Join("-", string.Join("-",baseID.Take(baseID.Length - 1).ToArray()), "1"); filProds = filProds.Where(p => p.Number != remId); } } <section class="parts-list-element parts-list-element--3cols"> <div class="grid-container grid-container--site-width"> <ul class="grid-row grid-row--three-columns-113333 parts-list-element__list"> @foreach (Dynamicweb.Ecommerce.Products.Product bomProduct in filProds) { string prodId = bomProduct.Id; string prodName = bomProduct.Name; string prodImage = bomProduct.ImageLarge.Replace(" ", "%20"); if (string.IsNullOrWhiteSpace(prodImage)) { prodImage = "/Files/Images/Ecommerce/Products/no-image.jpeg"; } else { prodImage = "/files" + prodImage; } string GID = ""; // GID = "&groupid=" + bomProduct.DefaultGroup.Id; string prodLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + productPageId + GID + "&productId=" + prodId); string prodCurrency = bomProduct.Price.Currency.Code; string BOMMountType = ""; double BOMMountTypeTotalPrice = 0; string BOMProductIdList = ""; string BOMProductQuantityList = ""; BOMMountType = bomProduct.GetProductFieldValue("BOMProductListDefault").ToString(); string BOMProductInfoInclusive1 = bomProduct.GetProductFieldValue("BOMProductInfoInclusive1").ToString(); string BOMProductInfoInclusive2 = bomProduct.GetProductFieldValue("BOMProductInfoInclusive2").ToString(); string BOMProductInfoInclusive3 = bomProduct.GetProductFieldValue("BOMProductInfoInclusive3").ToString(); foreach (var item in bomProduct.Items) { var bomProd = Dynamicweb.Ecommerce.Products.Product.GetProductById(item.BomProductId); if (bomProd.GetProductFieldValue("BOMProductMountType").ToString().Contains(BOMMountType)) { if (string.IsNullOrWhiteSpace(BOMProductIdList)) { BOMProductIdList = bomProd.Id; } else { BOMProductIdList = BOMProductIdList + "," + bomProd.Id; } if (string.IsNullOrWhiteSpace(BOMProductQuantityList)) { BOMProductQuantityList = item.Quantity.ToString(); } else { BOMProductQuantityList = BOMProductQuantityList + "," + item.Quantity; } BOMMountTypeTotalPrice = BOMMountTypeTotalPrice + (bomProd.Price.PriceWithoutVAT * item.Quantity); } } <li class="grid-column parts-list-element__item"> <article class="card-parts-list card-parts-list--3cols"> <div class="card-parts-list__image"> <a href="@prodLink" title="@prodName" class="" property="url"> <figure vocab="http://schema.org/" typeof="ImageObject" class="image-lazyload__figure "> <img class="lazyload image-lazyload__image " src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="@prodName" property="contentUrl" data-src="@prodImage?mode=crop&width=776&height=776&quality=80" data-query-obj='{ "mode":"crop" }' data-srcset="@prodImage?mode=crop&width=431&height=431&quality=80 431w, @prodImage?mode=crop&width=360&height=360&quality=80 360w, @prodImage?mode=crop&width=294&height=294&quality=80 294w, @prodImage?mode=crop&width=220&height=220&quality=80 220w, @prodImage?mode=crop&width=776&height=776&quality=80 776w, @prodImage?mode=crop&width=540&height=540&quality=80 540w, @prodImage?mode=crop&width=280&height=280&quality=80 280w" sizes="(min-width: 1400px) 431px, (min-width: 1200px) 360px, (min-width: 992px) 294px, (min-width: 768px) 220px, (min-width: 576px) 776px, (min-width: 321px) 540px, (min-width: 320px) 280px"> <noscript><img src="@prodImage?mode=crop&width=776&quality=80" alt="@prodName"></noscript> </figure> </a> </div> <div class="card-parts-list__content"> <button data-overlay-class="overlay-products-added__overlay" data-overlay-url="@(baseUrl + "system/ajax/javascript/add-to-basket-overlay")?products=@BOMProductIdList&quantities=@BOMProductQuantityList" data-overlay-callback="updateCartQuantity" data-overlay-backdrop-class="novi-backdrop--semi" href="#" title="@prodName" class="card-group-element__icon button--open-overlay" property="url"> <svg class="card-parts-list__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#heart"></use></svg> </button> <h3 class="heading heading--col-element heading--col-element-parts-list">@prodName</h3> <div class="info-and-price info-and-price--3cols "> <div class="info-and-price__info"> <div class="info-and-price__header">@Translate("Bl.a. inklusiv", "Bl.a. inklusiv")</div> <ul class="info-list info-list--mobile-compact"> @if (!string.IsNullOrWhiteSpace(BOMProductInfoInclusive1)) { <li class="info-list__item">@BOMProductInfoInclusive1</li> } @if (!string.IsNullOrWhiteSpace(BOMProductInfoInclusive2)) { <li class="info-list__item">@BOMProductInfoInclusive2</li> } @if (!string.IsNullOrWhiteSpace(BOMProductInfoInclusive3)) { <li class="info-list__item">@BOMProductInfoInclusive3</li> } </ul> </div> <div class="info-and-price__price"> <div class="price price--group-element"> <div class="price__header">@Translate("Vejledende pris", "Vejledende pris")</div> <span class="price__unit">@prodCurrency</span> <span class="price__price">@Math.Round(BOMMountTypeTotalPrice, 2)</span> </div> <a href="@prodLink" title="" class="button button--cta button--cta-compact" property="url"> <span class="button__text">@Translate("Vis og tilpas", "Vis og tilpas")</span> </a> </div> </div> </div> </article> </li> } </ul> </div> </section> } @helper DisplayProductList(Dynamicweb.Ecommerce.Products.Group productList, string productPageId, List<Dynamicweb.Ecommerce.Products.Product> prodList = null) { string baseUrl = Pageview.Area.Item.FirstOrDefault(i => i.Key == "Logo_Link").Value.ToString(); var list = new List<Dynamicweb.Ecommerce.Products.Product>(); if (productList != null) { list = productList.Products.DistinctBy(p => p.Id).ToList(); } if (prodList != null) { list = prodList.DistinctBy(p => p.Id).ToList(); } <section class="list-group-elements list-group-elements--4cols"> <div class="grid-container grid-container--site-width"> <ul class="grid-row grid-row--four-columns-122444 list-group-elements__list"> @foreach (var product in list) { string prodId = product.Id; string prodName = product.Name; string prodImage = product.ImageLarge.Replace(" ", "%20"); if (string.IsNullOrWhiteSpace(prodImage)) { prodImage = "/Files/Images/Ecommerce/Products/no-image.jpeg"; } else { prodImage = "/files" + prodImage; } string prodDesc = product.ShortDescription; string prodRawLink = ""; string GId = ""; /* if(product.DefaultGroup != null) { GId = "&groupid=" + product.DefaultGroup.Id; } else if (product.Groups.Count > 0) { GId = "&groupid=" + product.Groups.First().Id; } */ string prodLink = Dynamicweb.Frontend.SearchEngineFriendlyURLs.GetFriendlyUrl("default.aspx?id=" + productPageId + GId + "&productId=" + prodId); string prodPrice = product.Price.PriceWithoutVATFormattedNoSymbol; string prodCurrency = product.Price.Currency.Code; string height = product.GetProductFieldValue("Height").ToString(); string width = product.GetProductFieldValue("Width").ToString(); string length = product.GetProductFieldValue("Length").ToString(); string color = product.GetProductFieldValue("Color").ToString(); <li class="grid-column list-group-elements__item"> <article class="card-group-element"> <div class="card-group-element__image"> <a href="@prodLink" data-test="@prodRawLink" title="@prodName" class="card-group-element__link" property="url"> <figure vocab="http://schema.org/" typeof="ImageObject" class="image-lazyload__figure "> <img class="lazyload image-lazyload__image " src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="@prodName" property="contentUrl" data-src="@prodImage?mode=crop&width=535&height=535&quality=80" data-query-obj='{ "mode":"crop" }' data-srcset="@prodImage?mode=crop&width=316&height=316&quality=80 316w, @prodImage?mode=crop&width=263&height=263&quality=80 263w, @prodImage?mode=crop&width=213&height=213&quality=80 213w, @prodImage?mode=crop&width=345&height=345&quality=80 345w, @prodImage?mode=crop&width=345&height=345&quality=80 345w, @prodImage?mode=crop&width=535&height=535&quality=80 535w, @prodImage?mode=crop&width=424&height=424&quality=80 424w, @prodImage?mode=crop&width=280&height=280&quality=80 280w" sizes="(min-width: 1400px) 316px, (min-width: 1200px) 263px, (min-width: 992px) 213px, (min-width: 768px) 345px, (min-width: 576px) 345px, (min-width: 465px) 535px, (min-width: 321px) 424px, (min-width: 320px) 280px"> <noscript><img src="@prodImage?mode=crop&width=535&quality=80" alt="@prodName"></noscript> </figure> </a> </div> <div class="card-group-element__content"> <button data-overlay-class="overlay-products-added__overlay" data-overlay-callback="updateCartQuantity" data-overlay-url="@(baseUrl + "system/ajax/javascript/add-to-basket-overlay")?products=@prodId&quantities=1" data-overlay-backdrop-class="novi-backdrop--semi" href="#" title="@prodName" class="card-group-element__icon button--open-overlay" property="url"> <svg class="card-group-element__svg"><use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/frontend/dist/icons/icons.svg#heart"></use></svg> </button> <a href="@prodLink" title="@prodName" class="card-group-element__link" property="url"> <h3 class="heading heading--col-element heading--col-element-group-element">@prodName</h3> <div class="item-number item-number--group-element">@Translate("Varenummer", "Varenummer"): @prodId</div> @if (!string.IsNullOrWhiteSpace(height)) { <div class="item-number item-number--group-element">@Translate("Højde", "Højde"): @height cm</div> } @if (!string.IsNullOrWhiteSpace(width)) { <div class="item-number item-number--group-element">@Translate("Bredde", "Bredde"): @width cm</div> } @if (!string.IsNullOrWhiteSpace(length)) { <div class="item-number item-number--group-element">@Translate("Længde", "Længde"): @length cm</div> } @if (!string.IsNullOrWhiteSpace(color)) { <div class="item-number item-number--group-element">@Translate("Farve", "Farve"): @color</div> } </a> <div class="info-and-price info-and-price--group-element"> <div class="info-and-price__info"> @prodDesc </div> <div class="info-and-price__price"> <div class="price price--group-element"> <div class="price__header">@Translate("Vejledende pris", "Vejledende pris")</div> <span class="price__unit">@prodCurrency</span> <span class="price__price">@prodPrice</span> </div> <a href="@prodLink" title="" class="button button--group-element" property="url"> <span class="button__text">@Translate("Se detaljer", "Se detaljer")</span> </a> </div> </div> </div> </article> </li> } </ul> </div> </section> }