Error executing template "Designs/Swift/Paragraph/Swift_ProductListGroupPoster.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_88e93fe859f14ecbbb59690d95193dce.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)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

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 else if (Pageview.Page.Item["DummyProductGroup"] != null && Pageview.IsVisualEditorMode) 14 { 15 var pageViewModel = Dynamicweb.Frontend.ContentViewModelFactory.CreatePageInfoViewModel(Pageview.Page); 16 ProductListViewModel groupList = pageViewModel.Item.GetValue("DummyProduct") != null ? pageViewModel.Item.GetValue("DummyProduct") as ProductListViewModel : new ProductListViewModel(); 17 18 if (groupList?.Products is object) 19 { 20 productList = groupList; 21 } 22 } 23 } 24 25 @if (productList is object) 26 { 27 string layout = Model.Item.GetRawValueString("Layout", "align-middle-center-text-center"); 28 string alignment = ""; 29 30 string searchParameter = Dynamicweb.Context.Current.Request.GetString("q"); 31 32 bool hideTitle = Model.Item.GetBoolean("HideGroupTitle"); 33 string titleFontSize = Model.Item.GetRawValueString("TitleFontSize", "display-4"); 34 35 string groupName = productList?.Group?.Name != null ? productList.Group.Name : ""; 36 string headerName = searchParameter != "" ? Translate("Search results for") + ": " + searchParameter : groupName; 37 38 bool hideDescription = Model.Item.GetBoolean("HideGroupDescription"); 39 string groupDescription = productList?.Group?.Description != null ? productList.Group.Description : ""; 40 string descriptionFontSize = Model.Item.GetRawValueString("DescriptionFontSize", "fs-6"); 41 42 string groupImage = productList?.Group?.Assets != null ? productList.Group.Assets.FirstOrDefault(x => x.Name == "LargeImage").Value : ""; 43 if (groupImage.StartsWith("/") && !groupImage.StartsWith("/Files", StringComparison.OrdinalIgnoreCase)) 44 { 45 groupImage = $"/Files{groupImage}"; 46 } 47 48 string posterHeight = Model.Item.GetRawValueString("PosterHeight", ""); 49 posterHeight = posterHeight == "small" ? "min-vh-25" : posterHeight; 50 posterHeight = posterHeight == "medium" ? "min-vh-50" : posterHeight; 51 posterHeight = posterHeight == "large" ? "min-vh-75" : posterHeight; 52 53 string contentPadding = Model.Item.GetRawValueString("ContentPadding", ""); 54 contentPadding = contentPadding == "none" ? "p-3 px-xl-3 py-xl-4" : contentPadding; 55 contentPadding = contentPadding == "small" ? "p-3 p-xl-4" : contentPadding; 56 contentPadding = contentPadding == "large" ? "p-4 p-xl-5" : contentPadding; 57 58 string maxWidth = Model.Item.GetRawValueString("TextReadability", "max-width-on"); 59 maxWidth = maxWidth == "max-width-on" ? " mw-75ch" : maxWidth; 60 maxWidth = maxWidth == "max-width-off" ? "" : maxWidth; 61 62 string theme = !string.IsNullOrWhiteSpace(Model.Item.GetRawValueString("Theme")) ? " theme " + Model.Item.GetRawValueString("Theme").Replace(" ", "").Trim().ToLower() : ""; 63 64 if (!string.IsNullOrEmpty(groupImage)) 65 { 66 var parms = new Dictionary<string, object>(); 67 parms.Add("cssClass", "h-100 w-100"); 68 parms.Add("columns", Model.GridRowColumnCount); 69 70 parms.Add("fullwidth", true); 71 72 switch (layout) 73 { 74 case "align-top-left-text-left": 75 alignment = "text-start justify-content-start align-items-start"; 76 break; 77 case "align-top-center-text-center": 78 alignment = "text-center justify-content-center align-items-start"; 79 break; 80 case "align-top-right-text-right": 81 alignment = "text-end justify-content-end align-items-start"; 82 break; 83 case "align-middle-left-text-left": 84 alignment = "text-start justify-content-start align-items-center"; 85 break; 86 case "align-middle-center-text-center": 87 alignment = "text-center justify-content-center align-items-center"; 88 break; 89 case "align-middle-right-text-right": 90 alignment = "text-end justify-content-end align-items-center"; 91 break; 92 case "align-bottom-left-text-left": 93 alignment = "text-start justify-content-start align-items-end"; 94 break; 95 case "align-bottom-center-text-center": 96 alignment = "text-center justify-content-center align-items-end"; 97 break; 98 case "align-bottom-right-text-right": 99 alignment = "text-end justify-content-end align-items-end"; 100 break; 101 } 102 103 <div class="position-relative h-100@(theme) @(posterHeight) item_@Model.Item.SystemName.ToLower()"> 104 @if (!string.IsNullOrEmpty(groupImage)) 105 { 106 string imageFilter = Model.Item.GetRawValueString("ImageFilter", ""); 107 imageFilter = imageFilter == "no-filter" ? "" : imageFilter; 108 imageFilter = imageFilter == "filter" ? " image-filter" : imageFilter; 109 110 <div class="position-absolute top-0 bottom-0 end-0 start-0@(imageFilter)"> 111 @RenderPartial("Components/Image.cshtml", new FileViewModel { Path = groupImage }, parms) 112 </div> 113 } 114 115 @if (!hideTitle || !hideDescription) 116 { 117 <div class="container-xl h-100 @(contentPadding)"> 118 <div class="h-100 w-100 position-relative d-flex @(alignment)"> 119 <div class="@(maxWidth)"> 120 @if (!hideTitle) 121 { 122 <h1 class="@titleFontSize">@headerName</h1> 123 } 124 125 @if (!hideDescription && !string.IsNullOrEmpty(groupDescription)) 126 { 127 <div class="@descriptionFontSize mb-0-last-child"> 128 @groupDescription 129 </div> 130 } 131 </div> 132 </div> 133 </div> 134 } 135 136 </div> 137 } 138 else if (Pageview.IsVisualEditorMode) 139 { 140 <div class="alert alert-dark m-0" role="alert"> 141 <span>@Translate("Product group poster: The poster paragraph will be shown here, if any")</span> 142 </div> 143 } 144 } 145 else if (Pageview.IsVisualEditorMode) 146 { 147 <div class="alert alert-dark m-0" role="alert"> 148 <span>@Translate("Product group poster: The poster paragraph will be shown here, if any")</span> 149 </div> 150 } 151
Hugo Boss Hugo Man Deodorant Spray, 150 ml.
Hugo Boss Hugo Man Deodorant Spray, 150 ml.
-67%

