Show avatars on Blogger Comments


Blogger is now introducing features every day as part of its 10th birthday celebrations.Now it has formally announced the Blogger Comment avatars. To know what it means take a look at the comments here on this blog and you will see the profiles pictures of the commentators near to the comments.If you are using some default blogger template things would be much easy.Here is a little screenshot of the new feature.

Implementation of Comment Avatars

1.First of all Go to Blogger > Settings >Comments and enable “Show profile images on comment”

2.Now if you have a normal un customized template you will see the avatars on the comments on your blog.

3.If you have a customized template you will have to add some codes and play around with your template.For that first go to Blogger Layout >Edit HTML and backup your template.

4.Expand the widget templates and check if you can find this line there

<dl expr:class='data:post.avatarIndentClass' id='comments-block'>

If you can’t then that means we have something to do..

If you couldn’t find this,then do the following steps.

a)Find

<dl id='comments-block'>

and replace it with

<dl expr:class='data:post.avatarIndentClass' id='comments-block'>

b)Now Find all occurrences of

<a expr:name='data:comment.anchorName'/>

and replace each of it with

<b:if cond='data:comment.favicon'>
<img expr:src='data:comment.favicon' height='16px' style='margin-bottom:-2px;' width='16px'/>
</b:if>
<a expr:name='data:comment.anchorName'/>
<b:if cond='data:blog.enabledCommentProfileImages'>
<div expr:class='data:comment.avatarContainerClass'>
<data:comment.authorAvatarImage/>
</div>
</b:if>

If you are using the author comment highlighting trick and if doesn’t work out with that trick,then leave a comment and i will try to help you out..

Further Styling.

If you want to add a default avatar for the ones with no profile pics,then place the CSS code just above

]]></b:skin>

CSS Code

.avatar-image-container {background:url(http://2.bp.blogspot.com/_u4gySN2ZgqE/SrTInZfKwVI/AAAAAAAAAwA/xaGlRIqkHDw/s400/default.gif); width:35px;height:35px; }
.avatar-image-container  img { border:none;}

You can customize the CSS according to what you need.

If you need bigger avatars instead of smaller ones,then use the following CSS instead of the one above.

.avatar-image-container{width:50px;height:50px;margin-top:-5px;}
.avatar-image-container img {background:url(http://3.bp.blogspot.com/_u4gySN2ZgqE/SrSUS1YpxwI/AAAAAAAAAv4/DihiWlWRxQs/s400/grav.png);width:50px;height:50px;}

This will give you a bigger avatar and also a default gravatar image but it has a little drawback.It will also resize the small blogger favicons to a big size.(blooger favicon is displayed when a blogger user doesn’t have a profile avatar.Similarly OpenId also has a similar small icon.. ).

BTW to set you avatar pic you can use two methods.You can choose the edit profile link on your blogger profile and upload an image there,The second method is to enter a blogger comment somewhere in any blogger comment form and then click the Preview button instead of the Post Comment button.Now you will see an option to upload your avatar.

In case anything bad happens restore the template backup.. and comment here..:)

Permalink: Show avatars on Blogger Comments

153 comments: Add Comment
Christian Schnitt (Stulles Weblog) said...

Its a little bit to late for the blogger comment system ,, lol

i use intense debatte ;)

Blogger Plugins said...

@Christian Schnitt (Stulles Weblog) ,
yea it was a little late.. but better late than never

Riez said...

Hi Anesh,

I'm using mybloglog avatar in my blogger blog cz that is support custom URL, and not only blogger profile, anywy, Thanks for info about this update :D

DarkUFO said...

Thanks, very useful. Appreciate the post for us with Customized templates.

Ms Hetal Patil said...

But in this code, blog author's comment settings get disappeared.

ham1299 said...

Pretty darn cool! :-) Thanks! I love your tweaks!

fstar15 said...

very useful information, thank you

sajitha said...

It is not working on my blog. Please help me.

Blogger Plugins said...

@sajitha ,
did you follow the steps in this post??
and if that doesn't work try reverting widget templates to default(From Blogger Layout>Edit Html page)

BTW you have a good blog but a bad design.. :)

ayu said...

nice..........

Blogger Plugins said...

@Ms Hetal Patil ,
blog author's comment setting means?

Soufiane LeBlogger said...

Hi Aneesh

I get this hack working Only by replacing <dl id='comments-block'> in Blogger Template code by :

<dl expr:class='data:post.avatarIndentClass' id='comments-block'>
<b:if cond='data:comment.favicon'>
<img expr:src='data:comment.favicon' height='16px' style='margin-bottom:-2px;' width='16px'/>
</b:if>
<a expr:name='data:comment.anchorName'/>
<b:if cond='data:blog.enabledCommentProfileImages'>
<data:comment.authorAvatarImage/>
</b:if>

Juste try it, its working perfectly with my blog LeBlogger.com (French)

Hope this could help.

Blogger Plugins said...

@Soufiane LeBlogger ,
the avatar image code should appear within the blogger comment b:loop.

<dl id='comments-block'> lies outside the comment loop in normal blogger templates.So if you replace that with the modified avatar codes,then the avatar code would be outside the blogger comment loop..

Soufiane LeBlogger said...

Yes you're right, I was in a little hurry when i wrote my comment any way its working in my blog and your first code it wasn't working.

Have you an idea of how we can choose an other Image for Anonymous comments ???

Blogger Plugins said...

i don't see any method to replace the default image.. Blogger uses a blank image http://img1.blogblog.com/img/blank.gif . I don't know why they don't come up with a better no image avatar..

Soufiane LeBlogger said...

what about changing no-image blogger profiles icon size ???

Soufiane LeBlogger said...

For some templates, there's no a expr:name='data:comment.anchorName'/

so the code must be added after the first <b:loop values='data:....>

?????

Ms Hetal Patil said...

Sorry to confuse you, Aneesh. I mean that hack where blog author's comments are highlighted as compared to visitor's comments.

aBlogz said...

Great post

Thanks a lot !

Blogger Plugins said...

@Ms Hetal Patil ,
give me the code used there and i can try to help you out..

Blogger Plugins said...

@Ms Hetal Patil
i rejected the previous comment because its not the code that i am talking of(and it was too big :P). You wont be able to paste template codes into this comment box. So i can help you if you mail me the template or post the same in the forums. Email aneesh[at]bloggerplugins.org..

Ms Hetal Patil said...

Aneesh, please provide me your mail id i will mail you template.

Many thanks to you

Blogger Plugins said...

@Soufiane LeBlogger,
yes place it within the loop,
probably below the first dt tag in the b:loop
i added some CSS to display a default no image(gravatar default image) and also resized theavatar a lil bit..

Blogger Plugins said...

@Ms Hetal Patil i have already done that in my previous comment.

Soufiane LeBlogger said...

Thanks it's just perfect.

Umashankar said...

Nice!.........post with good info.,sure! i'll use it on my blog. Thanks !

Nymeth said...

Hi - I'm using the author comments hightlight hack, and sadly using these instructions didn't work. If you could help me figure out what I'm doing wrong it'd be very much appreciated!

Blogger Plugins said...

@Nymeth ,
can i have a look at your template.. you will get my email from the previous comments..

mackenzy said...

thanks for the help with this. I cant get it to work on mine, but i'll toy with it some more. great post.

Blogger Plugins said...

@mackenzy ,
in case you need some help,comment me here..

Terence Chan said...

hi,
where do i place the backlink code you provided?

SuziQoregon said...

I'm having trouble with this too. "anchorName" is nowhere in my template. Can I email my template to you for some assistance?

Blogger Plugins said...

@SuziQoregon,
hmmmm ok my email is there in some previous comment

Hargyo Tri Nugroho said...

Thanks alot

ceebee said...

Hi. I have tried this on my blog but it's not working. What could be wrong?

aR said...

Really this is a nice feature of Blogger. I also told it in my blog.

Thanks for sharing

Lecca said...

Obrigada pelo tutorial, ficou ótimo! Estou repassando ele para os meus visitantes com os devidos créditos.

Blogger Plugins said...

@Lecca,
ok .. You are welcome .. continuem visitando ..
i am not that bad at Portuguese :P

