Blogger Hacks, Categories, Tips & Tricks

Tuesday, May 02, 2006
Highlight Your Comments
It's your blog, after all...

If you'd like your comments to stand out on your blog, Aditya at The Last Word has a hack that will get the job done for you. This is a level 2 (or 3) hack, and requires that you first format your blog to have inline comments. These pop out from under your post on the main page, and don't require your reader to visit the bizarre nether-world of the tan n' orange blogger comments page, or your post page, before they see the comments on your blog. Spiffy, but only the beginning!

Inline comments enabled? Groovy! Now wrap the whole comment code, including the comment author info, in its own special tag that doesn't see much action elsewhere on your page. Aditya recommends paragraph tags for this purpose, perhaps highlighted with their own class name. That way, the script can tell which references to your profile ID are in the comments, and which are in your sidebar & should be ignored.

Install the javascript (in your template head, and inside script tags) and customise it with your profile number and comment author tag. Aditya's post tells you how to find your profile #.

Modify your template's body tag by adding the onload="author_change()" attribute, so that your template looks for the script. Finally, use CSS to style your comments so that they stand out, and leave yourself a juicy comment.

Filed in: , ,
Posted at 7:01 PM by John.
<    >
Blogger AJ said...
Thanks for the explanation, John. Being the comment-egoist that I am, I'll have to start playing with this.

<    >
Blogger Aditya said...
@John: I edited the hack, so that it only checks the comments div element. That basically means that the implementer is free to use any html tag he/she wants, but has to keep in mind to include the 'id="comment"' attribute. The same can be done with a 'class' attribute too, but then the function will have to be edited to look for the class!

eXTReMe Tracker