Du har ingen produkter i din samling.

Search Advanced Close
Error executing template "Designs/HagsCore/ItemPublisher/List/Case Study List.cshtml"
System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.RazorEngine_b1fa1e0a092d4da7950ca80df0fa64d1.Execute() in B:\Hags_Live_A\Files\Templates\Designs\HagsCore\ItemPublisher\List\Case Study List.cshtml:line 188
   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 @inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> 2 @{ 3 string grouplink = "/Default.aspx?ID=" + GetValue("ItemPublisher:Global.PageId"); 4 HashSet<String[,]> catList = new HashSet<String[,]>(); 5 6 catList = HagsWeb.Library.Methods.Items.ItemTypeMethods.GetStudyBusinessCategories(GetGlobalValue("Global:Area.ID"), GetGlobalValue("Global:Page.ID"), GetGlobalValue("Global:Area.LongLang")); 7 8 //https://doc.dynamicweb.com/documentation-9/content/apps/item-publisher#sideNavTitle1-2 9 } 10 11 <!--Templates/Designs/HagsCore/ItemPublisher/List/Case Study List.cshtml--> 12 13 <script type="text/javascript"> 14 $(document).ready(function () { 15 $('ul.dropdown-menu li a').on('click', function (event) { 16 FilterStudiesBy(event.currentTarget.getAttribute('data-action'), event.currentTarget.innerText); 17 }); 18 }); 19 20 function FilterStudiesBy(filtercode) { 21 var Page = "/Default.aspx?ID=" + @GetValue("ItemPublisher:Global.PageId") 22 if (filtercode !== null) { 23 SetCookie("StudyFilterBy", filtercode, 1) 24 document.location.href = Page + "&PageSize=12&" + filtercode; 25 } 26 else { 27 RemoveCookie("StudyFilterBy"); 28 document.location.href = Page; 29 } 30 } 31 </script> 32 33 <div class="paragraph module"> 34 35 <div class="m-sort m-heading m-theme-background-black m-theme-color-white"> 36 37 <div class="l-page"> 38 39 <div class="container-fluid"> 40 41 <div class="row"> 42 43 <div class="col-sm-5"> 44 45 <h2>@Translate("CaseStudies", "Case Studies"):</h2> 46 47 </div> 48 49 50 <div class="col-sm-6"> 51 52 @if (GetInteger("ItemPublisher:Items.Paging.TotalPages") > 1) 53 { 54 var hasPrevPage = GetInteger("ItemPublisher:Items.Paging.CurrentPage") > 1; 55 var hasNextPage = GetInteger("ItemPublisher:Items.Paging.CurrentPage") < GetInteger("ItemPublisher:Items.Paging.TotalPages"); 56 57 <nav class="pull-right"> 58 <ul class="pagination"> 59 60 @if (hasPrevPage) 61 { 62 <li> 63 <a href='@System.Web.HttpUtility.HtmlEncode(GetValue("ItemPublisher:Items.Paging.PrevPage"))'>&laquo; @Translate("page_Previous", "Previous")</a> 64 </li> 65 } 66 67 @foreach (var p in GetLoop("ItemPublisher:Items.Paging.Pages")) 68 { 69 var isCurrent = p.GetBoolean("ItemPublisher:Items.Paging.Pages.Page.IsCurrent"); 70 <li class='@(isCurrent ? "active" : "")'> 71 @if (isCurrent) 72 { 73 <span>@p.GetValue("ItemPublisher:Items.Paging.Pages.Page.Number")</span> 74 } 75 else 76 { 77 <a href='@System.Web.HttpUtility.HtmlEncode(p.GetValue("ItemPublisher:Items.Paging.Pages.Page.Url"))'>@p.GetValue("ItemPublisher:Items.Paging.Pages.Page.Number")</a> 78 } 79 </li> 80 } 81 @if (hasNextPage) 82 { 83 <li> 84 <a href='@System.Web.HttpUtility.HtmlEncode(GetValue("ItemPublisher:Items.Paging.NextPage"))'>@Translate("page_Next", "Next") &raquo;</a> 85 </li> 86 87 } 88 </ul> 89 </nav> 90 } 91 92 </div> 93 94 @if (catList.Count > 1) 95 { 96 <div class=""> 97 98 <form class="pagination"> 99 <div class="form-group"> 100 <div class="btn-group"> 101 <button type="button" class="btn btn-m btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> 102 @Translate("FilterBy", "Filter by") <span class="caret"></span> 103 </button> 104 105 <ul class="dropdown-menu" name="select-filter" role="menu"> 106 <li><a>@Translate("Any", "Any")</a></li> 107 <li class="divider"></li> 108 @foreach (var a in catList) 109 { 110 <li><a data-action="Business_Category=@a[0,0]">@a[0,1]</a></li> 111 } 112 </ul> 113 </div> 114 </div> 115 </form> 116 117 </div> 118 } 119 120 121 </div> <!-- row --> 122 123 </div> <!-- container-fluid --> 124 125 </div> <!-- l-page --> 126 127 </div><!-- m-heading --> 128 129 <div class="m-attractor-group"> 130 131 <div class="l-page"> 132 133 <div class="container-fluid"> 134 135 <div class="l-group-4 row"> 136 137 @if (!GetBoolean("ItemPublisher:Items.Any")) 138 { 139 <p class="error">@Translate("No_items_found", "No items found")</p> 140 } 141 else 142 { 143 144 foreach (LoopItem item in GetLoop("ItemPublisher:Items.List")) 145 { 146 // Select any Single Primary Case study Image 147 var image = string.Empty; 148 149 Dynamicweb.Content.Items.Item studyImage = new Dynamicweb.Content.Items.Item(); 150 Dynamicweb.Content.Items.Item studyLink = new Dynamicweb.Content.Items.Item(); 151 152 if (!string.IsNullOrEmpty(item.GetString("ItemPublisher:Item.Images"))) 153 { 154 studyImage = HagsWeb.Library.Methods.Items.ItemTypeMethods.GetItemImages(item.GetString("ItemPublisher:Item.Images"), 1).FirstOrDefault(); 155 if (studyImage != null) 156 { 157 image = studyImage["Image"].ToString(); 158 } 159 160 } 161 else 162 { 163 image = "http://placehold.it/400x400"; 164 } 165 166 <div class="l-group-content col-xs-6 col-ms-4 col-sm-3"> 167 168 <div class="m-attractor"> 169 170 <div class="m-attractor-visual"> 171 @item.GetValue("ItemPublisher:ItemType.Field.Name") 172 <a href="@item.GetValue("ItemPublisher:Item.DetailsUrl")"><img src="@image" class="img-responsive"></a> 173 174 </div> 175 176 177 <div class="m-attractor-info m-attractor-info-product"> 178 179 <h3 class="m-theme-after-yellow m-theme-border-yellow"> 180 <a href="@item.GetString("ItemPublisher:Item.DetailsUrl")">@item.GetString("ItemPublisher:Item.Study_Heading")</a> 181 </h3> 182 183 <p>@item.GetString("ItemPublisher:Item.Study_Content")</p> 184 185 186 @{ 187 Dynamicweb.Content.Items.Item CaseStudyLink = Dynamicweb.Content.Items.Item.GetItemById("Hyperlink_Button", item.GetString("ItemPublisher:Item.Read_More_Button")); 188 string hyperlinkText = string.IsNullOrEmpty(CaseStudyLink["Button_Text"].ToString()) ? Translate("ReadMore", "Read More") : CaseStudyLink["Button_Text"].ToString(); 189 } 190 191 <a class="m-btn-xs-more btn btn-default btn-xs text-uppercase" href="@item.GetValue("ItemPublisher:Item.DetailsUrl")" role="button">@hyperlinkText</a> 192 193 </div> <!-- attractor-info --> 194 195 <div class="m-attractor-options"> 196 197 <ul class="m-icon-links list-unstyled hide"> 198 <li><a href="#" class="clearfix"><img src="/Files/Templates/Designs/HagsCore/res/img/icons/plus.svg" data-nosvg="/Files/Templates/Designs/HagsCore/res/img/icons/plus.png" class="m-icon pull-left"><span>Add to my Collection</span></a></li> 199 </ul> 200 201 </div> <!-- m-attractor-options --> 202 203 </div> <!-- attractor --> 204 205 </div> 206 } 207 208 209 210 } 211 212 213 214 215 216 217 </div> <!-- row --> 218 219 </div> <!-- container-fluid --> 220 221 </div> <!-- l-page --> 222 223 </div> 224 225 @if (GetBoolean("ItemPublisher:Items.Any")) 226 { 227 228 <div class="m-sort m-theme-background-lightgrey"> 229 230 <div class="l-page"> 231 232 <div class="container-fluid"> 233 234 <div class="row"> 235 236 <div class="col-sm-5"> 237 238 </div> 239 240 <div class="col-sm-6"> 241 242 @if (GetInteger("ItemPublisher:Items.Paging.TotalPages") > 1) 243 { 244 var hasPrevPage = GetInteger("ItemPublisher:Items.Paging.CurrentPage") > 1; 245 var hasNextPage = GetInteger("ItemPublisher:Items.Paging.CurrentPage") < GetInteger("ItemPublisher:Items.Paging.TotalPages"); 246 247 <nav class="pull-right"> 248 <ul class="pagination"> 249 250 @if (hasPrevPage) 251 { 252 <li> 253 <a href='@System.Web.HttpUtility.HtmlEncode(GetValue("ItemPublisher:Items.Paging.PrevPage"))'>&laquo; @Translate("page_Previous", "Previous")</a> 254 </li> 255 } 256 257 @foreach (var p in GetLoop("ItemPublisher:Items.Paging.Pages")) 258 { 259 var isCurrent = p.GetBoolean("ItemPublisher:Items.Paging.Pages.Page.IsCurrent"); 260 <li class='@(isCurrent ? "active" : "")'> 261 @if (isCurrent) 262 { 263 <span>@p.GetValue("ItemPublisher:Items.Paging.Pages.Page.Number")</span> 264 } 265 else 266 { 267 <a href='@System.Web.HttpUtility.HtmlEncode(p.GetValue("ItemPublisher:Items.Paging.Pages.Page.Url"))'>@p.GetValue("ItemPublisher:Items.Paging.Pages.Page.Number")</a> 268 } 269 </li> 270 } 271 @if (hasNextPage) 272 { 273 <li> 274 <a href='@System.Web.HttpUtility.HtmlEncode(GetValue("ItemPublisher:Items.Paging.NextPage"))'>@Translate("page_Next", "Next") &raquo;</a> 275 </li> 276 277 } 278 </ul> 279 </nav> 280 } 281 282 </div> 283 284 <div class=""> 285 286 @if (catList.Count > 1) 287 { 288 <div class=""> 289 290 <form class="pagination"> 291 <div class="form-group"> 292 <div class="btn-group"> 293 <button type="button" class="btn btn-m btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false"> 294 @Translate("FilterBy", "Filter by") <span class="caret"></span> 295 </button> 296 297 <ul class="dropdown-menu" name="select-filter" role="menu"> 298 <li><a>@Translate("Any", "Any")</a></li> 299 <li class="divider"></li> 300 @foreach (var a in catList) 301 { 302 <li><a data-action="Business_Category=@a[0,0]">@a[0, 1]</a></li> 303 } 304 </ul> 305 </div> 306 </div> 307 </form> 308 309 </div> 310 } 311 312 </div> 313 </div> <!-- row --> 314 315 </div> <!-- container-fluid --> 316 317 </div> <!-- l-page --> 318 319 </div> 320 321 322 } 323 324 </div> 325

Hags Denmark

Send os en e-mail eller giv os gerne et kald. Vi er klar med kyndig vejledning om unikke uderum. Vi dækker hele landet med et hold af engagerede medarbejdere. Velkommen til HAGS – Velkommen til ubegrænsede muligheder.

Danmark

HAGS Danmark
Drejergangen 1B
2690 Karlslunde
Danmark

Følg HAGS: