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

Forums / Developing with Sitefinity / Post a comment text editor

Post a comment text editor

5 posts, 1 answered
  1. Levi
    Levi avatar
    12 posts
    Registered:
    29 Jun 2008
    05 Jan 2010
    Link to this post
    Hello,

    I wrote my own blog control, and I would like to mimic the behavior of the comment editor in the "post a comment" telerik university sample.  I can't seem to find any code that shows how the comment editor is implemented for telerik university.  I would like the comment editor to be exactly like the telerik university sample (with formatting options, and formatting options link, etc).

    Thanks!
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    05 Jan 2010
    Link to this post
    Hi Levi,

    This is a BlogPosts control which has built-in implementation for comments. The main control that is used for the comments is RadEditor control. You can use IComment objects to create a new comment for each post.

    IComment comment = this.Manager.CreateComment(content);
    comment.Text = this.CommentText.Content;
    comment.Author = this.AuthorText.Text;
    comment.Email = this.EmailText.Text;

    Then you have to create a repeater that shows all content items. You also have to override InitializeConrols and set the datasource of the Repeater when a given post is opened and also set initial values and subscribing for events of layout controls. Here you can use GetComments method of ContentManager

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Levi
    Levi avatar
    12 posts
    Registered:
    29 Jun 2008
    05 Jan 2010
    Link to this post
    Hey Ivan,

    Thanks for the info.  I have actually already done all of that.  I just need to figure out how you configured the RadEditor in the telerik univserity sample.  I'd like to know how you configured the RadEditor so that it has that "formatting options" link that shows/hides the RadEditor toolbar.

    Thanks Ivan!
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    05 Jan 2010
    Link to this post
    Hello Levi,

    It is a link with some js

    <a href="#" class="formattingOptionsToggleBtn" onclick='if($(this).parent().hasClass("formattingOptions")){$(this).parent().removeClass("
    ");$(this).text("Formatting options");}else{$(this).parent().addClass("formattingOptions");$(this).text("Hide formatting options"); } return false;'
    >Formatting options</a>

    .formattingOptionsToggleBtn {
        display: block;
        text-align: right;
        outline-width: 0;  
    }

    .formattingOptions .reToolbarWrapper
    {
        visibility: visible;
    }


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Answered
  5. Levi
    Levi avatar
    12 posts
    Registered:
    29 Jun 2008
    05 Jan 2010
    Link to this post
    Wow, thanks a lot Ivan.  You rock!
Register for webinar
5 posts, 1 answered