Hugo Boss Hugo Man Deodorant Spray, 150 ml.

235,00 kr.
77,00 kr.
OutOfStock
ZarkoPerfume Buddha-Wood EDP, 100 ml.
ZarkoPerfume Buddha-Wood EDP, 100 ml.
-39%

ZarkoPerfume Buddha-Wood EDP, 100 ml.

890,00 kr.
545,00 kr.
InStock
American Crew Grooming Cream, 85 gr.
American Crew Grooming Cream, 85 gr.
-57%

American Crew Grooming Cream, 85 gr.

245,00 kr.
105,00 kr.
InStock
Maria Nila Ocean Spray, 150 ml.
Maria Nila Ocean Spray, 150 ml.
-30%

Maria Nila Ocean Spray, 150 ml.

209,00 kr.
146,00 kr. InStock
Vichy Homme Antiperspirant Deo Roll-On 48h Anti-Mark, 50 ml.
Vichy Homme Antiperspirant Deo Roll-On 48h Anti-Mark, 50 ml.
-43%

Vichy Homme Antiperspirant Deo Roll-On 48h Anti-Mark, 50 ml.

139,00 kr.
79,00 kr.
InStock
VICHY Homme Deodorant Extreme Anti Perspirant Roll On, 50 ml.
VICHY Homme Deodorant Extreme Anti Perspirant Roll On, 50 ml.
-43%

