webbanner
Error executing template "Designs/Tefcold/eCom/ProductCatalog/basic_ListView.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at Tefcold.Web.CustomCode.Extensions.GroupExtension.ShortDescription(Group group)
   at CompiledRazorTemplates.Dynamic.RazorEngine_ec6b620699b24c3989459e737105298d.Execute() in E:\Solutions\Live\Tefcold.Web\Files\Templates\Designs\Tefcold\eCom\ProductCatalog\basic_ListView.cshtml:line 91
   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 Dynamicweb.Ecommerce 2 @using Dynamicweb.Rendering 3 @using Dynamicweb.Ecommerce.ProductCatalog 4 @using Dynamicweb.Ecommerce.International 5 @using Newtonsoft.Json.Linq 6 @using NLWI.Platforms.Dynamicweb9.Specs.ViewModels 7 @using NORRIQ.Common8.Razor 8 @using NORRIQ.Universal.Extensions 9 @using Tefcold.Web.CustomCode.AsyncProductList 10 @using Tefcold.Web.CustomCode.AsyncProductList.Models 11 @using Tefcold.Web.CustomCode.Extensions 12 @using Tefcold.Web.CustomCode.Razor 13 @using System.Web; 14 @inherits ViewModelTemplate<ProductListViewModel> 15 @{ 16 var modelPageSize = Model.PageSize; 17 string basicListViewPrefix = "PLP "; 18 Model.PrepareSpecifications(); 19 var group = Dynamicweb.Context.Current.Request["GroupID"] != null 20 ? Services.ProductGroups.GetGroup(Dynamicweb.Context.Current.Request["GroupID"]) 21 : null; 22 var url = System.Web.HttpContext.Current.Request.Url; 23 24 LanguageService languageService = new LanguageService(); 25 var languagesJson = Newtonsoft.Json.JsonConvert.SerializeObject(languageService.GetLanguages()); 26 } 27 28 @if (ProductPageFeedObserver.IsJsonFeed()) 29 { 30 @*@jsonProductList.ToString();*@ 31 var plp = new ProductListPage(Model, new HashSet<string> { "BulletPoints", "PrimaryImage", "WebPrimaryImage", "ExternalDimension", "GrossNetVolume", "ExternalDimensionWeb", "Stickers", "EnergyArrow", "EnergyLabel" }); 32 @plp.ToJSON() 33 } 34 else if (group?.ParentGroups.Count == 0 || (group?.ParentGroups.Count == 1 && group.ParentGroups.FirstOrDefault()?.Id == "25996-at-SHOP1")) 35 { 36 <section class="basic_listview basic_listview-groups"> 37 <header> 38 <h1>@group.Name</h1> 39 <p>@group.Description</p> 40 </header> 41 <div class="basic_listview-grid"> 42 @foreach (var subgroup in group.Subgroups) 43 { 44 <article> 45 <a href="@url.SetQuery("GroupID",subgroup.Id).PathAndQuery" itemprop="url"> 46 <figure style="min-height:1px;"> 47 @if (!string.IsNullOrEmpty(subgroup?.SmallImage)) 48 { 49 <img class="img-fluid" alt="@subgroup.GetDisplayName()" src="/Admin/Public/GetImage.ashx?Width=427&amp;Compression=85&amp;Crop=5&amp;Image=@subgroup.SmallImage" /> 50 } 51 else 52 { 53 <img class="img-fluid" alt="@subgroup.GetDisplayName()" src="/Admin/Public/GetImage.ashx?Width=427&amp;Compression=85&amp;Crop=5&amp;Image=/Files/Images/default.jpg" /> 54 } 55 56 </figure> 57 </a> 58 <header> 59 <h1 itemprop="name">@subgroup.GetDisplayName() @*<small>(@subgroup.ProductCount)</small>*@</h1> 60 </header> 61 </article> 62 } 63 </div> 64 </section> 65 66 } 67 else 68 { 69 70 var pdpLink = NORRIQ.Common8.Razor.Navigation.GetUrlByNavigationTag("plp"); 71 var query = Dynamicweb.Context.Current.Request["productsearch"]; 72 var groupName = group != null ? group.Name : Pageview.CurrentParagraph.Header; 73 74 <productlist-basic-listview default-grid-class="basic_listview-list" inline-template> 75 <div class="basic_listview" v-bind:class="{'initialized': initialized }"> 76 <template v-if="!queryLoading || pagination"> 77 <basic-facet-filter :facet-filters="facetFilter" v-if="facetFilter.length > 0"></basic-facet-filter> 78 <section> 79 <header> 80 <h1> 81 @if (query == null) 82 { 83 @groupName 84 } 85 else 86 { 87 @Translate(basicListViewPrefix + "Searchresult", "Searchresult") 88 <small>@query</small> 89 } 90 </h1> 91 @if (query == null && group != null && !string.IsNullOrEmpty(group.MegamenuImageTop()) || !string.IsNullOrEmpty(group.ShortDescription())) 92 { 93 <div class="plp-description"> 94 @if (!string.IsNullOrEmpty(group.MegamenuImageTop())) 95 { 96 <figure class="is-transparent"> 97 <img src="/Admin/Public/GetImage.ashx?Width=400&amp;Height=400&amp;Compression=85&amp;Crop=5&amp;fillcanvas=true&amp;Image=@group.MegamenuImageTop()" class="img-fluid" alt="@groupName" /> 98 </figure> 99 } 100 @if (!string.IsNullOrEmpty(group.ShortDescription())) 101 { 102 103 @group.ShortDescription() 104 105 } 106 </div> 107 } 108 </header> 109 <template v-if="productList.length > 0"> 110 <div class="basic_listview-controls"> 111 <div class="basic_listview-toggle"> 112 <div class="basic_listview-layout"> 113 <button v-on:click="setPlpGridClass('basic_listview-grid')" v-bind:class="plpGridClass == 'basic_listview-grid' ? 'active' : ''"> 114 <svg> 115 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/files/dist/icons/icons.svg#th"> 116 </use> 117 </svg> 118 <span class="sr-only">@Translate(basicListViewPrefix + "Grid", "Grid")</span> 119 </button> 120 <button v-on:click="setPlpGridClass('basic_listview-list')" v-bind:class="plpGridClass == 'basic_listview-list' ? 'active' : ''"> 121 <svg> 122 <use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/files/dist/icons/icons.svg#align-justify"> 123 </use> 124 </svg> 125 <span class="sr-only">@Translate(basicListViewPrefix + "List", "List")</span> 126 </button> 127 </div> 128 <button type="button" 129 class="btn-toggle" 130 v-b-toggle.sidebar-filter.sidebar-overlay 131 aria-label="@Translate(basicListViewPrefix + "Open filter", "Open filter")" 132 v-if="facetFilter.length > 0"> 133 @Translate(basicListViewPrefix + "Filter", "Filter") 134 <span></span> 135 </button> 136 </div> 137 </div> 138 </template> 139 <template v-if="!queryLoading && productList.length == 0"> 140 <p>@Translate(basicListViewPrefix + "No products", "No products in this category")</p> 141 </template> 142 143 <div :class="plpGridClass" id="plp" :key="forceRerender"> 144 <template> 145 <product v-for="(product, index) in getProductList" :initial-product="product" :plp-class="plpGridClass" :key="index"></product> 146 </template> 147 </div> 148 149 <footer> 150 <pagination v-if="pagination && ShowPagination && pagination.totalPages > '1'" :pagination="pagination" :threshold="3"></pagination> 151 @if (query == null && group != null && !string.IsNullOrEmpty(group.MegamenuImageBottom()) || !string.IsNullOrEmpty(group.MegamenuHeaderBottom()) || !string.IsNullOrEmpty(group.MegamenuHeaderBottom2()) || !string.IsNullOrEmpty(group.MegamenuTextBottom()) || !string.IsNullOrEmpty(group.MegamenuTextBottom2())) 152 { 153 <div class="plp-description"> 154 @if (!string.IsNullOrEmpty(group.MegamenuImageBottom())) 155 { 156 <figure class="is-right"> 157 <img src="/Admin/Public/GetImage.ashx?Width=400&amp;Compression=85&amp;Crop=5&amp;Image=@group.MegamenuImageBottom()" class="img-fluid" alt="@groupName" /> 158 </figure> 159 } 160 @if (!string.IsNullOrEmpty(group.MegamenuHeaderBottom()) || !string.IsNullOrEmpty(group.MegamenuHeaderBottom2()) || !string.IsNullOrEmpty(group.MegamenuTextBottom()) || !string.IsNullOrEmpty(group.MegamenuTextBottom2())) 161 { 162 163 if (!string.IsNullOrEmpty(group.MegamenuHeaderBottom())) 164 { 165 <h2>@group.MegamenuHeaderBottom()</h2> 166 } 167 if (!string.IsNullOrEmpty(group.MegamenuTextBottom())) 168 { 169 @group.MegamenuTextBottom() 170 } 171 if (!string.IsNullOrEmpty(group.MegamenuHeaderBottom2())) 172 { 173 <h3> 174 @group.MegamenuHeaderBottom2() 175 </h3> 176 } 177 if (!string.IsNullOrEmpty(group.MegamenuTextBottom2())) 178 { 179 @group.MegamenuTextBottom2() 180 } 181 182 } 183 </div> 184 } 185 </footer> 186 </section> 187 </template> 188 <div class="basic_listview-overlay" v-bind:class="queryLoading && pagination ? 'active' : ''"> 189 <span class="spinner-xl-light"></span> 190 </div> 191 <template v-if="queryLoading && !pagination"> 192 <div class="basic_listview-loader text-center"> 193 <span class="spinner-xl-default"></span> 194 </div> 195 </template> 196 197 </div> 198 </productlist-basic-listview> 199 }