+1-888-365-2779
Try Now
More in this section

Forums / Set-up & Installation / Blog Comment answers

Blog Comment answers

3 posts, 0 answered
  1. Sebastian Menendez
    Sebastian Menendez avatar
    19 posts
    Registered:
    15 Oct 2004
    14 May 2009
    Link to this post
    Hi,

    We have a client that wants to answer the comments he receives and have this comment appear below the comment. Is this possible?

    Thanks,

    Sebastian
  2. Sebastian Menendez
    Sebastian Menendez avatar
    19 posts
    Registered:
    15 Oct 2004
    14 May 2009
    Link to this post
    Hi,

    I was thinking of creating a new meta field for the comments called answer. But how can I do this?

    []'s

    Sebastian
  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    14 May 2009
    Link to this post
    Hi Sebastian Menendez,

    Creating a metafield most probably will not help you, because if there are 100 comment you should have 100 metafields. Also on every comment you should go end edit the content item and then save it.
    The situation seems to be more complex. Currently you can enable comments moderation thus, when you receive a comment you can check it and then answer it from the front end of Sitefinity. Thus, you will not have offensive comments and not answered comments.

    Possible way is managing the comments through the backend. Here you need to create a new view and add custom logic. You need to get all comments, then check whether they are read by a user, if not get the comment text, check it, add your comment and then approve it.

    Here is a sample code:

    IList posts = blogManager.GetPosts("name asc", parentIDb); 
            IList listofBlogComments = blogManager.Content.GetComments(sortExp, filter); 
            foreach (IComment comment in listofBlogComments) 
            { 
                if (!comment.IsReadByUser(username)) 
                { 
                    IComment unreadComment = blogManager.Content.GetComment(comment.ID); 
                    Response.Write(unreadComment.Text); 
     
                    // ADD YOR LOGIC HERE TO GET comment.text and so on 
                } 
            } 


    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
3 posts, 0 answered