Swift

Clothing

Error executing template "Designs/Swift-v2/Paragraph/Swift-v2_ProductListGroupImage.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_f35259b651d8410a9e8b5ef9b5d84dda.ExecuteAsync()
   at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
   at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.DynamicWrapperService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
   at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass23_0.<Run>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at RazorEngine.Templating.RazorEngineServiceExtensions.Run(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template) in /_/src/Application/Providers/Dynamicweb.Rendering.Providers.NetCore/Razor/RazorTemplateRenderingProvider.cs:line 68
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template) in C:\dwxa1\_w\1\s\src\Core\Dynamicweb.Core\Rendering\TemplateRenderingService.cs:line 14
   at Dynamicweb.Rendering.Template.RenderRazorTemplate() in C:\dwxa1\_w\1\s\src\Core\Dynamicweb.Core\Rendering\Template.cs:line 805

1 @inherits Dynamicweb.Rendering.ViewModelTemplate<Dynamicweb.Frontend.ParagraphViewModel> 2 @using Dynamicweb.Frontend.Navigation 3 @using Dynamicweb.Ecommerce.ProductCatalog 4 @using Dynamicweb.Environment 5 @using Dynamicweb.Frontend 6 7 @{ 8 ProductListViewModel productList = null; 9 if (Dynamicweb.Context.Current.Items.Contains("ProductList")) 10 { 11 productList = (ProductListViewModel)Dynamicweb.Context.Current.Items["ProductList"]; 12 } 13 } 14 15 @if (productList is object) { 16 string groupImage = productList?.Group?.Assets != null ? productList.Group.Assets.FirstOrDefault(x => x.Name == "LargeImage").Value : string.Empty; 17 if (groupImage.StartsWith("/") && !groupImage.StartsWith("/Files", StringComparison.OrdinalIgnoreCase)) 18 { 19 groupImage = $"/Files{groupImage}"; 20 } 21 22 string groupName = productList?.Group?.Name != null ? productList.Group.Name : string.Empty; 23 24 string ratio = Model.Item.GetRawValueString("ImageAspectRatio", string.Empty); 25 ratio = ratio != "0" ? ratio : string.Empty; 26 string ratioCssClass = ratio != string.Empty && ratio != "fill" ? " ratio" : string.Empty; 27 string ratioVariable = ratio != string.Empty ? "style=\"--bs-aspect-ratio: " + ratio + "\"" : string.Empty; 28 string fillClass = ratio == "fill" ? " h-100" : ""; 29 30 var parms = new Dictionary<string, object>(); 31 parms.Add("loading", "lazy"); 32 parms.Add("columns", Model.GridRowColumnCount); 33 34 if (ratio == "fill") { 35 parms.Add("cssClass", "w-100 h-100"); 36 } 37 else 38 { 39 parms.Add("cssClass", "mw-100 mh-100"); 40 } 41 42 parms.Add("style", string.Empty); 43 parms.Add("alt", groupName); 44 45 if (!string.IsNullOrEmpty(groupImage)) { 46 <div class="item_@Model.Item.SystemName.ToLower()" data-dw-colorscheme="@Model.ColorScheme?.Id"> 47 <figure class="m-0@(ratioCssClass)@(fillClass)" @ratioVariable> 48 @RenderPartial("Components/Image.cshtml", new FileViewModel { Path = groupImage }, parms) 49 </figure> 50 </div> 51 } else if (Pageview.IsVisualEditorMode) { 52 <div class="alert alert-dark m-0" role="alert"> 53 <span>@Translate("Product list group image: The image will be shown here, if any")</span> 54 </div> 55 } 56 } else if (Pageview.IsVisualEditorMode) 57 { 58 <div class="alert alert-dark m-0" role="alert"> 59 <span>@Translate("Product list group image: The image will be shown here, if any")</span> 60 </div> 61 } 62 63
Castelli Logo Bandana
Castelli Logo Bandana

Castelli Logo Bandana

113,27 kr. excl. VAT På lager
Cannondale Featherweight Jersey
Cannondale Featherweight Jersey

Cannondale Featherweight Jersey

333,27 kr. excl. VAT Ikke på lager
Pearl Izumi Women’s Whisper Vest
Pearl Izumi Women’s Whisper Vest

Pearl Izumi Women’s Whisper Vest

433,27 kr. excl. VAT På lager
Louis Garneau Atmos 2 Vest
Louis Garneau Atmos 2 Vest

Louis Garneau Atmos 2 Vest

233,27 kr. excl. VAT På lager
Shimano SH-R075 Road Shoe
Shimano SH-R075 Road Shoe

Shimano SH-R075 Road Shoe

399,93 kr. excl. VAT På lager
Performance Liberty City Cycling Cap
Performance Liberty City Cycling Cap

Performance Liberty City Cycling Cap

99,93 kr. excl. VAT På lager
Adidas adiStar Glove
Adidas adiStar Glove

Adidas adiStar Glove

206,67 kr. excl. VAT Ikke på lager
Performance Body-Secure Jersey DK
Performance Body-Secure Jersey  DK

Performance Body-Secure Jersey DK

566,67 kr. excl. VAT Ikke på lager
New Performance Elite Short
New Performance Elite Short

New Performance Elite Short

366,67 kr. excl. VAT På lager
Fox Mojave Glove
Fox Mojave Glove

Fox Mojave Glove

166,60 kr. excl. VAT Ikke på lager
Race Face Deus XC Glove
Race Face Deus XC Glove

Race Face Deus XC Glove

266,67 kr. excl. VAT På lager
Pearl Izumi MicroSensor Balaclava
Pearl Izumi MicroSensor Balaclava

Pearl Izumi MicroSensor Balaclava

166,67 kr. excl. VAT På lager
12 ud af 18 produkter
Hent flere produkter

Clothing