Pages

Thursday, October 6, 2011

0

Reply to Blogger comments hack

Update January 18th 2012: A new and easy to install threaded commenting hack version 2 includes this hack's functionality, you might consider using it.

There is one hack with variations circulating in internet which gives you the opportunity to reply to individual comments in Blogger. There are some shortcomings in that code. It always uses a popup and the popup does not position (scroll) to the comment form when opened, this is a bug and annoying if there are many comments. You can correct it by changing https to http, after that it jumps to the anchor as it should. From this exactly same bug you can tell that all the variations of that hack are from the same source.

Not satisfied with code quality ;) and windows popping up when I did not want to, I did my own hack.

With popup and full page commenting the code uses either popup or full page, which ever the blog uses. With embedded comment form text cannot be injected into iframe (from another domain), so separate comment page is opened (not popup). Comment form is prefilled with @ + link to the comment the user is replying to.

How to install

Open blog template html for editing, expand widget templates. Search line that contains:

<data:commentPostedByMsg/>

Just after that paste the following code, but change 12345CHANGETHIS6789 to your blog's id number. You can find your blog id by going to Design, it is in the url: http://www.blogger.com/rearrange?blogID=HEREISYOURBLOGID (old interface) or http://www.blogger.com/blogger.g?blogID=HEREISYOURBLOGID#template (new interface). And here's the code:

Data provided by Pastebin.com - Download Raw

Remember, change the blog ID! It is there in the url when you are editing the template, too. Save, and you're done. You can style the CSS class "comment-reply-link", if you like, but it is not necessary. With CSS you can have hover effect for the link etc. You might also want to use an image instead of the [reply] text.
Related Posts Plugin for WordPress, Blogger...
See the hack
for this dynamic
views icon: