Skip to main content
Error executing template "Designs/keflico/eCom/Productlist/products.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaf4a787586743c0b121ec303ae0e658.FindTopGroup(Group group) in D:\dynamicweb.net\Solutions\Gotcha\keflico.cloud.dynamicweb-cms.com\Files\Templates\Designs\keflico\eCom\Productlist\products.cshtml:line 509
   at CompiledRazorTemplates.Dynamic.RazorEngine_aaf4a787586743c0b121ec303ae0e658.Execute() in D:\dynamicweb.net\Solutions\Gotcha\keflico.cloud.dynamicweb-cms.com\Files\Templates\Designs\keflico\eCom\Productlist\products.cshtml:line 139
   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.<RunCompile>b__0(TextWriter writer)
   at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
   at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
   at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
   at Dynamicweb.Rendering.Template.RenderRazorTemplate()

1 @using System.Web; 2 @using Dynamicweb.Ecommerce; 3 4 @{ 5 string AllProductsPage = Pageview.Area.Item["AllProductsPage"].ToString(); 6 bool isloggedin = false; 7 8 string sortBy = GetString("Ecom:ProductList.SortBy"); 9 string sortOrder = GetString("Ecom:ProductList.SortOrder"); 10 11 bool isStandardSorting = string.IsNullOrWhiteSpace(HttpContext.Current.Request.QueryString["Sortby"]); 12 13 if (!string.IsNullOrWhiteSpace(GetGlobalValue("Global:Extranet.UserName").ToString())) { 14 isloggedin = true; 15 } 16 } 17 18 <header class="header header-overview module module-sand-light"> 19 <div class="breadcrumbs"> 20 @RenderNavigation(new { 21 StartLevel = 1, 22 EndLevel = 4, 23 ExpandMode = "Pathonly", 24 Template = "breadcrumbs.xslt" 25 }) 26 </div> 27 @if(String.IsNullOrWhiteSpace(GetString("Ecom:ProductList:Page.GroupID"))) { 28 <h1 class="header__title">@Translate("Translate_TopLevelGroup_Headline")</h1> 29 <p>@Translate("Translate_TopLevelGroup_Text")</p> 30 } else { 31 <h1 class="header__title">@GetString("Ecom:Group.Name")</h1> 32 33 if(!String.IsNullOrWhiteSpace(GetString("Ecom:Group.Description"))) { 34 @GetString("Ecom:Group.Description") 35 } 36 } 37 38 </header> 39 40 @if(GetLoop("ProductGroups").Count() > 0 && String.IsNullOrWhiteSpace(GetString("Ecom:ProductList:Page.GroupID"))) { 41 <section class="category-page module module-sand"> 42 <article class="card-list__wrapper"> 43 <a href="@AllProductsPage" class="all-link"> 44 @Translate("Translate_ProductList_SeeAllProducts") 45 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.006 11.031"> 46 <g class="arrow" transform="translate(441 901.014) rotate(180)"> 47 <path class="angle" d="M-17182.074-20447.988l4.809-4.809,4.809,4.809" transform="translate(20875.289 -16281.768) rotate(-90)" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/> 48 <line class="line" x2="17" transform="translate(423.5 895.5)" stroke-linecap="round" stroke-width="1"/> 49 </g> 50 </svg> 51 </a> 52 <ul class="card-list"> 53 @foreach (var group in GetLoop("ProductGroups")) { 54 bool show = group.GetBoolean("Ecom:Group.ShowInMenu"); 55 if(show) { 56 string groupLink = "/Default.aspx?Id=" + Pageview.Page.ID + "&GroupID=" + group.GetString("Ecom:Group.ID"); 57 string groupName = group.GetString("Ecom:Group.Name"); 58 string groupImage = group.GetString("Ecom:Group.LargeImage"); 59 string groupImageLg = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=665&Height=665&Crop=0&Compression=100"; 60 string groupImageMd = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=512&Height=512&Crop=0&Compression=100"; 61 string groupImageSm = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=415&Height=415&Crop=0&Compression=100"; 62 string groupImageDefault = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=620&Height=620&Crop=0&Compression=100"; 63 64 <li class="card-list__card"> 65 <a href="@groupLink" class="card__wrapper"> 66 <picture class="card__picture"> 67 <source srcset="@groupImageLg" media="(min-width: 1536px)"> 68 <source srcset="@groupImageMd" media="(min-width: 992px)"> 69 <source srcset="@groupImageSm" media="(min-width: 768px)"> 70 <img src="@groupImageDefault" alt="@groupName"> 71 </picture> 72 <ul class="card__info-list"> 73 <li class="card__info-list__item"> 74 <span class="info info--large">@groupName</span> 75 </li> 76 </ul> 77 </a> 78 </li> 79 } 80 81 } 82 </ul> 83 </article> 84 </section> 85 } else if(GetLoop("Subgroups").Count() > 0) { 86 var currentGroup = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(GetString("Ecom:Group.ID")); 87 var currentToplevel = FindTopGroup(currentGroup); 88 string allLink = AllProductsPage + "&Group=" + currentGroup.Name; 89 90 <section class="category-page module module-sand"> 91 <article class="card-list__wrapper"> 92 <a href="@allLink" class="all-link"> 93 @Translate("Translate_ProductList_SeeAllProducts") 94 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 19.006 11.031"> 95 <g class="arrow" transform="translate(441 901.014) rotate(180)"> 96 <path class="angle" d="M-17182.074-20447.988l4.809-4.809,4.809,4.809" transform="translate(20875.289 -16281.768) rotate(-90)" stroke-linecap="round" stroke-linejoin="round" stroke-width="1"/> 97 <line class="line" x2="17" transform="translate(423.5 895.5)" stroke-linecap="round" stroke-width="1"/> 98 </g> 99 </svg> 100 </a> 101 <ul class="card-list"> 102 @foreach (var group in GetLoop("Subgroups")) { 103 bool show = group.GetBoolean("Ecom:Group.ShowInMenu"); 104 if(show) { 105 string groupLink = "/Default.aspx?Id=" + Pageview.Page.ID + "&GroupID=" + group.GetString("Ecom:Group.ID"); 106 string groupName = group.GetString("Ecom:Group.Name"); 107 string groupImage = group.GetString("Ecom:Group.LargeImage"); 108 string groupImageLg = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=665&Height=665&Crop=0&Compression=100"; 109 string groupImageMd = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=512&Height=512&Crop=0&Compression=100"; 110 string groupImageSm = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=415&Height=415&Crop=0&Compression=100"; 111 string groupImageDefault = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(groupImage) + "&Width=620&Height=620&Crop=0&Compression=100"; 112 113 if(groupName.ToLower().Contains("alle") || groupName.ToLower().Contains("all")) { 114 groupLink = allLink; 115 } 116 117 <li class="card-list__card"> 118 <a href="@groupLink" class="card__wrapper"> 119 <picture class="card__picture"> 120 <source srcset="@groupImageLg" media="(min-width: 1536px)"> 121 <source srcset="@groupImageMd" media="(min-width: 992px)"> 122 <source srcset="@groupImageSm" media="(min-width: 768px)"> 123 <img src="@groupImageDefault" alt="@groupName"> 124 </picture> 125 <ul class="card__info-list"> 126 <li class="card__info-list__item"> 127 <span class="info info--large">@groupName</span> 128 </li> 129 </ul> 130 </a> 131 </li> 132 } 133 } 134 </ul> 135 </article> 136 </section> 137 } else { 138 var currentGroup = Dynamicweb.Ecommerce.Services.ProductGroups.GetGroup(GetString("Ecom:Group.ID")); 139 var currentToplevel = FindTopGroup(currentGroup); 140 141 <section class="module module-sand product-overview"> 142 <aside id="productFilters" class="filter-section" data-group="@currentGroup.Id" data-top-group="@currentToplevel.Name" data-all="false"> 143 <div class="filter-section__header"> 144 <h3>@Translate("Translate_ProductList_FilterHeadline")</h3> 145 146 <div class="filter-section__exit" id="filter-article-close"> 147 <svg xmlns="http://www.w3.org/2000/svg" width="10.819" height="10.819" viewBox="0 0 10.819 10.819"> 148 <g id="Group_1017" data-name="Group 1017" transform="translate(-1.591 2.559)"> 149 <rect id="Rectangle_702" data-name="Rectangle 702" width="14" height="1.3" rx="0.65" transform="translate(1.591 7.341) rotate(-45)"/> 150 <rect id="Rectangle_703" data-name="Rectangle 703" width="14" height="1.3" rx="0.65" transform="translate(2.51 -2.559) rotate(45)"/> 151 </g> 152 </svg> 153 </div> 154 </div> 155 <ul v-if="showFilters" class="filter-section__filter-list"> 156 <li v-for="facet in facets" v-if="((facet.QueryParameter != 'Group' && currentGroup && !allProducts) || allProducts) && sortedOptions(facet.Options).length > 1" :class="'filter-item filter-item--' + facet.RenderType.toLowerCase()"> 157 <template v-if="facet.RenderType.toLowerCase() != 'range'"> 158 <input class="filter-item__checkbox-toggle" type="checkbox" :id="facet.QueryParameter" aria-checked="true"> 159 <label class="filter-item__header" :for="facet.QueryParameter"> 160 <span class="filter-item__header__title">{{ translation('Translate_ProductList_Filter_' + facet.QueryParameter) }}</span> 161 </label> 162 </template> 163 164 <div class="filter-item__body"> 165 <ul class="filter-item__input-list"> 166 <template v-if="facet.RenderType.toLowerCase() == 'range'"> 167 <li class="input-list__filter"> 168 <label for="filter-length">{{ translation('Translate_ProductList_Filter_' + facet.QueryParameter.replace('Start', '')) }}</label> 169 <div class="duo-range-slider"> 170 <input class="duo-range-slider__range filter-option" :data-name="facet.QueryParameter" :name="facet.QueryParameter" :value="getLowestValue(facet.Options)" :min="getLowestValue(facet.Options)" :max="getHighestValue(facet.Options)" step="1" type="range"> 171 <input class="duo-range-slider__range filter-option" :data-name="facet.QueryParameter.replace('Start', 'End')" :name="facet.QueryParameter.replace('Start', 'End')" :value="getHighestValue(facet.Options)" :min="getLowestValue(facet.Options)" :max="getHighestValue(facet.Options)" step="1" type="range"> 172 <div class="duo-range-slider__values"> 173 <div class="duo-range-slider__values-min"><span>{{ facet.Options[0].Value }}</span> mm</div> 174 <div class="duo-range-slider__values-max"><span>{{ facet.Options.at(-1).Value }}</span> mm</div> 175 </div> 176 </div> 177 </li> 178 </template> 179 <template v-else-if="facet.RenderType.toLowerCase() == 'select'"> 180 <li class="input-list__filter"> 181 <div class="search-select"> 182 <div class="search-select__search"> 183 <input class="search-select__search-input" type="search" :placeholder="translation('Translate_General_SearchFor') + ' ' + translation('Translate_ProductList_Filter_' + facet.QueryParameter)"> 184 <button class="search-select__search-clear" type="button">@Translate("Translate_Close")</button> 185 </div> 186 <div class="search-select__dropdown"> 187 <label v-for="option in sortedOptions(facet.Options)" class="search-select__dropdown-item" :for="option.Value">{{ option.Value }}</label> 188 </div> 189 <div class="search-select__tags"> 190 <template v-for="option in sortedOptions(facet.Options)"> 191 <input type="checkbox" class="filter-option" :data-name="facet.QueryParameter" :name="facet.QueryParameter + stringAddition(facet.QueryParameterType)" :value="option.Value" :id="option.Value"> 192 <label :for="option.Value">{{ option.Label }}</label> 193 </template> 194 </div> 195 </div> 196 </li> 197 </template> 198 <template v-else> 199 <li class="input-list__filter"> 200 <div v-for="option in sortedOptions(facet.Options)" class="form__fieldset"> 201 <div class="form__field-wrap"> 202 <input type="checkbox" class="form__field form__field--checkbox filter-option" :data-name="facet.QueryParameter" :name="facet.QueryParameter + stringAddition(facet.QueryParameterType)" :value="option.Value" :id="option.Value"> 203 <label :for="option.Value">{{ option.Label }}</label> 204 </div> 205 </div> 206 </li> 207 </template> 208 </ul> 209 </div> 210 </li> 211 </ul> 212 <div class="filter-section__footer"> 213 <div class="footer-controls"> 214 <button id="clearFilterButton" class="btn btn-link">@Translate("Translate_ProductList_ResetFilters")</button> 215 <button id="applyFilterButton" class="btn btn-secondary btn--small">@Translate("Translate_ProductList_ApplyFilters")</button> 216 </div> 217 </div> 218 </aside> 219 <article class="card-list__wrapper"> 220 <div class="card-list__header"> 221 <div class="form__fieldset mobile-only"> 222 <button class="btn btn-secondary" id="toggle-filter-btn"> 223 @Translate("Translate_Filter") 224 </button> 225 </div> 226 <div class="form__fieldset"> 227 <label for="sorting" class="select-label">@Translate("Translate_ProductList_SortBy")</label> 228 <select class="form__field--narrow form__field-wrap--select" id="sorting"> 229 <option value="default">@Translate("Translate_ProductList_SortOption_Highlighted")</option> 230 <option value="asc"@(!isStandardSorting && sortOrder.ToLower() == "asc" ? "selected" : "")>@Translate("Translate_ProductList_SortOption_Alphabetic")</option> 231 <option value="desc" @(!isStandardSorting && sortOrder.ToLower() == "desc" ? "selected" : "")>@Translate("Translate_ProductList_SortOption_ReverseAlpabetic")</option> 232 </select> 233 </div> 234 </div> 235 <ul class="card-list"> 236 @foreach(var product in GetLoop("Products")) { 237 string link = product.GetString("Ecom:Product.Link.Clean"); 238 string name = product.GetString("Ecom:Product.Name"); 239 string teaser = product.GetString("Ecom:Product:Field.Name2.Value.Clean"); 240 string productNumber = product.GetString("Ecom:Product.Number"); 241 string dbNumberLabel = product.GetString("Ecom:Product:Field.ProductDbNumber.Name"); 242 string dbNumber = product.GetString("Ecom:Product:Field.ProductDbNumber.Value"); 243 string primaryGroup = product.GetString("Ecom:Product.PrimaryGroupID").ToLower(); 244 var productLayout = !string.IsNullOrWhiteSpace(product.GetString("Ecom:Product:Field.ProductLayout")) ? product.GetString("Ecom:Product:Field.ProductLayout") : primaryGroup; 245 246 bool isBundleOnly = System.Convert.ToBoolean(product.GetString("Ecom:Product:Field.BundleOnly")); 247 bool usePriceExplanation = false; 248 249 string primaryPrice = product.GetString("Ecom:Product.Price.PriceWithoutVAT"); 250 string secondaryPrice = ""; 251 string tertiaryPrice = ""; 252 string primaryPriceDescription = ""; 253 string secondaryPriceDescription = ""; 254 string tertiaryPriceDescription = ""; 255 256 string priceCurrencySymbol = product.GetString("Ecom:Product.Currency.Symbol"); 257 string salesUnit = product.GetString("Ecom:Product.DefaultUnitName").ToLower(); 258 string salesUnitCode = product.GetString("Ecom:Product:Field.ProductLengthUnitCode"); 259 260 string productImage = product.GetString("Ecom:Product.ImageDefault.Clean"); 261 string productImageLg = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(productImage) + "&Width=416&Height=371&Crop=0&Compression=100"; 262 string productImageMd = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(productImage) + "&Width=310&Height=277&Crop=0&Compression=100"; 263 string productImageSm = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(productImage) + "&Width=230&Height=205&Crop=0&Compression=100"; 264 string productImageDefault = "/admin/public/getimage.ashx?Image=" + HttpUtility.UrlEncode(productImage) + "&Width=340&Height=304&Crop=0&Compression=100"; 265 266 switch(productLayout) { 267 case "group1": 268 if(isBundleOnly) { 269 primaryPrice = ""; 270 } 271 272 secondaryPrice = product.GetString("Ecom:Product:Field.ProductPriceBundle.Value").Replace(",", "-").Replace(".", ",").Replace("-", "."); 273 274 primaryPriceDescription = Translate("Translate_ProductDecription_Hardwood_Anbrud"); 275 secondaryPriceDescription = Translate("Translate_ProductDecription_Hardwood_Bundt"); 276 277 if(secondaryPrice.Contains(",")) { 278 string[] sp = secondaryPrice.Split(','); 279 280 if(sp[1].Length == 1) { 281 secondaryPrice += "0"; 282 } 283 } else { 284 secondaryPrice += ",00"; 285 } 286 287 break; 288 289 case "group32": 290 secondaryPrice = product.GetString("Ecom:Product:Field.ProductPriceAbove100SQM"); 291 292 primaryPriceDescription = Translate("Translate_ProductDecription_Terrase_Anbrud"); 293 secondaryPriceDescription = Translate("Translate_ProductDecription_Terrase_Above"); 294 295 usePriceExplanation = true; 296 297 if(secondaryPrice.Contains(",")) { 298 string[] sp = secondaryPrice.Split(','); 299 300 if(sp[1].Length == 1) { 301 secondaryPrice += "0"; 302 } 303 } else { 304 secondaryPrice += ",00"; 305 } 306 307 break; 308 309 case "group73": 310 secondaryPrice = product.GetString("Ecom:Product:Field.ProductPriceAbove100SQM"); 311 tertiaryPrice = product.GetString("Ecom:Product:Field.ProductPriceAbove3000M.Value").Replace(".", ","); 312 313 primaryPriceDescription = Translate("Translate_ProductDecription_Facade_Under1000"); 314 secondaryPriceDescription = Translate("Translate_ProductDecription_Facade_Between1000and3000"); 315 tertiaryPriceDescription = Translate("Translate_ProductDecription_Facade_Above3000"); 316 317 usePriceExplanation = true; 318 319 if(secondaryPrice.Contains(",")) { 320 string[] sp = secondaryPrice.Split(','); 321 322 if(sp[1].Length == 1) { 323 secondaryPrice += "0"; 324 } 325 } else { 326 secondaryPrice += ",00"; 327 } 328 329 if(tertiaryPrice.Contains(",")) { 330 string[] tp = tertiaryPrice.Split(','); 331 332 if(tp[1].Length == 1) { 333 tertiaryPrice += "0"; 334 } 335 } else { 336 tertiaryPrice += ",00"; 337 } 338 339 break; 340 341 case "group52": 342 case "group66": 343 secondaryPrice = product.GetString("Ecom:Product:Field.ProductPriceHalfParcel").Replace(",", "-").Replace(".", ",").Replace("-", "."); 344 tertiaryPrice = product.GetString("Ecom:Product:Field.ProductPriceCompleteParcel").Replace(",", "-").Replace(".", ",").Replace("-", "."); 345 346 primaryPriceDescription = Translate("Translate_ProductDecription_Plader_Anbrud"); 347 secondaryPriceDescription = Translate("Translate_ProductDecription_Plader_Half"); 348 tertiaryPriceDescription = Translate("Translate_ProductDecription_Plader_Full"); 349 350 if(secondaryPrice.Contains(",")) { 351 string[] sp = secondaryPrice.Split(','); 352 353 if(sp[1].Length == 1) { 354 secondaryPrice += "0"; 355 } 356 } else { 357 secondaryPrice += ",00"; 358 } 359 360 if(tertiaryPrice.Contains(",")) { 361 string[] tp = tertiaryPrice.Split(','); 362 363 if(tp[1].Length == 1) { 364 tertiaryPrice += "0"; 365 } 366 } else { 367 tertiaryPrice += ",00"; 368 } 369 370 break; 371 372 case "group126": 373 primaryPriceDescription = Translate("Translate_ProductDecription_Accessories"); 374 break; 375 376 default: 377 primaryPriceDescription = Translate("Translate_ProductDecription_General_Description"); 378 break; 379 } 380 381 382 <li class="card-list__card product-card"> 383 <a href="@link" class="card__wrapper"> 384 385 @if(!String.IsNullOrWhiteSpace(productImage)) { 386 <picture class="card__picture"> 387 <source srcset="@productImageLg" media="(min-width: 1536px)"> 388 <source srcset="@productImageMd" media="(min-width: 992px)"> 389 <source srcset="@productImageSm" media="(min-width: 768px)"> 390 <img src="@productImageDefault" alt="@name"> 391 </picture> 392 } else { 393 <div class="card__picture card__picture--dummie"></div> 394 } 395 396 <div class="card__info-list__item"> 397 <span class="info info--small info--header">@Translate("Translate_Product_Page_ProductNumber"): @productNumber</span> 398 @if(!string.IsNullOrWhiteSpace(dbNumber)) { 399 <span class="info info--small info--header">@dbNumberLabel: @dbNumber</span> 400 } 401 </div> 402 <div class="card__info-list__item "> 403 <span class="info info--title">@name</span> 404 </div> 405 <div class="card__info-list__item"> 406 <span class="info info--small product-teaser">@teaser</span> 407 </div> 408 @if(isloggedin && ((!String.IsNullOrWhiteSpace(primaryPrice) && primaryPrice != "0,00" && primaryPrice != ",00") || (!String.IsNullOrWhiteSpace(secondaryPrice) && secondaryPrice != "0,00" && secondaryPrice != ",00") || (!String.IsNullOrWhiteSpace(tertiaryPrice) && tertiaryPrice != "0,00" && tertiaryPrice != ",00"))) { 409 <div class="card__info-list__item column"> 410 @if(usePriceExplanation) { 411 <div class="price-line price-line--explanation"> 412 @Translate("Translate_PriceExplanation_" + primaryGroup) 413 </div> 414 } 415 @if(!String.IsNullOrWhiteSpace(primaryPrice) && primaryPrice != "0,00" && primaryPrice != ",00") { 416 <div class="price-line"> 417 <div class="definition">@primaryPriceDescription</div> 418 <div class="price">@primaryPrice <text> </text> @priceCurrencySymbol <text>pr.</text> @salesUnit</div> 419 </div> 420 } 421 422 @if(!String.IsNullOrWhiteSpace(secondaryPrice) && secondaryPrice != "0,00" && secondaryPrice != ",00") { 423 <div class="price-line"> 424 <div class="definition">@secondaryPriceDescription</div> 425 <div class="price">@secondaryPrice <text> </text> @priceCurrencySymbol <text>pr.</text> @salesUnit</div> 426 </div> 427 } 428 429 @if(!String.IsNullOrWhiteSpace(tertiaryPrice) && tertiaryPrice != "0,00" && tertiaryPrice != ",00") { 430 <div class="price-line"> 431 <div class="definition">@tertiaryPriceDescription</div> 432 <div class="price">@tertiaryPrice <text> </text> @priceCurrencySymbol <text>pr.</text> @salesUnit</div> 433 </div> 434 } 435 </div> 436 } 437 </a> 438 </li> 439 } 440 </ul> 441 @if(GetInteger("Ecom:ProductList.TotalPages") > 1) { 442 string prevClass = ""; 443 string nextClass = ""; 444 string extraPaginationClass = ""; 445 446 if(String.IsNullOrWhiteSpace(GetString("Ecom:ProductList.PrevPage.Clean"))) { 447 prevClass = " disabled"; 448 } 449 450 if(String.IsNullOrWhiteSpace(GetString("Ecom:ProductList.NextPage.Clean"))) { 451 nextClass = " disabled"; 452 } 453 454 if(GetInteger("Ecom:ProductList.TotalPages") > 5) { 455 extraPaginationClass = "navigation__pagination--overload"; 456 } 457 458 <div class="card-list__footer"> 459 <div class="card-list__navigation"> 460 <a href="@GetString("Ecom:ProductList.PrevPage.Clean")" class="navigation__arrow back@(prevClass)"> 461 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 6.503"><path d="M10.94,6.5,14,3.249,10.94,0H9.693L12.4,2.8H0v.9H12.4L9.693,6.5Z"/></svg> 462 </a> 463 464 <div class="navigation__pagination @extraPaginationClass"> 465 <span class="navigation__pagination__title"> @Translate("Translate_ProductList_BreadCrumbPage") </span> 466 @for (int i = 0; i < GetInteger("Ecom:ProductList.TotalPages"); i++) 467 { 468 string currentClass = (i + 1) == GetInteger("Ecom:ProductList.CurrentPage") ? " active" : ""; 469 string url = GetString("Ecom:Group.Link.Clean") + "&PageNum=" + (i + 1); 470 471 foreach(var query in GetLoop("Query.Parameters")) { 472 if(!String.IsNullOrWhiteSpace(query.GetString("Parameter.Value"))) { 473 url += "&" + query.GetString("Parameter.Name") + "=" + query.GetString("Parameter.Value"); 474 } 475 } 476 477 if(!isStandardSorting) { 478 url += "&Sortby=NameForSort" + "&SortOrder=" + sortOrder; 479 } 480 481 <a href="@url" class="navigation__pagination__link@(currentClass)">@(i + 1)</a> 482 } 483 </div> 484 <a href="@GetString("Ecom:ProductList.NextPage.Clean")" class="navigation__arrow forward@(nextClass)"> 485 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 6.503"><path d="M10.94,6.5,14,3.249,10.94,0H9.693L12.4,2.8H0v.9H12.4L9.693,6.5Z"/></svg> 486 </a> 487 </div> 488 </div> 489 } 490 </article> 491 </section> 492 } 493 494 @{ 495 string groupSeoText = GetString("Ecom:Group:Field.SEOText"); 496 497 if (!string.IsNullOrWhiteSpace(groupSeoText)) { 498 <article class="module module-sand-light"> 499 <div class="rich-text"> 500 @groupSeoText 501 </div> 502 </article> 503 } 504 } 505 506 @functions { 507 Dynamicweb.Ecommerce.Products.Group FindTopGroup(Dynamicweb.Ecommerce.Products.Group group) 508 { 509 if (group.IsTopGroup) 510 { 511 return group; 512 } 513 else if (group.ParentGroups != null && group.ParentGroups.Count > 0) 514 { 515 foreach (var parentGroup in group.ParentGroups) 516 { 517 Dynamicweb.Ecommerce.Products.Group topLevelGroup = FindTopGroup(parentGroup); 518 if (topLevelGroup != null) 519 { 520 return topLevelGroup; 521 } 522 } 523 } 524 return null; 525 } 526 } 527
Template:BaseUrlSystem.String/Files/Templates/Designs/keflico/QueryPublisher/
Template:DesignBaseUrlSystem.String/Files/Templates/Designs/keflico/
Loops

Facet Groups

Parameters

QueryResult

Page of
TemplateTags() in code (Designs\keflico\QueryPublisher/List.cshtml). Remove before going live...