@Terence Chan ,
i missed you.. i haven't provided any backlink code..This one is the comment code..If you want me to help, show me your template code or explain what has gone wrong. :)

Anonymous said...

its working
thank u for the great job
kousik

Ardi33.web.id said...

waw,good bro!!!

tutorialblogmarine said...

nice info

jumper said...

Hi..anyone helpme..i found the step (a) code and replaced it,but im unable to find the step code(b)to replace..its not their in my template code..what to do?
Help me
..My template is SCARLETT 4 column template..you download it from here and check the code..

http://www.allblogtools.com/blogger-templates/4-columns/scarlett-4-columns/

Blogger Plugins said...

@jumper,
try placing the code mentioned in b) after the line
<b:if cond='data:comment.isDeleted'>

Boffill said...

I installed this but its not working in my blog. I am using the highlighting the author trick, I hope you can help me with this one. Thanks!

Blogger Plugins said...

@Boffill ,
i can't say without seeing the template as there are many implementations of the highlighting hack.

srikanta said...

Thank you Aneesh. I try for this new feature to show avatar on blogger comment.
http://bloggershoutbox.blogspot.com

Integralny said...

Hi, friends !

I have a blog about psychology (in polish, but I have Google Translator Widget).

I can't find the line dl id='comments-block' so I don't know what should I do. Please help me !

asep canda said...

thankyou frienda

Blogger Plugins said...

@Integralny,
try the second step only and let me know what happens.. :)

Integralny said...

I can't find the second part with "anchor", too... :(

Blogger Plugins said...

@Integralny ,
try putting after <cite>
If you cant find that one also,then contact me with your template.

Integralny said...

I've found "cite". What should I put after it ?

Blogger Plugins said...

@Integralny try putting the replacement code mentioned in b) after removing the line <a expr:name='data:comment.anchorName'/> from it

Integralny said...

I've found cite but I haven't find any line of code with word "abchor". It doesn't exist.

Blogger Plugins said...

@Integralny ,
just put the big code snippet mentioned in step b) of this post after <cite>

Integralny said...

It doesn't work.

Blogger Plugins said...

@Integralny,
hmm your template codes are lil different.. if you want to get it fixed.. Contact me with your template at the forums

हिमांशु । Himanshu said...

First of all, thanks to this very useful post.

I have a customized templet and reading your post I am trying to show profile images on comments.

I have followed your steps and completed step (a), but now I am unable to find the code in step (b)in my templet. What I have to do now is the question?

please instruct me for the same.
Thanking you.

Mrs. Vanquish said...

Hey there,
thank you very much for this helpful post. I tried it on a testblog and it worked, although the avatar appears above the name and not right next to it.
Do you have a idea how to fix that ? Thank you very much for your help
:)

mido said...

