Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • steven smith 20 posts 130 karma points
    Jun 10, 2014 @ 12:58
    steven smith
    0

    Comments for each post Count()

    Hey, i was wondering,

    on the "hub" that displays a list of posts, i was wondering if i can pull back the ammount of comments per post and simply display "comments 3", does this feature exist? if so where?

    If not how would i go about getting the comments for each post on the hub page?

    Many thanks!

  • steven smith 20 posts 130 karma points
    Jun 10, 2014 @ 13:45
    steven smith
    100

    I robbed the idea from latest comments

       @foreach (IPublishedContent comment in comments)

                                    {

                                        if(comment.Parent.Id == post.Id)

                                        {

                                            commentCount++;

                                        }

                                    }

    simples, this lies within the post loop of the SmarListPosts view

Please Sign in or register to post replies

Write your reply to:

Draft