VICHY Homme Deodorant Extreme Anti Perspirant Roll On, 50 ml.

139,00 kr.
79,00 kr.
InStock
American Crew Forming Cream, 50 g.
American Crew Forming Cream, 50 g.
-29%

American Crew Forming Cream, 50 g.

100,00 kr.
71,00 kr.
InStock
Vichy Homme Barberskum, 200 ml.
Vichy Homme Barberskum, 200 ml.
-30%

Vichy Homme Barberskum, 200 ml.

130,00 kr.
91,00 kr. InStock
American Crew Fiber Voks, 85 gr.
American Crew Fiber Voks, 85 gr.
-60%

American Crew Fiber Voks, 85 gr.

245,00 kr.
99,00 kr.
InStock
American Crew Matte Clay Spray, 150 ml.
American Crew Matte Clay Spray, 150 ml.
-82%

American Crew Matte Clay Spray, 150 ml.

275,00 kr.
49,00 kr.
InStock
American Crew King Molding Clay, 85 g.
American Crew King Molding Clay, 85 g.
-61%

American Crew King Molding Clay, 85 g.

259,00 kr.
100,00 kr.
InStock
Versace Eros Pour Homme Parfum Natural Spray, 100 ml.
Versace Eros Pour Homme Parfum Natural Spray, 100 ml.
-32%

Versace Eros Pour Homme Parfum Natural Spray, 100 ml.

1030,00 kr.
696,00 kr.
InStock
Mauboussin Pour Lui Deodorant Spray, 200 ml.
Mauboussin Pour Lui Deodorant Spray, 200 ml.
-65%

Mauboussin Pour Lui Deodorant Spray, 200 ml.

99,00 kr.
35,00 kr.
InStock
American Crew Classic New Pomade, 50 g.
American Crew Classic New Pomade, 50 g.
-50%

American Crew Classic New Pomade, 50 g.

130,00 kr.
65,00 kr. InStock
CLEAN Reserve Radiant Nectar EDP, 100 ml.
CLEAN Reserve Radiant Nectar EDP, 100 ml.
-50%

CLEAN Reserve Radiant Nectar EDP, 100 ml.

850,00 kr.
425,00 kr. InStock
d:fi Extreme Hold Styling Cream, 150 g.
d:fi Extreme Hold Styling Cream, 150 g.
-60%

d:fi Extreme Hold Styling Cream, 150 g.

257,00 kr.
103,00 kr. InStock
Vichy Homme 48H Optimal Tolerance Sensitive Deo Spray, 100 ml.
Vichy Homme 48H Optimal Tolerance Sensitive Deo Spray, 100 ml.
-30%

Vichy Homme 48H Optimal Tolerance Sensitive Deo Spray, 100 ml.

135,00 kr.
94,00 kr. InStock
American Crew Firm Hold Styling Gel, 100 ml.
American Crew Firm Hold Styling Gel, 100 ml.
-84%

American Crew Firm Hold Styling Gel, 100 ml.

175,00 kr.
28,00 kr.
InStock
American Crew Anti-Hairloss Shampoo, 250 ml.
American Crew Anti-Hairloss Shampoo, 250 ml.
-50%

American Crew Anti-Hairloss Shampoo, 250 ml.

200,00 kr.
99,00 kr.
InStock
Issey Miyake L'Eau D'Issey Pour Homme Eau & Cedre Intense EdT, 100 ml.
Issey Miyake L'Eau D'Issey Pour Homme Eau & Cedre Intense EdT, 100 ml.
-61%

Issey Miyake L'Eau D'Issey Pour Homme Eau & Cedre Intense EdT, 100 ml.

895,00 kr.
353,00 kr.
InStock
Calvin Klein FREE Deo stick, 75 ml.
Calvin Klein FREE Deo stick, 75 ml.
-53%