you`re the best

Mike said...

I´m a little confused. You say if I can´t find

expr:class='data:post.avatarIndentClass' id='comments-block'>

What if I can find it? It´s there, but I don´t know what to do now. Do I just continue to follow the other steps in your description?

Thanks, Mike

Blogger Plugins said...

@Mike,
check if this code is present
<data:comment.authorAvatarImage/>

If that is not present,backup your template and continue the steps mentioned in the post..

Mike said...

Yes, that´s there too. My blog isn´t really that customized either. Nav bar is hidden and I´ve unhidden the page elements above posts and in the header, as well as hidden the header border. Also some really basic color modifications, but that´s it. But when I go to enable Post Pages, the drop-down button is greyed out and unaccessable.

Another problem I have is not being able to back up my template. When I try I always get a message telling me it can´t be opened wherever I try to open/save it.

Thanks again for any help,

Mike

nicquee said...

Hi Aneesh,

I was trying to follow your instructions but I can't make it work. I'm not very technical person. Does it have something to do with the placement of code in step b?

Here's what I did:

a. Replaced dl class='comments-block' id='comments-block' with dl expr:class='data:post.avatarIndentClass' id='comments-block'.

b. Added the following code after b:loop values='data:post.backlinks' var='backlink':

b:if cond='data:comment.favicon'
img expr:src='data:comment.favicon' height='16px' style='margin-bottom:-2px;' width='16px'/
b:if
a expr:name='data:comment.anchorName'/
b:if cond='data:blog.enabledCommentProfileImages'
div expr:class='data:comment.avatarContainerClass'
data:comment.authorAvatarImage/
/div
/b:if

Please tell what is wrong with what I'm doing. I just remove the open and close braces to get this comment through.

Thanks in advance.

M Shahidul Islam said...

excellent site blogger

Pabouch said...

Hi, Aneesh, i tried to install it, i see some avatar, but not mine, it's the blogger logo actually. is there something wrong with it?
i copied the code after b) at two places, the one you describe (nothing happened) and before this:

[a expr:href='data:comment.authorUrl' rel='nofollow'
data:comment.author]

and then i had some pic appeared but not the avatar. Can you help me?
I accepted the showing avatar in blogger option and all...
thanx

Blogger Plugins said...

@nicquee ,@Pabouch
i am not able to figure it out.. I can fix it for you guys,if you mail me your template. My email is there in the previous comments..
or you can use the contact form here..

Irhamsyah said...

Hi Aneesh,
I want to follow your instructions, but I don't know where I heve to put that code because I couldn't find this code on my blog this code

dl id='comments-block'
and
a expr:name='data:comment.anchorName'/

where is it ? and so on.
Please tell me how and where I have to put your code

dl expr:class='data:post.avatarIndentClass' id='comments-block'

b:if cond='data:comment.favicon'
img expr:src='data:comment.favicon' height='16px' style='margin-bottom:-2px;' width='16px'/
/b:if
a expr:name='data:comment.anchorName'/
b:if cond='data:blog.enabledCommentProfileImages'
div expr:class='data:comment.avatarContainerClass'
data:comment.authorAvatarImage/
/div
/b:if

or this

]]>/b:skin
and this
.avatar-image-container {background:url(http://2.bp.blogspot.com/_u4gySN2ZgqE/SrTInZfKwVI/AAAAAAAAAwA/xaGlRIqkHDw/s400/default.gif); width:35px;height:35px; }
.avatar-image-container img { border:none;}

or this

.avatar-image-container{width:50px;height:50px;margin-top:-5px;}
.avatar-image-container img {background:url(http://3.bp.blogspot.com/_u4gySN2ZgqE/SrSUS1YpxwI/AAAAAAAAAv4/DihiWlWRxQs/s400/grav.png);width:50px;height:50px;}

on my blog html code.
Please help me.

Thank you.

Veerendher said...

Very good article and very useful. Thank you Aneesh

Lille Skvat said...

It doesn't work in my blog (http://lilleskvat.blogspot.com). I get the same small image in every comment, but it isn't the avatar :-(

Please, help!

Claudiu Constantin said...

well done! Very useful.

Mengembalikan Jati Diri Bangsa said...

I have install this on my blog, but I use Mybloglog Avatar. Thanks anyway for this tips

Yeah, I'm Still Here... said...

Thank you so much for the easy instructions!

Everything worked great except that I noticed for my blog, I needed to do it like this:

1. Implementation of Comment Avatars
2. Save Template
3. Further Styling

I found that if I tried to do both steps at once then saved last nothing worked but this way worked perfect for me!

Thank you, Thank you, Thank you!

Omagaz said...

useful blog

GlobetrotterSA said...

Hi.
I implemented all the code but it only displays my avatar whenever I leave NEW Comments on my blog. It still displays the old blogger icon next to all the previous comments I left on my blog. Is it supposed to work like this?

Is it not supposed to automatically display my avatar on ALL the older comments I've already made on my blog too? Just asking. Or only for new comments from now on?
Example of new comments after your code has been implemented:
http://globetrottingonline.blogspot.com/2009/04/launchy-keystroke-launcher-for-windows.html
Example of old comments after your code has been implemented:
http://globetrottingonline.blogspot.com/2009/08/my-facebook-profile-gives-page-not.html
(as you can see on the last URL my avatar still shows the old blogger icon, not the new avatar)


Another thing I noticed is that every time I leave a comment now, it makes a new copy of the avatar image and stores it in my blogger album at Picasa. If I leave 3 comments on a post on my blog and you look at the Properties of my avatar images, the URLs are different. So if you had to leave 1000 comments over time on your own blog, you'll have 1000 copies of your avatar image in your blogger album! Surely it must reference only one image since I only have one avatar?

Daily Phones said...

when the next post ? ;)

Radu - Marian said...

Very useful, thank you

cuteek said...

thanks it worked for me!

pamungkaz said...

i try and it works.. so much thanks...

Sujith Bhakthan T R said...

could not find the line

b)Now Find all occurrences of
4th one


in my blog ksrtcblog.com

jheny gava said...

hi friends

Mia said...

aww geez, Ive played around w/ my template so much , Ive changed the avatar images so many times, eliminated codes, added new ones - wheeew I cant even find the codes you have listed above anymore- I believe they all ran away to China ! they got tired of getting shifted around by me all the time :))
I'm such a bad girl , I cant leave the codes alone :( poor codes ...

kerja keras said...

Nice tips,..
Success for you!

kancil18 said...

basa apa gw kagak ngertiiiiiiiii........

Yeah, I'm Still Here... said...

Uh oh... what happened? It all seemed to be working perfectly and then all of a sudden only the first five profile pics are showing up in the comments. I noticed that the same thing has happened here too! Any ideas?

Blogger Plugins said...

@Yeah, I'm Still Here,
yea this has happened to all blogs..i hope that the blogger team would soon fix it..

tutorial blog said...

Very uesful. Thank

Anonymous said...

Excellent bro ... I finally got it working. Point b was missing for my template, I copied content before after " dd class='comment-body' " and it worked fine for me.

http://sureshvaishya.blogspot.com

Suresh said...

On each of your post there is the total number of comments displayed on the top. I tried finding that in your site and couldn't find how to do that. Please give directions

ips.jolly said...

Look at comments on my site whats happening : (

http://bloggerplugnplay.blogspot.com/2009/10/zoom-image-to-original-full-size-on.html

राजेश बुढाथोकी 'नताम्स' said...

Help!!!
I can't find my template this code a expr:name='data:comment.anchorName'/ help me???

cars modified said...

very good, I finally found the answer. because I was looking for this tutorial to my blog .. thanks, nice post

Mr. Univesal Tiraf said...

Thanks for Share

Ariadna said...

it is not working on my blog. Please help me Aneesh!!! I sent you an email!

Dharma said...

useful information..

Joe Ndzulo said...

Hi Aneesh. The profile pic shows on my blog but not within the comment like here on your blog, despite following the steps of the hack.

What do I do now?

febriyanto said...

kinda cool tutorial.... :D thx alot,.

Mama Adam said...

thanks again, my simple blog becoming more & more sophisticated with your tweaks

Omyo said...

Nice Tips, but how if any blogger using "template classic"? maybe you can help me.

Nancy said...

only substitute avators show up when I use embedded comments. Real avatars show up when using pop-up comments. Help?

Hendra said...

thanks for share, useful information...^_^

Mike said...

Thanks for sharing!

Megan Anne said...

Thanks so much! I've BEEN trying to get this done. I love your site.

madhur1987 said...

This is sooo cool...thanx man..

siddharth said...

let me test

RoHeHa_6264995 said...

Thank you, it's so great. But I'd like to add some border to the avatars, where can I put that?

Abhishek said...

i am not getting how to use it.....
i have made this blog
http://abhifunworld.blogspot.com

and
http://abhicareer.blogspot.com

The Perfect said...

Thank you !

Glenn said...

Hello, Aneesh, it's me again. Is there a way to change the default Blogger "B" favicon to another one of one's own choosing?

Blogger Plugins said...

@Glenn - Refer http://www.bloggerplugins.org/2007/07/another-blogger-trick-change-favicon.html

Glenn said...

@Aneesh - I'm sorry, Aneesh. I did not mean the favicon on the tab line, I meant the default "B" in 16px which shows up in the comments when the commenter has no favicon for him- or herself. Specifically, as it relates to this post. Thanks.

sibylle said...

cool,like it!

Siaar said...

If you write the same post for Classic blogger templates (HTML) posted Using FTP it will be more helpful for custom blogger template users.

Peter said...

excellent and very informative.

çiçek siparisi said...

Hi very useful information, thank you

Irfan Tanjung said...

thanks for information

Scholarship said...

Thank you very much.
Your website has really helped me in gathering the information I needed.

Donnie said...

Very useful posts... thanks! I have a question, though. Do you know how to make the comment avatars un-clickable, so they don't link back to a Blogger (or any other) profile?

Zero Music said...

Hello there...
some how i am not able to find it for my site....
i really dont know what to do... kindly help me.....

My avatars are not being displayed...
Please visit http://handpickednotes.blogspot.com and let me know... please!

Varun said...

hey there i did everything you told us to but its not working pls help me man

Joao Paulo said...

HI, I'm from Brazil, this tool is very good "Comment Avatars", I'll try to implement.
Nice blog. congratulations!

inasofia said...

i didn't find the two lines you mentioned, but i found:

dl class='comments-block' id='comments-block'

and

a expr:href='data:blog.url + "#" + data:comment.anchorName' title='comment permalink'

can i actually use the steps above with those lines?

i've tried, but it doesn't work :(

thanks for your attention :) nice blog!

Musang said...

it works very well on my blog, thanks

Jennifer said...

Works great - thanks!

One question I have - I would like to stylize the comments even further. I'd like to put the avatar and the commenter's name in a separate box above their comment (maybe 2 separate colored boxes?). Do you know how I could do this?

Izhar Fareed said...

I have added. It works.

Lisa Brown said...

Hi - I couldn't find an occurrence of

In the custom blogger template I'm using. If you could help me out, it would be greatly appreciated. http://lisabrowndesign.blogspot.com/

"bayu arcapada" said...

good!

Aria Kerry said...

Hi - I'm using the author comments hightlight hack, and sadly using these instructions didn't work. If you could help me figure out what I'm doing wrong it'd be very much appreciated!web design

Chemi said...

Thank you. It works like a charm!

DuFFeR - ڈفر said...

just checking my openid avatar is shown or not?

yusuf_89 said...

how to create register/sign in in my blog?
why when we register to follow, we cant comment use this profile....

Azura Ani Salaim said...

love it! it did work for me! thanks! bookmark this site already!

Венцислав Сотиров said...

Not working.

Beth F said...

I've been using your code since you first put it up but suddenly it isn't working any more. I haven't changed my code or template. I can't see the avatars in FireFox or Chrome. I have a friend who uses your code and the avatars are still working for her. Any ideas?

I love your code and have a link back to here in my blog's footer.

The Review Diaries Writer said...

Let me se if it works.

Ha4k the Boss said...

Cool

Onur said...

Thank you very much!!!! I have become crazy to sold this! And i couldn't solve the problem without you! Thank you very much=)

Teddyatie said...

Thankz a lot!

Sherman Unkefer said...

Great information resource! Thanks for sharing!

Nto said...

Thx bro, it's working :D

ToTo Antonio said...

Works Fine with my Template. Thanks...

M'dame Jo said...

Thanks, it worked well... but I couldn't get to have the same border as I have around the blogger avatar (I have a thin border around them)

I've tried border: 1px solid $(image.border.color); instead of {border:none;} but I couldn't get a border. Frustrating.

WoW said...

Thx a lot Aneesh. After several attemps, I finally made it to my blog. Thx and keep up your good works. Will visit again soon.

Doraemon The Movie said...

it's work..!!
Thank you so much.

Indira Triawarman said...

my avatar shows here but on my blog

Nacho said...

Hi!

My blog is http://yoyepunto.blogspot.com and I can't find any ANCHOR in my template. What can I do? Thanks in advance!

Bank PO said...

nice one i ll use his @ www.jasica.in

RIDHO ILLYASA said...

Greta post :)

Anonymous said...

please help me add avatar to recent comments. mail to vietlao2003@gmail.com

Retnet said...

yes..!!
this great tutorial.
BTW, how to generate favicon url blog to gravatar blogspot ?
avatar comment from favicon url like this http://gravatar.com/favicon.ico

any idea ?
thank you.

y8 said...

Your blog is great , thx for the tips

Anonymous said...

honthakun pektra. thanks

chanmony said...

Good

Post a Comment