Last active
November 17, 2018 17:11
-
-
Save fluxdigital/5325f4885a7fdcfad221d6c44835a3a7 to your computer and use it in GitHub Desktop.
List Telligent Community Blog Posts in Sitecore from SDK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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