Sitefinity

Add Registration for Blog Comments Send comments on this topic.
How-to > Modules > Built-in Modules > Generic Content Based Modules > Blogs > Add Registration for Blog Comments

Glossary Item Box

This topic describes how to require registration for adding comments to blogs.

 

The necessary settings include extending the Telerik.Cms.Engine.WebControls.CommentsList class. Here are some guidelines on how to do that:

 

  1. In the class that will extend the CommentsList class, add an event handler and subscribe to the SubmitButton command in the CreateChildControls overridden method:

    CreateChildControls Copy Code
    this.Container.SubmitButton.Command += new CommandEventHandler(MySubmitButton_Command);

     

  2. In this event handler, check whether the user is authenticated:

    Event Handler Copy Code
    if (!this.Request.IsAuthenticated)
    {
      
    // this line will make the base event handler do nothing and skip the registration of the comment
      
    this.ParentID = Guid.Empty;  
    }  


     

  3. Modify the Blogs ContentViewSingleItem.ascx public control template to use the custom class that extends CommentsList instead of the old CommentsList custom control.