More in this section

Forums / Developing with Sitefinity / Extend comments to attach a file

Extend comments to attach a file

4 posts, 0 answered
  1. UI Crew
    UI Crew avatar
    151 posts
    Registered:
    27 Sep 2012
    29 May 2008
    Link to this post
    Hi,

    I was wondering if it is possible to extend the comments to add an extra field to allow a user to upload a file and then send email notification to a content manager.

    Thanks

    Seth
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    29 May 2008
    Link to this post
    Hello Seth,

    You could implement your own custom control that inherits CommentsList base class:

    CommentsListExtender.cs
    public class CommentsListExtender : CommentsList 
        { 
            public CommentsListExtender() 
            { 
            } 
     
            protected override void CreateChildControls() 
            { 
                if (this.Page == null
                    this.Page = new Page(); 
     
                base.CreateChildControls(); 
     
                uploader = new RadUpload(); 
                uploader.ID = "RadUpload1"
     
                this.Container.Controls.AddAt(0, uploader); 
                this.Container.SubmitButton.Click += new EventHandler(SubmitButton_Click); 
            } 
     
            void SubmitButton_Click(object sender, EventArgs e) 
            { 
                // code for uploading files and sending notification 
            } 
     
            private RadUpload uploader; 
        } 

    You can use the provided example as a starting point to implement the required functionality. Let us know if you need any further assistance.

    Sincerely yours,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. bemara57
    bemara57 avatar
    135 posts
    Registered:
    27 Mar 2008
    17 May 2010
    Link to this post
    Is there a way to save the user inputs for the new fields to the database? I was hoping the comments can have meta data like the modules do, but it does not look like it does.
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 May 2010
    Link to this post
    Hi bemara57,

    The metakeys are valid only for IContent objects. There are not dynamic data fields that you could use to persist the data for comments. You should create some custom data layer ( LINQ -SQL or OpenAccess).

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
4 posts, 0 answered