Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > How to get the blog comments for a particular blog? View modes: 
User avatar
Member
Member
Aashish khandelwal - 5/30/2012 7:00:11 AM
   
How to get the blog comments for a particular blog?
I have multiple blogs. Now, i wanted to get the comments done on blog posts of a particular blog.

Please suggest.

Regards
Aashish Khandelwal
http://technoscatter.blogspot.com

User avatar
Member
Member
kentico_michal - 5/30/2012 8:05:35 AM
   
RE:How to get the blog comments for a particular blog?
Hi,

You can use methods from the CMS.Blog.BlogCommentInfoProvider class to get a DataSet of comments for any blog post document.

Best regards,
Michal Legen

User avatar
Member
Member
Aashish khandelwal - 5/30/2012 8:28:10 AM
   
RE:How to get the blog comments for a particular blog?
Could you please explain out in details?

User avatar
Member
Member
kentico_michal - 5/31/2012 1:57:36 AM
   
RE:How to get the blog comments for a particular blog?
Hi,

Blog comments are stored in the Blog_Comment database table. Each comment contains a reference to the document (CommentPostDocumentID) on which the comment was posted. So to get comments for some blog post you need to know its DocumentID and use the BlogCommentInfoProvider.GetPostComments(int postDocumentID, bool onlyApproved) method to get all comments.

Best regards,
Michal Legen