Thursday, April 8, 2010

How to link directly to a comment in Blogger

OK, this will almost certainly not be news to a great many people but I just figured it out for myself so I'm posting it here.

Since I've started commenting on blogs I've often struggled when trying to link directly to a Blogger comment in long threads (I tried for instance to link directly to some comments in the Gun Control thread on this blog in a new blogpost but it didn't work). You can get the url for a comment by clicking on the timestamp and then copying and pasting this from the address bar into the 'A href...' html tags - but previously when someone had clicked on the link expecting to go directly to the comment in question they would find themselves merely staring at the top of the blog post the comment was made on and they would still have to scroll down to find the comment in question - which completely missed the point.

However, the Recent Comments widget I use from Beautiful Beta and Hackosphere manages to do it with no problems (probably edits the text string to remove unwanted characters) - click on the author's name and it takes you directly to the comment, but in the other similar widgets I've experimented with you still end up at the top of the blog post, not the actual comment (for instance, look at the recent comments widget on the Bronze Blog). Checking a couple of other blogs you'll see the same thing happens - but the urls are different from the ones generated in the recent comments widget I use, they're longer.

So, click on a timestamp for a particular comment and you get a url that looks like this:

http://terribletruth-beautifullie.blogspot.com/2010/01/psychics-real-fake-or-just-fucking.html?showComment=1270777714974#c1252609637139529788

Which you can now use to link directly to a Blogger comment using the 'A HREF=' html tag, but it didn't used to work.

Click on the author name in the recent comments widget I use and it looks like this:

http://terribletruth-beautifullie.blogspot.com/2010/01/psychics-real-fake-or-just-fucking.html#c1252609637139529788

and it goes directly to the required comment.

But if I use some of the other recent comment widgets the urls generated look something like this:

http://terribletruth-beautifullie.blogspot.com/2010/01/psychics-real-fake-or-just-fucking.html?showComment=1270777714974#comment-c1252609637139529788

Yet they are all for the same comment. The first will now take you to the comment but didn't used to, the second to the actual comment and the third just to the top of the blogpost - most recent comment widgets I've found use the third format - the one I use chops the text string to get what is needed.

The timestamp url now seems to work, otherwise you can chop out the 'comment-' part of the third url, or chop out everything from the first url from and including the '?' up to, but not including, the '#' when creating a link to a specific comment in a blogger discussion.

Not earth shattering and no doubt most already know this, I just thought it was weird because this didn't work six months ago and not being able to link to a comment directly was a pain in the arse!

No comments:

Post a Comment