QueryPublisher

Error compiling template "Designs/Rapido/QueryPublisher/ProducerList.cshtml"
Line 71: The name 'WrapMethods' does not exist in the current context

1 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 [Include file '../../_wrap/WrapMethods.cshtml' not found in 'Templates/Designs/Rapido/QueryPublisher/ProducerList.cshtml'] 3 @using System.Web; 4 5 @{ string feedType = HttpContext.Current.Request.QueryString.Get("feedtype"); 6 string selectedin = ""; 7 int n = 0; 8 string show = "hidden"; 9 string activepage = HttpContext.Current.Request.QueryString.Get("PageNum"); 10 var haveselected = "false"; 11 } 12 [ 13 { 14 "currentPage": "@GetValue("DwPaging.CurrentPage")", 15 "totalPages": "@GetValue("DwPaging.PageCount")", 16 17 "Producers": [@foreach (LoopItem product in GetLoop("QueryResultItem")) 18 { 19 string image = "Files/Images/Ecom/ManufacturerImages/"+ product.GetString("PageItemId")+".jpg"; 20 var filePath = image; 21 var absolutePath = System.Web.HttpContext.Current.Server.MapPath("~/" + filePath); 22 if (System.IO.File.Exists(absolutePath)){ 23 image = filePath; 24 } 25 else 26 { 27 image = "/Admin/Images/eCom/missing_image.jpg"; 28 } 29 if (product.Index > 1) 30 {<text>,</text>}<text>{ 31 "id": "@product.GetString("PageID")", 32 "name": "@WrapMethods.Truncate(product.GetString("Manufacturer_Name"), 50)", 33 "latitude": "@product.GetString("Manufacturer_Latitude")", 34 "pageitemid": "@product.GetString("PageItemId")", 35 "pageitemtype": "@product.GetString("PageItemType")", 36 "link": "Default.aspx?ID=@Pageview.Area.Item["ProducerDetailPage"]&amp;ItemType=@product.GetString("PageItemType")&amp;ItemID=@product.GetString("PageItemId")", 37 "longitude": "@product.GetString("Manufacturer_Longitude")", 38 39 40 "logo": "@image", 41 42 43 44 45 46 "description": "@HttpUtility.JavaScriptStringEncode(product.GetString("Manufacturer_Description"))" 47 }</text>}], 48 "prevpage": "/Default.aspx?ID=@Pageview.Area.Item["ProducerDetailPage"]&PageNum=@GetString("DwPaging.PreviousPageNumber")", 49 "prevdisabled": "@{string prevpageactive = string.IsNullOrWhiteSpace(GetString("DwPaging.PreviousPageNumber")) ? "disabled" : ""; @prevpageactive}", 50 "prevdisplay": "@{prevpageactive = string.IsNullOrWhiteSpace(GetString("DwPaging.PreviousPageNumber")) ? "hidden" : ""; @prevpageactive}", 51 "nextpage": "/Default.aspx?ID=@Pageview.Area.Item["ProducerDetailPage"]&PageNum=@GetString("DwPaging.NextPageNumber")", 52 "nextdisabled": "@{string nextpageactive = string.IsNullOrWhiteSpace(GetString("DwPaging.NextPageNumber")) ? "disabled" : ""; @nextpageactive}", 53 "nextdisplay": "@{nextpageactive = string.IsNullOrWhiteSpace(GetString("DwPaging.NextPageNumber")) ? "hidden" : ""; @nextpageactive}", 54 55 "Pagination":[{ 56 57 "prevpagelink":"/Default.aspx?ID=@Pageview.Area.Item["ProducerDetailPage"]&PageNum=@GetString("DwPaging.PreviousPageNumber")", 58 "nextpagelink":"/Default.aspx?ID=@Pageview.Area.Item["ProducerDetailPage"]&PageNum=@GetString("DwPaging.NextPageNumber")", 59 "nextdisplay": "@{nextpageactive = string.IsNullOrWhiteSpace(GetString("DwPaging.NextPageNumber")) ? "hidden" : ""; @nextpageactive}", 60 "prevdisplay": "@{prevpageactive = string.IsNullOrWhiteSpace(GetString("DwPaging.PreviousPageNumber")) ? "hidden" : ""; @prevpageactive}", 61 "template":"DotsPages", 62 @if (!string.IsNullOrWhiteSpace(GetString("DwPaging.PreviousPageLink"))) 63 { 64 if (GetInteger("DwPaging.CurrentPage") > GetLoop("DwPaging.LoopAllPages").First().GetInteger("AllPages.PageNumber") + 3) 65 { 66 67 <text> 68 "show":"", 69 "firstpagelink":"@GetLoop("DwPaging.LoopAllPages").First().GetString("AllPages.PageLink").Replace("&feedType=productCatalog", string.Empty).Replace("&LayoutTemplate=Json.cshtml&DisableStatistics=True", string.Empty).Replace("ID=19212", "ID=10403")", 70 "firstpagenumber":"@GetLoop("DwPaging.LoopAllPages").First().GetInteger("AllPages.PageNumber")", 71 "firstdots":"...", 72 </text> 73 } 74 if (GetInteger("DwPaging.CurrentPage") == GetLoop("DwPaging.LoopAllPages").First().GetInteger("AllPages.PageNumber") + 3) 75 { 76 <text> 77 "firstdots":"hidden", 78 "show":"", 79 "firstpagelink":"@GetLoop("DwPaging.LoopAllPages").First().GetString("AllPages.PageLink").Replace("&feedType=productCatalog", string.Empty).Replace("&LayoutTemplate=Json.cshtml&DisableStatistics=True", string.Empty).Replace("ID=19212", "ID=10403")", 80 "firstpagenumber":"@GetLoop("DwPaging.LoopAllPages").First().GetInteger("AllPages.PageNumber")", 81 </text> 82 } 83 if (GetInteger("DwPaging.CurrentPage") < GetLoop("DwPaging.LoopAllPages").First().GetInteger("AllPages.PageNumber") + 3) 84 { 85 <text> 86 "show":"hidden", 87 "firstdots":"hidden", 88 </text> 89 } 90 } 91 else 92 { 93 94 <text> 95 "show":"hidden", 96 "firstdots":"hidden", 97 </text> 98 99 } 100 "Pages":[ 101 102 @if (!string.IsNullOrWhiteSpace(GetString("DwPaging.PageCount"))) 103 { 104 var currentPageIndex = GetInteger("DwPaging.CurrentPage") - 1; 105 var pageCount = GetLoop("DwPaging.LoopAllPages").Count; 106 const int pagesBeforeAndAfter = 2; 107 for (var i = -pagesBeforeAndAfter; i <= pagesBeforeAndAfter; i++) 108 { 109 var index = currentPageIndex + i; 110 if (index < 0 || index >= pageCount) 111 { 112 continue; 113 } 114 var page = GetLoop("DwPaging.LoopAllPages")[index]; 115 <text> 116 @(++n > 1 ? "," : string.Empty){ 117 "active": "@{string active = GetInteger("DwPaging.CurrentPage") == page.GetInteger("AllPages.PageNumber") ? "pager--current" : ""; @active}", 118 "template":"Numbering", 119 "pageslooplink" :"@page.GetString("AllPages.PageLink").Replace("&feedType=productCatalog", string.Empty).Replace("&LayoutTemplate=Json.cshtml&DisableStatistics=True", string.Empty).Replace("ID=19212", "ID=10403")", 120 "pagesloopnumber":" @page.GetInteger("AllPages.PageNumber")" 121 } 122 </text> 123 } 124 } 125 ], 126 @if (string.IsNullOrWhiteSpace(GetString("DwPaging.PageCount"))) 127 { 128 <text> 129 "hiddenpage":"hidden", 130 "pageslooplink" :"", 131 "pagesloopnumber":"" 132 </text> 133 } 134 @if (!string.IsNullOrWhiteSpace(GetString("DwPaging.NextPageLink"))) 135 { 136 if (GetInteger("DwPaging.CurrentPage") < GetLoop("DwPaging.LoopAllPages").Last().GetInteger("AllPages.PageNumber") - 3) 137 { 138 <text> 139 "lastdots":"...", 140 "lastpagelink":"@GetLoop("DwPaging.LoopAllPages").Last().GetString("AllPages.PageLink").Replace("&feedType=productCatalog", string.Empty).Replace("&LayoutTemplate=Json.cshtml&DisableStatistics=True", string.Empty).Replace("ID=19212", "ID=10403")", 141 "lastpagenumber":"@GetLoop("DwPaging.LoopAllPages").Last().GetInteger("AllPages.PageNumber")", 142 "lastsh":"" 143 </text> 144 } 145 if (GetInteger("DwPaging.CurrentPage") == GetLoop("DwPaging.LoopAllPages").Last().GetInteger("AllPages.PageNumber") - 3) 146 { 147 <text> 148 "lastdots":"hidden", 149 "lastpagelink":"@GetLoop("DwPaging.LoopAllPages").Last().GetString("AllPages.PageLink").Replace("&feedType=productCatalog", string.Empty).Replace("&LayoutTemplate=Json.cshtml&DisableStatistics=True", string.Empty).Replace("ID=19212", "ID=10403")", 150 "lastpagenumber":"@GetLoop("DwPaging.LoopAllPages").Last().GetInteger("AllPages.PageNumber")", 151 "lastsh":"" 152 </text> 153 } 154 if (GetInteger("DwPaging.CurrentPage") > GetLoop("DwPaging.LoopAllPages").Last().GetInteger("AllPages.PageNumber") - 3) 155 { 156 <text> 157 "lastsh":"hidden", 158 "lastdots":"hidden" 159 </text> 160 } 161 } 162 else 163 { 164 <text> 165 "lastsh":"hidden", 166 "lastdots":"" 167 </text> 168 169 } 170 }] , 171 "FacetGroups": [@foreach (LoopItem facetGroup in GetLoop("FacetGroups")) 172 { 173 int lastGroupCount = 0; 174 foreach (LoopItem facetItem in facetGroup.GetLoop("Facets")) 175 { 176 177 int count = facetItem.GetInteger("Facets.LoopCounter") + 1; 178 if (facetItem.GetInteger("Facet.OptionWithResultCount") > 0 && facetItem.GetInteger("Facet.OptionResultTotalCount") > 0) 179 { 180 181 if (facetItem.Index > 1 && lastGroupCount > 0) 182 {<text>,</text>} 183 lastGroupCount = facetItem.GetInteger("Facet.OptionWithResultCount"); 184 185 <text>{ 186 187 "counter": "@facetItem.GetString("Facets.LoopCounter")", 188 "count": "@count", 189 "name": "@facetItem.GetString("Facet.Name")", 190 @foreach (LoopItem facetOption in facetItem.GetLoop("FacetOptions").Where(x => x.GetString("FacetOption.Selected") == "True")) 191 { 192 selectedin = "in"; 193 <text> 194 "selectedin": "@selectedin", 195 </text> 196 } 197 "FacetOptions": [@foreach (LoopItem facetOption in facetItem.GetLoop("FacetOptions").OrderBy(x => x.GetString("FacetOption.Name"))) 198 { 199 if (facetOption.Index > 1) 200 {<text>,</text>}<text>{ 201 "template": "CheckboxFacet", 202 "name": "@facetOption.GetString("FacetOption.Name")", 203 "value": "@facetOption.GetString("FacetOption.Value")", 204 "queryParameter": "@facetItem.GetString("Facet.QueryParameter").ToLower()", 205 "label": "@facetOption.GetString("FacetOption.Label")", 206 "count": "@facetOption.GetInteger("FacetOption.Count")", 207 "disabled": "@{string disable = facetOption.GetInteger("FacetOption.Count") == 0 ? "disabled" : ""; @disable}", 208 "hidden": "@{string hidden = facetOption.GetInteger("FacetOption.Count") == 0 ? "hidden" : ""; @hidden}", 209 "selected": "@{string sel = facetOption.GetBoolean("FacetOption.Selected") ? "selected" : ""; @sel}", 210 "checked": "@{string chk = facetOption.GetBoolean("FacetOption.Selected") ? "checked" : ""; @chk}" 211 }</text>}] 212 }</text> 213 214 } 215 } 216 }], 217 "SelectedFilter":[@foreach (LoopItem facetGroup in GetLoop("FacetGroups")) 218 { 219 var s = -1; 220 <text> @(++s > 1 ? "," : string.Empty) 221 @foreach (LoopItem facetItem in facetGroup.GetLoop("Facets")) 222 { 223 var loopList = facetItem.GetLoop("FacetOptions"); 224 225 226 if (loopList.Any(x => x.GetString("FacetOption.Selected") == "True")) 227 { 228 <text> @(++s > 1 ? "," : string.Empty) { 229 "template": "CheckFilter", 230 "name": "@facetItem.GetString("Facet.Name")", 231 "tolower":"@facetItem.GetString("Facet.Name").ToLower()", 232 "FacetSelectedOptions": [@foreach (LoopItem facetOption in facetItem.GetLoop("FacetOptions").OrderBy(x => x.GetString("FacetOption.Name"))) 233 { 234 if (facetOption.Index > 1) 235 {<text>,</text>}<text>{ 236 "template": "CheckboxFacet", 237 "nameoption": "@facetOption.GetString("FacetOption.Name")", 238 "value": "@facetOption.GetString("FacetOption.Value")", 239 "queryParameter": "@facetItem.GetString("Facet.QueryParameter").ToLower()", 240 "label": "@facetOption.GetString("FacetOption.Label")", 241 "count": "@facetOption.GetInteger("FacetOption.Count")", 242 "disabled": "@{string disable = facetOption.GetInteger("FacetOption.Count") == 0 ? "disabled" : ""; @disable}", 243 "selected": "@{string sel = facetOption.GetBoolean("FacetOption.Selected") ? "selected" : ""; @sel}", 244 "checked": "@{string chk = facetOption.GetBoolean("FacetOption.Selected") ? "checked" : ""; @chk}" 245 }</text>}] 246 }</text> 247 248 } 249 }</text> 250 }], 251 "RemoveFilters":[@foreach (LoopItem facetGroup in GetLoop("FacetGroups")) 252 { 253 <text> 254 @foreach (LoopItem facetItem in facetGroup.GetLoop("Facets")) 255 { 256 var loopList = facetItem.GetLoop("FacetOptions"); 257 258 if (loopList.Any(x => x.GetString("FacetOption.Selected") == "True")) 259 { 260 haveselected = "true"; 261 } 262 263 }</text> 264 if (haveselected == "true") 265 { 266 <text>{ 267 268 "template": "RemoveAll" 269 270 }</text> 271 } 272 }] 273 } 274 ]

Producers