Calvin Klein FREE Deo stick, 75 ml.

210,00 kr.
99,00 kr.
InStock
Calvin Klein CK Be EDT, 200 ml.
Calvin Klein CK Be EDT, 200 ml.
-59%

Calvin Klein CK Be EDT, 200 ml.

639,00 kr.
259,00 kr.
InStock
American Crew Classic 3in1 Chamomile & Pine, 250 ml.
American Crew Classic 3in1 Chamomile & Pine, 250 ml.
-58%

American Crew Classic 3in1 Chamomile & Pine, 250 ml.

190,00 kr.
79,00 kr.
InStock
American Crew Beard Balm, 50 g.
American Crew Beard Balm, 50 g.
-61%

American Crew Beard Balm, 50 g.

215,00 kr.
83,00 kr.
InStock
American Crew Daily Silver Shampoo, 250 ml.
American Crew Daily Silver Shampoo, 250 ml.
-50%

American Crew Daily Silver Shampoo, 250 ml.

200,00 kr.
100,00 kr. InStock
American Crew Shaving Skincare Precision Shave Gel, 150 ml. (U)
American Crew Shaving Skincare Precision Shave Gel, 150 ml. (U)
-54%

American Crew Shaving Skincare Precision Shave Gel, 150 ml. (U)

175,00 kr.
80,00 kr.
InStock
CLEAN Reserve Radiant Nectar EDP, 50 ml.
CLEAN Reserve Radiant Nectar EDP, 50 ml.
-50%

CLEAN Reserve Radiant Nectar EDP, 50 ml.

580,00 kr.
289,00 kr.
InStock
Carolina Herrera 212 Vip Black Edp, 100 ml.
Carolina Herrera 212 Vip Black Edp, 100 ml.
-20%

Carolina Herrera 212 Vip Black Edp, 100 ml.

829,00 kr.
662,00 kr.
InStock
Lacoste L.12.12 Blanc Eau Fraiche EdT, 50 ml.
Lacoste L.12.12 Blanc Eau Fraiche EdT, 50 ml.
-50%

Lacoste L.12.12 Blanc Eau Fraiche EdT, 50 ml.

465,00 kr.
234,00 kr.
OutOfStock
Waterclouds Beard Wash, 150 ml.
Waterclouds Beard Wash, 150 ml.
-30%

Waterclouds Beard Wash, 150 ml.

199,00 kr.
140,00 kr.
InStock
Mauboussin Star For Men EDP, 90 ml.
Mauboussin Star For Men EDP, 90 ml.
-50%

Mauboussin Star For Men EDP, 90 ml.

540,00 kr.
270,00 kr. InStock
Osmo Pomade Hold, 100 ml.
Osmo Pomade Hold, 100 ml.
-50%

Osmo Pomade Hold, 100 ml.

110,00 kr.
55,00 kr. InStock
American Crew Light Hold Styling Gel, 250 ml.
American Crew Light Hold Styling Gel, 250 ml.
-80%

American Crew Light Hold Styling Gel, 250 ml.

199,00 kr.
40,00 kr.
OutOfStock
American Crew 3-in-1 Tea Tree, 450 ml.
American Crew 3-in-1 Tea Tree, 450 ml.
-55%

American Crew 3-in-1 Tea Tree, 450 ml.

219,00 kr.
98,00 kr.
InStock
American Crew Cream Pomade, 85 gr.
American Crew Cream Pomade, 85 gr.
-63%

American Crew Cream Pomade, 85 gr.

270,00 kr.
99,00 kr.
InStock
American Crew Daily Deep Moisturizing Shampoo, 250 ml.
American Crew Daily Deep Moisturizing Shampoo, 250 ml.
-55%

American Crew Daily Deep Moisturizing Shampoo, 250 ml.

200,00 kr.
90,00 kr.
InStock
36 ud af 213 produkter
Hent flere produkter