Content Query Webpart show blog post with no of comments
-
Friday, March 16, 2012 4:49 AM
Hi to All,
I want to show blog posts using content query webpart along with no of comments to that post
but comment column in the Posts list is lookup column so how to show no of comments using content query webpart.
Please help me.
Thanks,
Rohit Warghade...
All Replies
-
Friday, March 16, 2012 6:18 AM
Rohit,
If you "View All Site Contents" for your blog site you will notice that Comments is a separate list.
To display them in the content query web part, you need to query the Posts and Comments list with the reference of the Post Id.
Only challenge is to display multiple comments for a post
Regards, Huzefa Mala, MCTS
- Marked As Answer by Rohit Warghade Tuesday, March 27, 2012 12:08 PM
-
Friday, March 16, 2012 6:55 AM
Thanks for quick reply
In our case i want only show count of comments to that respected post as shown in following snap
In the Posts list under a blog site "# Comment" is a lookup column that repesent no of comments to that post.
I want only retrive value from comment column and show on CQWP.


-
Friday, March 16, 2012 7:48 AM
Use XSLT instead of CQWP
Refer this post:
Regards, Huzefa Mala, MCTS
-
Friday, March 16, 2012 9:43 AM
Thanks for your valuable reply.
This is not possible through content query webpart please help me.
I want only retrive Count of comment for the respected blog post.
Please refer the image above post
Thanks,
Rohit.
-
Friday, March 16, 2012 9:44 AM
- Edited by Balaji More Friday, March 16, 2012 9:46 AM
-
Friday, March 16, 2012 10:02 AM
Hi Balaji,
Thanks for reply
I am created blog site now i want to show recent posts from blog.
I am using Posts list which is default in blog site in that list there is a lookup column "# comments" now i want to diaplay the no of comments for respected blog post. as shown in above post image.
I want retrive the values from lookup column.
Thanks
Rohit.
-
Friday, March 16, 2012 10:30 AM
Hi Rohit,
You can show the number of comments for the particular post just by using the list column field "# Comments".
Just add the column field "# Comments" as shown below.
You can customize it to any level as per your requirement.
Here is the end result -
Hope this helps !!!
Thanks, Suraj || LinkedIn - http://linkd.in/xXf8nk
- Proposed As Answer by sharepoint2010help Friday, March 16, 2012 10:37 AM
- Marked As Answer by Rohit Warghade Friday, March 16, 2012 11:45 AM
-
Friday, March 16, 2012 11:06 AM
Rohit,
Use SharePoint Designer 2010. Open your blog page in SharePoint Designer --> Customize the XSLT view --> You just need to move the xsl node with "NumComments" to your desired location and you will acheive you required view. No need for Content Query Web Part.
Regards, Huzefa Mala, MCTS
-
Friday, March 30, 2012 9:31 AM
Hi Suraj.
Great post it works well.
Cheers,
Balaji

