0
Din indkøbskurv

Opdaterer kurv

stk. a

-
+

Din kurv i alt (ex. fragt)

Handel videre

Gå til kassen
VISA/DK VISA/DK VISA/DK VISA/DK VISA/DK
Find forhandler

,

Tlf.

Se alle
Error executing template "Designs/Mobler2018/eCom/Productlist/Productlist.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_710b076ffda14842b97f19cff809bab3.Execute() in D:\dynamicweb.net\Solutions\mobler.LIVE\Files\Templates\Designs\Mobler2018\eCom\Productlist\Productlist.cshtml:line 48
   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.b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using Mobler.Website.CustomModules.MoblerHelpers 2 @using System.Text.RegularExpressions 3 @using Dynamicweb 4 @using Dynamicweb.Admin 5 @using Group = Dynamicweb.Ecommerce.Products.Group 6 @using Services = Dynamicweb.Ecommerce.Services 7 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 8 9 @{ 10 string GroupName = GetString("Ecom:Group.Name"); 11 string GroupId = GetString("Ecom:Group.ID"); 12 string GroupImage = GetString("Ecom:Group.LargeImage"); 13 string GroupDescription = GetString("Ecom:Group.Description").Replace("||", "<br/>"); 14 bool HideSubgroups = GetBoolean("Ecom:Group:Field.FirstwebDoNotRenderSubgroups"); 15 string advertiseItemLink = GetString("Ecom:Group:Field.advertiseitemlink"); 16 int advertiseItemPageId = 0; 17 if ( advertiseItemLink != "" ) 18 { 19 advertiseItemPageId = Int32.Parse( advertiseItemLink.Substring( advertiseItemLink.LastIndexOf( '=' ) + 1 ) ); 20 } 21 var ProductLoop = GetLoop("Products"); 22 bool NoProducts = ProductLoop.Count == 0 ? true : false; 23 var RelatedBlogs = Firstweb.Custom.CustomCode.Frontend.Helpers.Blogs.GetBlogsRelatedToGroup(GroupId); 24 int BlogCount = RelatedBlogs.Count; 25 int ProductCount = ProductLoop.Count; 26 int RenderedBlogs = 0; 27 int RenderedProducts = 0; 28 System.Web.HttpContext.Current.Items["OverrideOgTags"] = true; 29 bool isGroupList = String.IsNullOrEmpty(GroupId) ? false : true; 30 var RelevantGroupFacets = Firstweb.EcomFilterManagement.Frontend.Helper.GetEcomGroupFilters(GroupId).OrderBy(x => x.Sorting).ToList(); 31 var ParentGroups = Firstweb.Custom.CustomCode.Frontend.Helpers.EcomGroups.getBreadCrumbGroupList(GroupId); 32 var SubGroups = Firstweb.Custom.CustomCode.Frontend.Helpers.EcomGroups.GetSubgroups(GroupId); 33 if (SubGroups.Count > 4) 34 { 35 SubGroups = SubGroups.ToList(); 36 } 37 38 if ( !SubGroups.Any() ) 39 { 40 foreach ( var parentGroup in ParentGroups ) 41 { 42 if ( parentGroup.Subgroups.Any( g => g.Id.Equals( GroupId ) ) ) 43 { 44 SubGroups = parentGroup.Subgroups.ToList(); 45 } 46 } 47 } 48 bool grp = Services.ProductGroups.GetGroup( GroupId ).Subgroups.Any(); 49 50 var PageId = Dynamicweb.Frontend.PageView.Current().ID; 51 52 string QuickDeliveryDescription = Firstweb.Custom.CustomCode.Frontend.Helpers.AreaItems.GetString("QuickDeliveryDescription"); 53 string NormalDeliveryDescription = Firstweb.Custom.CustomCode.Frontend.Helpers.AreaItems.GetString("NormalDeliveryDescription"); 54 int TotalPages = GetInteger("Ecom:ProductList.TotalPages"); 55 int CurrentPage = GetInteger("Ecom:ProductList.CurrentPage"); 56 } 57 58 @SnippetStart("OgTags") 59 <meta property="og:type" content="product.group" /> 60 <meta property="og:description" content="@Regex.Replace(GroupDescription, "<.*?>", String.Empty)" /> 61 <meta property="og:image" content="@GroupImage" /> 62 @SnippetEnd("OgTags") 63 64 @using System.Collections 65 @using Dynamicweb.Core 66 @using Dynamicweb.Ecommerce 67 @using Mobler.Website.CustomModules.MoblerHelpers 68 @using Dynamicweb.Ecommerce.Products 69 @using Dynamicweb.Ecommerce.Variants 70 @using Humanizer 71 @using Mobler.Website.CustomCode 72 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 73 74 @using Mobler.Website.CustomModules.MoblerHelpers 75 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 76 77 @helper RenderPricing(LoopItem product, bool hasVariants) 78 { 79 // Theming 80 string blackFridayTheme = Firstweb.Custom.CustomCode.Frontend.Helpers.AreaItems.GetString("BlackFridayTheme"); 81 82 // Pricing 83 DateTime newItemExpiryDate = product.GetDate( "Ecom:Product:Field.NewItemExpiryDate" ); 84 bool hasNewItemExpiryDate = newItemExpiryDate.Date > DateTime.Now.Date; 85 bool newItem = product.GetBoolean("Ecom:Product:Field.NewItem") && hasNewItemExpiryDate; 86 bool LowPrice = product.GetBoolean("Ecom:Product:Field.Splash3"); 87 double CostPrice = product.GetDouble("Ecom:Product:Field.FirstwebCostPrice.Value.Raw"); 88 string PriceSaving = product.GetString("Ecom:Product:Field.Spar.Value"); 89 double ActualPrice = product.GetDouble("Ecom:Product.Price.Price"); 90 91 // Initialize variables 92 double spar = 0; 93 double price = 0; 94 double normalPrice = 0; 95 96 string priceFormatted = ""; 97 string sparFormatted = ""; 98 string normalPriceFormatted = ""; 99 100 string campaignColor = ""; 101 string campaignText = ""; 102 string campaignDate = ""; 103 104 bool CampaignActiveOnProduct = product.GetBoolean("CampaignModule:Product.CampaignActiveOnProduct"); 105 if (!CampaignActiveOnProduct) 106 { 107 price = ActualPrice; 108 priceFormatted = MoblerHelpers.formatPrice(price); 109 } 110 else 111 { 112 normalPrice = product.GetDouble("CampaignModule:Product.CampaignProduct.NormalPrice"); 113 normalPriceFormatted = product.GetString("CampaignModule:Product.CampaignProduct.NormalPrice.FormattedRetail"); 114 115 price = product.GetDouble("CampaignModule:Product.CampaignProduct.CampaignPrice"); 116 priceFormatted = product.GetString("CampaignModule:Product.CampaignProduct.CampaignPrice.FormattedRetail"); 117 118 spar = product.GetDouble("CampaignModule:Product.CampaignProduct.DiscountAmount"); 119 sparFormatted = product.GetString("CampaignModule:Product.CampaignProduct.DiscountAmount.FormattedRetail"); 120 121 campaignColor = product.GetString("CampaignModule:Product.Campaign.Color"); 122 campaignText = product.GetString("CampaignModule:Product.Campaign.Text"); 123 } 124 125 // Set Splash Types 126 string splashType = ""; 127 if (campaignText == "KOMBI") 128 { 129 splashType = "combo"; 130 } 131 else if (CostPrice > 0) 132 { 133 splashType = "priceshape"; 134 } 135 else if (spar > 0) 136 { 137 splashType = "offer"; 138 } 139 else if (newItem) 140 { 141 splashType = "new"; 142 } 143 else if (LowPrice) 144 { 145 splashType = "low"; 146 } 147 148 <div> 149 <p class="product-item__price fs3 font-weight-bold"> 150 @if (hasVariants) 151 { 152 <span class="font-weight-semibold fs0 mr-2">@Translate("ProductPrice.From", "Fra")</span> 153 } 154 @priceFormatted 155 </p> 156 @if (splashType == "combo") 157 { 158 <div class="splash splash--on-top"> 159 <p class="m-0">@Translate("ProductCombinationOffer", "Sætpris")</p> 160 </div> 161 <div class="d-flex justify-content-between mb-2"> 162 <p class="color-subtle fs0 m-0 text-uppercase">@Translate("PriceBefore", "Før") @normalPriceFormatted</p> 163 <p class="splash fs0 text-uppercase m-0 px-2">@Translate("PriceSaving", "Spar") @sparFormatted</p> 164 </div> 165 } 166 else if (splashType == "priceshape") 167 { 168 string DailyPriceBackgroundColor = Firstweb.Custom.CustomCode.Frontend.Helpers.AreaItems.GetString("AktuelDagsprisBackgroundColor"); 169 string DailyPriceTextColor = Firstweb.Custom.CustomCode.Frontend.Helpers.AreaItems.GetString("AktuelDagsprisTextColor"); 170 171 <div class="splash splash--on-top price-shape" style="background-color: @DailyPriceBackgroundColor"> 172 <p class="m-0" style="color: @DailyPriceTextColor;">@Translate("ProductDailyPriceSplash", "Dagspris")</p> 173 </div> 174 } 175 else if (splashType == "offer") 176 { 177 if (blackFridayTheme == "True") 178 { 179 <div class="splash splash--on-top bf-bg-black bf-color-white"> 180 <p class="m-0">@Translate("ProductOffer", "Tilbud")</p> 181 </div> 182 } 183 else 184 { 185 <div class="splash splash--on-top p-1"> 186 <p class="m-0">@Translate("ProductOffer", "Tilbud")</p> 187 </div> 188 } 189 <div class="d-flex justify-content-between mb-2"> 190 <p class="color-subtle fs0 m-0 text-uppercase">@Translate("PriceBefore", "Før") @normalPriceFormatted</p> 191 <p class="splash fs0 m-0 text-uppercase px-2">@Translate("PriceSaving", "Spar") @sparFormatted</p> 192 </div> 193 } 194 else if (splashType == "new") 195 { 196 <div class="splash splash--on-top new-item"> 197 <p class="m-0">@Translate("ProductNew", "Nyhed")</p> 198 </div> 199 } 200 else if (splashType == "low") 201 { 202 <div class="splash splash--on-top low-price"> 203 <p class="m-0">@Translate("ProductLowPrice", "Fast lavpris")</p> 204 </div> 205 } 206 </div> 207 } 208 209 210 @helper RenderProduct(LoopItem product) 211 { 212 // Group Specific - Exclude Bed Accessories 213 bool excludeBedAccessories = product.GetBoolean("Ecom:Product.CategoryField.Senge.ExcludeBedAccessories.Value"); 214 215 // Product General Info 216 string productId = product.GetString("Ecom:Product.ID"); 217 string productName = product.GetString("Ecom:Product.Name"); 218 string productLink = product.GetString("Ecom:Product.Link.Clean"); 219 string shortDescription = product.GetString("Ecom:Product.ShortDescription"); 220 string languageId = product.GetString("Ecom:Product.LanguageID"); 221 222 // Variants 223 string defaultVariantId = product.GetString("Ecom:Product.DefaultVariantComboID"); 224 string variantId = product.GetString("Ecom:Product.VariantID"); 225 if (String.IsNullOrEmpty(variantId)) { 226 variantId = defaultVariantId; 227 } 228 if (!String.IsNullOrEmpty(variantId)) { 229 productLink = productLink + "&variantid=" + variantId; 230 } 231 232 // Product Images 233 List<string> images = MoblerHelpers.GetProductImages(productId, variantId); 234 string productImage = string.Format("/Admin/Public/GetImage.ashx?Image={0}&Width=280&height=220&Format=png&Crop=5&resolution=50", images.FirstOrDefault()); //MoblerHelpers.GetProductListImageWithMainImage(ProductID, ProductNumber); 235 236 // Product Dimensions 237 string productDepth = product.GetString("Ecom:Product:Field.dybdeint.Value.Clean"); 238 string productHeight = product.GetString("Ecom:Product:Field.hoejdeint.Value.Clean"); 239 string productWidth = product.GetString("Ecom:Product:Field.breddeint.Value.Clean"); 240 bool hasProductDepth = !string.IsNullOrWhiteSpace(productDepth) && productDepth != "0"; 241 bool hasProductHeight = !string.IsNullOrWhiteSpace(productHeight) && productHeight != "0"; 242 bool hasProductWidth = !string.IsNullOrWhiteSpace(productWidth) && productWidth != "0"; 243 244 // Campaign 245 string campaignDateStart = ""; 246 string campaignDateEnd = ""; 247 248 bool campaignActiveOnProduct = product.GetBoolean("CampaignModule:Product.CampaignActiveOnProduct"); 249 if (campaignActiveOnProduct) 250 { 251 campaignDateStart = product.GetString("CampaignModule:Product.CampaignProduct.Campaign.Start"); 252 campaignDateEnd = product.GetString("CampaignModule:Product.CampaignProduct.Campaign.End"); 253 } 254 255 bool hasCampaignDateStart = !string.IsNullOrWhiteSpace(campaignDateStart); 256 257 bool hasCampaignDateEnd = !string.IsNullOrWhiteSpace(campaignDateEnd); 258 string campaignText = ""; 259 if (hasCampaignDateStart && hasCampaignDateStart) 260 { 261 campaignText = $"{Translate("Campaign.BeforeDate.Text", "Gældende fra:")} {campaignDateStart} {Translate("Campaign.BeforeDate.Text2", "t.o.m.")} {campaignDateEnd}"; 262 } 263 264 <div class="col-12 col-sm-6 col-lg-3 product-item js-product-list-item"> 265 <div class="product-item__header"> 266 <a href="@productLink" class="product-item__image"> 267 <img class="js-product-image-@productId" src="@productImage" alt="@productName" loading="lazy"/> 268 </a> 269 @{ 270 int colorOptionsToShow = 4; 271 List<string> variantCombinationVariantIds = product.GetLoop("Co3VariantCombinations").Select(p => p.GetString("Ecom:VariantCombination.VariantID")).ToList(); 272 bool hasVariants = false; 273 } 274 @if (variantCombinationVariantIds.Count > 0) 275 { 276 hasVariants = true; 277 278 <div class="product-item__variants d-flex align-items-center"> 279 @foreach (LoopItem vg in product.GetLoop("VariantGroups")) 280 { 281 int variantOptionWithColorCount = 0; 282 283 @* Only show variants with hex colors *@ 284 foreach (LoopItem variantOption in vg.GetLoop("VariantAvailableOptions")) 285 { 286 <p class="unimportant-hidden">@variantOptionWithColorCount</p> 287 string variantOptionColor = variantOption.GetString("Ecom:VariantOption.ColorHex"); 288 289 // Get count of variants with color 290 if (variantOptionColor.Any()) 291 { 292 variantOptionWithColorCount++; 293 } 294 // Only show this specific amount of variants 295 if (variantOptionColor.Any() && variantOptionWithColorCount < colorOptionsToShow) 296 { 297 // Get variant option id, then compare with variant combinations, to get the link to the specific variant 298 string variantOptionId = variantOption.GetString("Ecom:VariantOption.ID"); 299 string variantIdWithColorOptionId = variantCombinationVariantIds.FirstOrDefault(vid => vid.Contains(variantOptionId)); 300 301 if (variantIdWithColorOptionId.IsNullOrEmpty() == false) 302 { 303 string variantLink = product.GetString("Ecom:Product.Link.Clean") + "&variantid=" + variantIdWithColorOptionId; 304 <a href="@variantLink" class="product-item__variant" style="background-color: @variantOptionColor;"></a> 305 } 306 } 307 else if (variantOptionColor.Any() && variantOptionWithColorCount == colorOptionsToShow) 308 { 309 <a href="@productLink" class="fs2 product-item__more-variants">+</a> 310 } 311 else 312 { 313 break; 314 } 315 } 316 } 317 @if (hasVariants) 318 { 319 <a href="@productLink" class="ml-4 fs-s"> 320 <i class="fas fa-pen mr-1 fs-2"></i> 321 @Translate("Ecom:Product.Pricing.Designer", "Design selv") 322 </a> 323 } 324 </div> 325 } 326 </div> 327 328 <div class="product-item__body"> 329 <a href="@productLink" class="product-item__title"> 330 <h3 class="fs0">@productName</h3> 331 </a> 332 <div class="product-item__description fs0 color-subtle">@shortDescription</div> 333 @if (hasProductDepth || hasProductHeight || hasProductWidth) 334 { 335 <p class="product-item__dimensions fs0 color-subtle"> 336 @if (hasProductDepth) 337 { 338 <span>D/L: @productDepth</span> 339 } 340 @if (hasProductHeight) 341 { 342 <span>H: @productHeight</span> 343 } 344 @if (hasProductWidth) 345 { 346 <span>B: @productWidth</span> 347 } 348 </p> 349 } 350 </div> 351 352 <div class="product-item__footer"> 353 @RenderPricing(product, hasVariants) 354 355 @if (excludeBedAccessories) 356 { 357 <p class="color-subtle fs-s m-0">@Translate("Ecom:Product.Pricing.Excludes.Beds", "Prisen er ekskl. ben og gavl.")</p> 358 } 359 @if (hasVariants) 360 { 361 <div class="variant-price-disclaimer color-subtle fs-s">@Translate("VariantPriceDisclaimer", "Prisen kan variere efter materialevalg")</div> 362 } 363 @if (hasCampaignDateStart && hasCampaignDateEnd) 364 { 365 <div class="product-item__campaign"> 366 <p class="color-subtle fs-s">@campaignText</p> 367 </div> 368 } 369 </div> 370 </div> 371 } 372 373 @using Mobler.Website.CustomModules.MoblerHelpers 374 @using Dynamicweb.Ecommerce.Products 375 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 376 377 @helper RenderFilters(string GroupId, List<Firstweb.EcomFilterManagement.Models.EcomGroupFacet> RelevantGroupFacets) 378 { 379 if (!String.IsNullOrEmpty(GroupId)) 380 { 381 <form id="filters-form" class="filters js-filters-form" method="get"> 382 <input type="hidden" name="GroupId" value="@GroupId" /> 383 384 <div class="row accordion" id="collapseGroup"> 385 @foreach (LoopItem facetGroup in GetLoop("FacetGroups")) 386 { 387 foreach (var FacetGroup in RelevantGroupFacets.Where(x => x.FacetSystemName != "Nyhed" && x.FacetSystemName != "Tilbud")) 388 { 389 var facets = facetGroup.GetLoop("Facets").Where(x => x.GetString("Facet.Name") == FacetGroup.FacetSystemName); 390 if (facets.Any()) 391 { 392 var facet = facets.FirstOrDefault(); 393 string FacetName = facet.GetString("Facet.Name"); 394 string QueryParameter = facet.GetString("Facet.QueryParameter"); 395 var FacetOptions = facet.GetLoop("FacetOptions"); 396 <div class="col-6 col-sm-4 mt-3"> 397 398 <div class="filter-drop p-2 d-flex justify-content-between align-items-center pointer" data-toggle="collapse" data-target="#@QueryParameter"> 399 <p class="m-0">@Translate("FacetName." + FacetName, FacetName)</p> 400 <i class="fas fa-chevron-down"></i> 401 </div> 402 <div id="@QueryParameter" class="collapse inputs bg-white" data-parent="#collapseGroup"> 403 <div class="p-2"> 404 <div> 405 @foreach (var fo in FacetOptions) 406 { 407 string OptionName = fo.GetString("FacetOption.Name"); 408 bool OptionSelected = fo.GetBoolean("FacetOption.Selected"); 409 string OptionValue = fo.GetString("FacetOption.Value"); 410 int OptionCount = fo.GetInteger("FacetOption.Count"); 411 string Selected = OptionSelected ? "checked" : ""; 412 string CapitalizeClass = FacetName == "FMærkevarer" ? "text-capitalize" : ""; 413 <div> 414 <label class="custom-checkbox mb-2 @CapitalizeClass" data-toggle="collapse" data-target="#@QueryParameter"> 415 <input type="checkbox" name="@QueryParameter" value="@OptionValue" @Selected /> 416 <span class="checkbox"> 417 <i class="fas fa-check color-primary icon"></i> 418 </span> 419 <span class="label"> 420 <span>@OptionName (@OptionCount)</span> 421 </span> 422 </label> 423 </div> 424 } 425 </div> 426 </div> 427 </div> 428 429 </div> 430 } 431 } 432 } 433 434 <div class="col-6 d-flex mt-3"> 435 @foreach (LoopItem facetGroup in GetLoop("FacetGroups")) 436 { 437 var facets = facetGroup.GetLoop("Facets").Where(x => x.GetString("Facet.Name") == "Nyhed"); 438 foreach (var facet in facets) 439 { 440 foreach (LoopItem option in facet.GetLoop("FacetOptions")) 441 { 442 var value = option.GetValue("FacetOption.Value"); 443 var selected = ""; 444 var label = facet.GetString("Facet.Name"); 445 var count = option.GetInteger("FacetOption.Count"); 446 if (option.GetBoolean("FacetOption.Selected")) 447 { 448 selected = "checked"; 449 } 450 if (option.GetString("FacetOption.Label") != "False") 451 { 452 <label class="custom-checkbox mb-0 mr-3 mr-md-5"> 453 <input type="checkbox" name="@facet.GetString("Facet.Name")" value="@value" @selected /> 454 <span class="checkbox"> 455 <i class="fas fa-check color-primary icon"></i> 456 </span> 457 <span class="label"> 458 <span>@label (@count)</span> 459 </span> 460 </label> 461 } 462 } 463 } 464 } 465 466 </div> 467 468 </div> 469 470 </form> 471 } 472 } 473 474 @using Mobler.Website.CustomModules.MoblerHelpers 475 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 476 477 @helper RenderBlogTeaser(Firstweb.Custom.CustomCode.Frontend.Helpers.Blog Blog) 478 { 479 string PageId = GetGlobalValue( "Global:Page.ID" ); 480 string CleanLink = Blog.Link.Replace("default.aspx?id", "Default.aspx?Id"); 481 <div class="col-12 col-md-4 px-0 px-md-3 mb-4"> 482 <a href="@CleanLink" class="blog d-block"> 483 <div class="image" style="background-image:url('@Blog.Image')"> 484 <img class="d-none" src="@Blog.Image" alt="Alternate Text" /> 485 </div> 486 <div class="text"> 487 <div class="positioning"> 488 <h4 class="col-10 col-md-9 px-2 pt-3 bg-white font-weight-bold text-center mx-auto">@Blog.Header</h4> 489 @if ( PageId != "7613" ) 490 { 491 <p class="text-center color-subtle">@Blog.Date</p> 492 } 493 <p class="text-center font-weight-bold m-0 color-primary">@Translate("BlogReadMore", "L&aelig;s mere her")</p> 494 </div> 495 </div> 496 </a> 497 </div> 498 } 499 500 @helper RenderLargeBlogTeaser(Firstweb.Custom.CustomCode.Frontend.Helpers.Blog Blog, string ImagePosition) 501 { 502 string ImageClass = ImagePosition == "Left" ? "" : "offset-md-4"; 503 string TextClass = ImagePosition == "Left" ? "" : "left"; 504 string Image = "/Admin/Public/GetImage.ashx?Image=" + Blog.Image + "&Height=400&Crop=0"; 505 string CleanLink = Blog.Link.Replace("default.aspx?id", "Default.aspx?Id"); 506 <div class="col-12 blog"> 507 <div class="row"> 508 <div class="col-12 col-md-8 px-0 px-md-3 @ImageClass"> 509 <div class="image-container" style="background-image:url('@Image')"> 510 <img class="img-fluid" src="@Image" alt="@Blog.Header" /> 511 </div> 512 </div> 513 <div class="col-12 col-md-6 text-container mb-5 mb-md-0 @TextClass"> 514 <div class="text bg-white p-3"> 515 <div> 516 <h4>@Blog.Header</h4> 517 @Blog.Teaser 518 </div> 519 <a class="font-weight-bold" href="@CleanLink">@Translate("BlogReadMore", "L&aelig;s mere her")</a> 520 </div> 521 </div> 522 </div> 523 </div> 524 } 525 526 @helper RenderLatestBlogsTeasers() 527 { 528 var LatestBlogs = Firstweb.Custom.CustomCode.Frontend.Helpers.Blogs.GetLatestBlogs(); 529 foreach (var Blog in LatestBlogs) 530 { 531 @RenderBlogTeaser(Blog) 532 } 533 } 534 535 536 <div class="container pt-3 d-none d-md-block"> 537 <div class="bread"> 538 <p class="color-subtle">@Translate("Breadcrumb.CurrentPage", "Her er du:")</p> 539 <p class="bread-item color-subtle"> 540 <a href="/"> 541 @Translate("Breadcrumb.Frontpage", "Forside") 542 </a> 543 </p> 544 @foreach (var Group in ParentGroups) 545 { 546 <p class="bread-item color-subtle"> 547 @if (Group == ParentGroups.First()) 548 { 549 @Group.Name 550 } 551 else 552 { 553 <a href="/Default.aspx?Id=@PageId&GroupId=@Group.Id"> 554 @Group.Name 555 </a> 556 } 557 </p> 558 } 559 560 <p class="active color-subtle">@GroupName</p> 561 </div> 562 </div> 563 564 <div class="groups my-5 container"> 565 @if (SubGroups.Any() && !HideSubgroups) 566 { 567 foreach (Group group in SubGroups) 568 { 569 var TopLevelGroup = Firstweb.Custom.CustomCode.Frontend.Helpers.EcomGroups.GetTopLevelGroup(group); 570 string linkDestination = group.ProductGroupFieldValues.GetProductGroupFieldValue("LinkToGroupsPrimaryPosition").HasValue && !string.IsNullOrEmpty(group.ProductGroupFieldValues.GetProductGroupFieldValue("LinkToGroupsPrimaryPosition").Value.ToString()) ? group.ProductGroupFieldValues.GetProductGroupFieldValue("LinkToGroupsPrimaryPosition").Value.ToString() : "/" + TopLevelGroup.Meta.PrimaryPage + "&GroupID=" + group.Id; 571 string name = group.Name; 572 string image = ""; 573 if (!string.IsNullOrEmpty(group.SmallImage)) 574 { 575 image = "/files/" + group.SmallImage; 576 } 577 if (!string.IsNullOrEmpty(image)) 578 { 579 <div class="groups__group text-center @(group.Id.Equals(GroupId) || grp ? "active" : "")"> 580 <a href="@linkDestination"> 581 <img src="@image" alt="@name" class="img-fluid"/> 582 <p class="mt-2 mb-0">@name</p> 583 </a> 584 </div> 585 } 586 } 587 } 588 </div> 589 590 <div data-bind="viewModel: 'ProductListViewModel'"> 591 592 <div class="container mb-5"> 593 594 <div class="delivery-information-popup" data-bind="css: { 'd-flex': QuickDeliveryInfoOpen }, click: ToggleQuickDeliveryInfo"> 595 <div class="description-content bg-white px-3 py-4 px-lg-4 position-relative" data-bind="click: OpenQuickDeliveryInfo, clickBubble: false"> 596 <div class="modal-closer-custom" data-bind="click: ToggleQuickDeliveryInfo, clickBubble: false"> 597 <img src="/Files/Templates/Designs/Mobler2018/assets/img/icons/close.svg" /> 598 </div> 599 <div> 600 @QuickDeliveryDescription 601 </div> 602 </div> 603 </div> 604 <div class="delivery-information-popup" data-bind="css: { 'd-flex': NormalDeliveryInfoOpen }, click: ToggleNormalDeliveryInfo"> 605 <div class="description-content bg-white px-3 py-4 px-lg-4 position-relative" data-bind="click: OpenNormalDeliveryInfo, clickBubble: false"> 606 <div class="modal-closer-custom" data-bind="click: ToggleNormalDeliveryInfo, clickBubble: false"> 607 <img src="/Files/Templates/Designs/Mobler2018/assets/img/icons/close.svg" /> 608 </div> 609 <div> 610 @NormalDeliveryDescription 611 </div> 612 </div> 613 </div> 614 <div class="d-flex align-items-center"> 615 <h1 class="">@GroupName</h1> 616 </div> 617 <div class="group-description mb-2 d-none d-md-block"> 618 @GroupDescription 619 </div> 620 </div> 621 622 <div class="container" data-bind="viewModel: 'ProductListViewModel'"> 623 <div class="js-filters-area"> 624 @RenderFilters(GroupId, RelevantGroupFacets) 625 </div> 626 627 @if ( advertiseItemPageId != 0 ) 628 { 629 <div data-bind="universe: { target: '#js-product-list' }"> 630 @RenderPageContent( advertiseItemPageId ) 631 </div> 632 } 633 634 <div class="row" id="js-product-list"> 635 @foreach (var Product in ProductLoop) 636 { 637 RenderedProducts++; 638 639 @RenderProduct(Product) 640 if (RenderedProducts == 12 && BlogCount > 0 && RenderedBlogs == 0) 641 { 642 <div class="feature-blogs col-12 my-5 js-productlist-blogs"> 643 <div class="row"> 644 @foreach (var Blog in RelatedBlogs) 645 { 646 if (RenderedBlogs < 1) 647 { 648 @RenderLargeBlogTeaser(Blog, "Left") 649 RenderedBlogs++; 650 } 651 } 652 </div> 653 </div> 654 } 655 } 656 657 @if (NoProducts) 658 { 659 <div class="col-12"> 660 <p class="fs4 font-weight-bold">@Translate("ProductListNoProducts", "Der er ingen produkter at vise")</p> 661 </div> 662 } 663 <div class="col-12" data-bind="loadMoreProducts: { totalPages: @TotalPages, currentPage: 2, loadingInformation: LoadingInformation() }"> 664 <div class="productlist-loader unimportant-hidden" data-bind="css: { 'd-flex': LoadingInformation().active }"> 665 <p class="fs4 m-0 color-white">@Translate("ProductList.LoadingProducts", "Indl&aelig;ser produkter") <i class="fa fa-spinner fa-spin ml-3 fs5"></i></p> 666 </div> 667 </div> 668 </div> 669 670 @if (!String.IsNullOrEmpty(GetString("Ecom:Group:Field.GrpupDescriptionBottom"))) 671 { 672 <div class="group-description my-5">@GetString("Ecom:Group:Field.GrpupDescriptionBottom")</div> 673 if (!String.IsNullOrEmpty( GetString("Ecom:Group:Field.GroupDescriptionBottomFoldout")) ) 674 { 675 <p><a aria-controls="collapse" aria-expanded="false" class="btn btn-primary" data-toggle="collapse" href="#collapse" role="button">@Translate("CollapseShowMore", "Vis mere")</a></p> 676 <div class="collapse" id="collapse"> 677 <div class="card card-body"> 678 <div class="group-description my-5">@GetString("Ecom:Group:Field.GroupDescriptionBottomFoldout")</div> 679 </div> 680 </div> 681 } 682 } 683 684 @if (RenderedBlogs < BlogCount) 685 { 686 string ImagePosition = "Left"; 687 int NewBlogCounter = 0; 688 <div class="feature-blogs my-5"> 689 <div class="row"> 690 @foreach (var Blog in RelatedBlogs) 691 { 692 if (NewBlogCounter >= RenderedBlogs) 693 { 694 @RenderLargeBlogTeaser(Blog, ImagePosition) 695 if (ImagePosition == "Left") 696 { 697 ImagePosition = "Right"; 698 } 699 else 700 { 701 ImagePosition = "Left"; 702 } 703 } 704 NewBlogCounter++; 705 } 706 </div> 707 </div> 708 } 709 </div> 710 </div> 711