I am trying to find out how to get answers for a blog post in a community site using javascript or csom. I made a search on the Internet unfortunately didn't find anything.
-
1Do you mean comments for a blog post instead of answers? – Cann0nF0dder Feb 21 '14 at 1:51
-
Yes, I mean comments. – Medes Feb 21 '14 at 7:56
In every blog site there is one Comments list. Always called "Comments". In this list there is a column called Post ID.
Therefore if you already have your post, you grab the ID, look at the comments list and query for all comments where Post ID = Blog Post ID. A simple CSOM CAML query should do it. (Looking at the Post Id column it is stored as 1;#1 so you might have to do some manipulation before performing the query)
This blog should help you write your JavaScript http://blogs.msdn.com/b/sharepointdev/archive/2011/07/19/working-with-the-ecmascript-client-object-model-jsom-in-sharepoint-2010-part-3-nikhil-sachdeva.aspx
-
Thank you, I couldn't find any comments list in my Site Collection which is a Community Site. – Medes Feb 21 '14 at 12:02
-
A community site doesn't have blogs on them they have discussions. Blogs are separate type of sites. – Cann0nF0dder Feb 21 '14 at 13:33