October 10, 2006
Author comment highlighting and notification
After a break of a week or two, I am back again. I now have some hacks for the comments section - a hack to highlight your comments as the blog author and another to notify your readers when you respond to their comment. You might have noticed that my comments are displayed in red here in my blog and that's what I mean by "highlighting". I believe it helps my readers to identify my response to their questions amidst a long list of comments. Some of my readers asked me how to do this in their blog and here I am sharing what I did. Once I respond to Richard, if I click that image, an email similar to the following one will be sent to the email address in his profile. [If the person has not shared an email address, no email will be sent.]
Author comment notification is another hack that I did for the old Blogger. When somebody posts a question/comment in your blog and you respond to him, the commenter may not see the response unless he checks your blog a few times. If (s)he landed in your blog through blog search or Blogger's next blog chain, (s)he may not even remember your blog's URL. Sometimes, you type a long response and it goes into blackhole. With this notification, you can send an automated email message to the commenter with just one click. This message will contain your name, your post’s title and its permanent link so that the commenter can easily come back and see your response. This hack is actually a service hosted in my website bvibes.com. [Please note that notification can be sent only to those who have shared their email address in their Blogger profile.]
Now, for the code changes. First find this class called comment-body, copy it to define another class comment-body-author and modify it for the way your comments should look like. For example, here I have set the color to what I want and made it bold.
.comment-body {
margin:0;
padding:0 0 0 20px;
}
.comment-body p {
font-size:100%;
margin:0 0 .2em 0;
}
.comment-body-author {
margin:0;
padding:0 0 0 20px;
}
.comment-body-author p {
font-size:100%;
margin:0 0 .2em 0;
color:#CC3300;
text-decoration:bold;
}
Then, search for "id ='comments-block'" in your template to identify the portion of code in this page and add the new code shown in red and blue. The red one is for author comment highlighting and the blue one is for comment notification.
After you make those changes, goto any post page with comments and you will see the an image after every comment (NOT in the comments page where you type comments). As you can see in this example, there's an image below Richard's comment.
Subject: Response to your comment has been posted
"Ramani has responded to your comment on Peekaboo posts improved again. Please click this link to see the response."
As a security feature, this image will be shown ONLY when the blog author is logged into Blogger. Visitors to your blog won't see this image and so they won't be able to use this feature. Also, be judicious in using this service (if you send emails for trivial responses, your readers may not like it).




No comments yet