Menu Søg

Vær aktiv

Exception in template (Designs\Skanderborg\Paragraph\Feed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at FeedIntegration.Operations.InstagramInformation.generateFeedCollection(XmlNodeList list)
   at FeedIntegration.Operations.InstagramInformation.GetInfoPost(List`1 filterValue)
   at CompiledRazorTemplates.Dynamic.aadaeedbcfbbbb.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@inherits RazorTemplateBase<RazorTemplateModel<Template>> @using System; @using System.Linq; @using Dynamicweb.Rendering; @using FeedIntegration.Operations; @{ var areaItem = Pageview.Area.Item; string image = "", hashtag = ""; InstagramInformation insta = new InstagramInformation(); List<string> user = new List<string>(); List<LoopItem> hashtagList = GetLoop("Item.Hashtags.Value"); foreach(LoopItem hashtagItem in hashtagList.Take(20)){ hashtag = hashtagItem.GetString("Item.Hashtags.Value.Text.Value"); if(!String.IsNullOrEmpty(hashtag)) { user.Add(hashtag); } } var res = insta.GetInfoPost(user); } @if(res.Any()){ <article class="container socialMediaFeed container"> <div class="socialMediaHashtags col-xs-12 noPadding"> @foreach(string tag in user) { <span>#@tag.ToUpper()</span> } </div> <div> <ul class="col-xs-12 noPadding"> @foreach(var info in res.Take(8)) { image = info.imageUrl != null ? info.imageUrl.ToString() : ""; if(!String.IsNullOrEmpty(image)) { <li class="instangram col-md-3 col-sm-4 col-xs-6 noPadding"> <a href="@info.source" target="_blank" style="background-image: url(@image)" > <figure> &nbsp; </figure> <div> <strong> @info.name </strong> <p> @info.comment </p> </div> </a> </li> } } </ul> </div> </article> }