Skip to content

Instantly share code, notes, and snippets.

@fluxdigital
Last active November 17, 2018 17:11
Show Gist options
  • Save fluxdigital/5325f4885a7fdcfad221d6c44835a3a7 to your computer and use it in GitHub Desktop.
Save fluxdigital/5325f4885a7fdcfad221d6c44835a3a7 to your computer and use it in GitHub Desktop.
List Telligent Community Blog Posts in Sitecore from SDK
using TcDemo.Models.TcBlogPost;
public class BlogPostListController : Controller
{
public ActionResult Index()
{
var host = new TelligentRestHost("http://tcdemo.local.com", "testuser", "5h4qg4basasgssdpglyt5sjtkw44u3", false, 10, null);
restGetOptions = new RestGetOptions()
{
QueryStringParameters =
{
{"SortBy", "MostRecent"},
{"SortOrder", "Descending"},
{"IncludeSubGroups", "true"},
{"PageSize", "100"},
{"BlogId", "10" }
}
};
var response = host.GetToString(2, "blogs.json", true, restGetOptions);
List<TcDemo.Models.TcBlogPost> blogPostList = JsonConvert.DeserializeObject<List<TcDemo.Models.TcBlogPost>>(response);
return View("~/Views/Community/BlogPostList.cshtml", blogPostList);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment