I have updated the solution to be able to count the number of comments on a blog post. This modification is tested in SP2013 only. Parts of it may work for SP2010 as well, but this can not be guaranteed.
Follow the instructions in this post for the basic setup, and then follow these instructions to add the comment count.
You must make the list “SPJS-CommentBox” visible to be able to add a lookup column from “Posts” to this list. Either use SharePoint designer (right click the list, select “Properties”, and uncheck “Hide from browser”), or use this tool: http://ift.tt/1o252KU
Add a lookup column named “ParentPostTitle” from “SPJS-CommentBox” to “Posts” like this:
Add a lookup back to “SPJS-CommentBox” called “cBoxCount” like this – note the field “ParentPostTitle (Count Related):
Download the latest version here
Then update your function call like this:
var argObj = { "placeholderID":"cBox_A", "threadID":threadID, "blogMode":true, "storeCommentsOnRootSite":false, ... ... ...
Note the setting “blogMode”:true”.
Please post any questions or comments in the forum: http://ift.tt/1C7hQHq
by Alexander Bautz via SharePoint JavaScripts
No comments:
Post a Comment