Try Now
More in this section

Forums / Developing with Sitefinity / All blog posts from a specific blog

All blog posts from a specific blog

2 posts, 0 answered
  1. Roopesh
    Roopesh avatar
    39 posts
    29 Oct 2010
    10 Nov 2010
    Link to this post

    I want all the posts from a specific blog. I will pass blog title .and i need to get all the posts added under that particular blog 

    Thank You
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    19 Oct 2016
    10 Nov 2010
    Link to this post
    Hi Roopesh,

    Below is a sample code that illustrates how to get a blog by name and all posts in it.

    var blogManager = new BlogManager("Blogs");
    var blog = blogManager.GetBlogs().Cast<IBlog>().Where(b => b.Name == "some name").SingleOrDefault();
    var posts = blog.Posts;

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered