Customize comment control

Topics: Controls
Feb 19, 2010 at 4:33 PM

I want the comment control to have a cancel button, so it gets back to the past view as before clicking on comment link. Also, I want to customize how the comments look, like I mean I just wanted the comment to be listed with date and posted by name without any other things in my required format. Can you please help me asap. Thanks.

Coordinator
Feb 20, 2010 at 7:14 PM

In your theme folder (themes\Standard, for example) is a file named CommentView.ascx.  This controls what is output for each comment (date, posted by, etc).  You can make modifications in this file.

Feb 22, 2010 at 7:28 PM

I want to add cancel button to the comment control such that if one clicks on it the comment box is minimized. Also, I want to have this functionality as if someone posts the comment to particular blog post, the author should be emailed about it. Can you help me with that. Thanks.

 

Coordinator
Feb 23, 2010 at 6:25 AM

There's currently an extension in BE named SendCommentMail.  Whenever someone leaves a comment, the blog owner is sent an email notification.  In order for this email to be sent out, the person leaving a comment cannot be a person logged into the blog.  The purpose of this is so if an administrator or editor (who is logged into the blog) is leaving a comment, they are not emailed a notification which would be unnecessary.

You can modify the SendCommentMail.cs extension (in the App_Code\Extensions) folder so it sends an email notification to the Author, rather than the blog owner.  The person in this post described what he did for this.

Feb 23, 2010 at 7:21 PM

Thanks for the reply. However, it's not even sending messages to owner of the blog. Do I need to do any other settings other than adding SMTP settings for sending email?

Coordinator
Feb 24, 2010 at 12:21 AM

I would first make sure the email part is working.  After entering your SMTP settings, try the "Test" link (same place where you enter the SMTP settings), and make sure the Contact Us page works.

If email is then working, the only other condition that I can think of which would prevent the comment notification email from getting sent out is the commenter being logged into the blog while leaving a comment.  If you're testing this, make sure you're logged out when leaving a test comment.

Feb 24, 2010 at 12:43 AM

I checked my smtp settings and it's working perfectly, that I got a test mail to my email saying success. And I am leaving comments without logging in, but still won't send an email. Let's see, the author email is set in their profile right? I have not yet made changes to send the mail to the author because, I am just trying to see, if it sends to the blog owner. The blog owner I suppose is the administrator right? And if so, I have edited default admin account profile that comes with the package and changed to my email address. That's all I have done. Also when I try to debug by putting a break point in sendcommentmail.cs file, it won't break when I leave a comment without logging in. I wonder is there any other place that I need to enable this setting?

Coordinator
Feb 24, 2010 at 12:50 AM

SendCommentMail sends an email to the email address listed in the SMTP settings -- not an email address tied to a profile.

I would check the Extensions tab in the control panel.  You should find the SendCommentMail extension.  Each extension can be Enabled or Disabled.  Make sure the SendCommentMail extension is Enabled.

Feb 24, 2010 at 12:51 AM

I don't have sendcommentmail extension under extension tab. How do I enable it?

Coordinator
Feb 24, 2010 at 1:06 AM

The Extensions tab should list all the files in the App_Code\Extensions folder.  In that folder, do you have SendCommentMail.cs ?  If not, you can download BE 1.6 and get the file from that directory.

And are there any other Extensions listed on the Extensions tab?  Normally, there's around 6 to 8 of them.

Feb 24, 2010 at 1:10 AM

I don't see any extensions listed there. I have my App_Code folder named as Old_APP_Code. I think this happened during installation process. Do you want me to rename it to App_Code?

 

Coordinator
Feb 24, 2010 at 1:33 AM

Assuming you haven't explicitly converted BE into a WAP (web application project) which hopefully you haven't, then yes, you'll want to rename Old_App_Code to App_Code.  App_Code is a "special" folder that contains code which will be automatically compiled.