How Show Blogger Profile Images In Comments As Avatars



How To Show Blogger Profile Images In Blogger Comments.As many of us bloggers saying it as showing of avatars in blogger comments but they are not avatars, they are just your blogger profile images and many readers also get mistaken by it, But they are right to say them as avatars, as they are like avatars for our bloggers.As it has been near about an month blogger has released this feature and i have found most of the bloggers also using this in there blogs.But some still have problems and not have made the solution for blank spaces in comments for anonymous comments.So i would like to hold a complete detailed tutorial on it.The below picture show up how profile images show up in blog as i have taken this snapshot from my blog after implementing this hack.



Now How to enable the blogger profile images in blogger comments.

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



If you are using default blogger templates then they get enabled and profile images will start up to show in blogger comments.They can also start up to show up in some customized templates but it depends at to what extent there comment section been customized or not.

Some Of The Problems You Wouldn't Like even after Enabling Profile Images In Default Template.


There will be two major problems in it.

1)The bloggers who don't have uploaded there profile images to there profiles while comments will show up a blogger favicon of size 16x16 like below.It doesn't look good from my point of view because the blogger profile images show up a picture of size 35x35.



2) The bloggers who do comments with there blog urls or anonymous comments will end up with a blank space in comments.That looks really awkward.It destroys the beauty of comment system as you can see from below image.



I have shown all the 2 problems in above picture as i hope it will be clear to you right now.Now we need to solve these problems.But first i would like to tell you about how to enable profile images in comments in blogs who are using customized templates, just what they they need is to edit small bit of codes in there blogger html.Now carry on with this tutorial.

How Enable Blogger Profile images In Customized Templates



First of all enable the feature of profile images in your blogger settings as i showed above.Now check your comments.If it shows up blogger profile images in comments,then its ok else follow next step.

First step Go to Blogger Layout >Edit HTML and backup your template.Now Expand the widget templates and check if you can find this line there


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


If you don't find above line then find below line:-


<dl id='comments-block'>


And replace it with the above line which you didn't found in your codes.

And if you still not able to find the above line you may get this one:-


<div id='comments-block'>


And replace it with the top most line which you didn't found initially.

Now find this line in code:-


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


And replace it with below codes.


<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 then you can get this code <a expr:name='data:comment.anchorName'/> once more in your template but not necessary.So replace it also with above codes.

Now Save your template and you will be now able to see blogger profile images in your comments as i showed above in picture but with the two problems of showing favicon of small size and blank space for anonymous and other url comments.

Solution For The Problem



What we need is now to resize the blogger favicon to the size of blogger profile images and we need one more image for showing up for anonymous and url comments.As Soufiane from LeBlogger was the first to come out with the solution and helping us.

Now Just Go to blogger edit/Html and find for ]]></b:skin> tag and place the below css codes before it.


/* Avatar */
.avatar-image-container img {
background:url(http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=35);
width:35px;
height:35px;
}


You can just edit the image link, height and width in above css codes as you like.

Save it, You're done.

Now The the above image will be shown up for anonymous and url comments and favicon will be resized to width and height of size as you set as above in css codes.Now check how the better comments look as compared to above i shown.



I am sure now you will have no problems in implementing this in your blogs.If still you have some problems leave your comments i will try to solve them.Best Of Luck !

As i have been seeing that some of the bloggers are not getting this line <a expr:name='data:comment.anchorName'/> in there codes.So i wanna tell you one thing i.e the complete codes which enable profile images to be placed in the blogger.Just you have to place these codes in blogger, i think they might also can help you.


<dl expr:class='data:post.avatarIndentClass' id='comment'>
<dt expr:class='&quot;comment-author &quot; + data:comment.authorClass' expr:id='data:comment.anchorName'>
<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>
</dt>
</dl>


If you will put this codes in place of the code i told you find in beggining of tutorial that is the comment-block one the hack will also work, just you have to adjust the closing of div tags or dl or dt tags depends what have been defined in your template codes.

And if still you not able to do it and want to enable it,just invite me to your blog at my id anshulaffprg[at]gmail.com and i will do it in 5 minutes for you as i get admin to it.

71 comments:

Shaamil said...

Blogger has introduced profile pictures, so the function is available natively. You just need to enable avatars from the settings page.

However thirdparty templates may be unable to show the profile pictures in comments.. then of course they can use your hack.

Alternatively you can use www.disqus.com which is a great comment system. I have switched to disqus.

Thanks a lot.

BrahmaKumar Vaskar said...

Anshul Jee....

I want to ask you one hack!

How to separate recent posts in boxes? as you have done in your landing page

This post is very informative

Greetings from http://www.vaskar.com.np

Anshul said...

@brahmakumar

Just apply this property in blogger html css

.post {
border: 1px solid #ccc3c4;
}

angelshair said...

This new feature seems cool! I have to take the time and install the code. Thank you for all your tips!

Mr G.A.G. said...

Nice hack but there is one problem still.

The comment author's photo shows up only on the first comment they make, not the second, the third, etc.

Watch.

Lonely.Boy said...

hay sir,
sir mere template main ye line find hoo gaye hai

div id='comments-block'

per sir mere template main ye line find nahin ho rahi

a expr:name='data:comment.anchorName

sir ab ye batain ke main is ko kis tarhan se install karoon apne blog template main

wandering soul said...

Your hacks are super awesome!! :)
I just love your site. All my blog layout is designed using hacks from your site only. Keep sharing the knowledge.

Anshul said...

@Mr C.A.G
You are right.

@lonely boy
i have to see your codes.

@wandering soul
Thanks

Prabhat's Books and Comics said...

In my case author's photo is showing up to 2nd comment, later not. And sometimes not even first time. Check
http://ijc-by-munnabhai.blogspot.com/

:)

However, the comments are looking more organized in the boxes. Thanks for this hack!

Lonely.Boy said...

Hay Sir
sir jis tarhan aap nay apni web site main contact us ka Page Bana Raha hai sir Is Hi tarhan Ka Contact Us Ka Page Main Nay Bhi banaya Hai,
per Sir Us Contact us ke page ke Sath Comments Ka Box BHi Us ke Nachay Aata Hai,
just like this
http://lonelyboy143.blogspot.com/2009/10/contact-us.html
Sir ye Kis Tarhan se Hoo Ga?
Plz tell Me
byee

Anshul said...

@prabhat ya this is the problem we facing.

@lonely just go to that contact us page post and disable comments for that post so no comment form will appear for it.

Anonymous said...

but some times no images are shown if blogger profile is blocked shown the default blogger image some times in my old posts and new posts no avatar is shown.this problem is also in your blog.how can i solve this.please help me

cool said...

hi brother how can i add the sidebar icon that shown in your blog,follow us,facebook and orkut icon how can i add these in mu sidebar

Anshul said...

@anonymous at the end i have told you to add css part add it.With this the space will never appear blank.Atleast that image will show of for sure.And all comments that will be with profile links of blogger will show up a blogger favicon only for previous comments,the blogger profile image will shown up only in previous comments in case if he or she would have added blogger profile image also in past when it commented.Then it will appear.

@cool Its just simply images with link.Take image and link it then other and link it and add codes in a widget in sidebr in html/javascript.

Lonely.Boy said...

Thx Soooooo Muchhhhhh Sir jeee

Tata

Soufiane LeBlogger said...

Hi Anshul,
So you finally publish this !
Avatars fail to display for blogs with many comments since October 16.

check the official message from Known issues published on October 19:
Some profile images are failing to display on embedded comment forms with many comments. We're looking into this and will reply with and update shortly.

Soufiane LeBlogger said...

Thanks, thanks a lot Anshul for the link....

My blog PageRank was updated today (Aneesh one too), yours too ??? now it's PR3 Congratzz dude....

Anup said...

Hi anshul your blog is great and priceless posts. I like your blog. Visit: http://hacktutors.blogspot.com to know how to add a background image to the single widget. Please review it:)

Thank You!!!
Hack Tutors

Anshul said...

@soufiane its bad news for me when i was on blogspot it was 4 and on domain it reduced to 3.Sad for me i was expecting atleast 4 to be at same position.

Soufiane LeBlogger said...

Yes it's bad news, i thought also you had better PR before but now with custom domain, I am sure it will be PR5 or PR6 with the next Dance ...

Anshul said...

@soufiane thanks but i also think releasing templates and giving footer credits links nofollow link will be good as making them dofollow leads to hundreds of useless backlinks from 0 rank blogs which effects the pr.

Sultan Mehmood said...

hello sir in my blog comments does not show in profile selection area the anonymous and name url how to add these help me.

Soufiane LeBlogger said...

So you think that many 0PR backlinks is bad for your own PR ???

AMER said...
This post has been removed by the author.
Anshul said...

@soufiane ya its always bad to have so much 0 or 1 page rank backlinks.
@amer can't say until i check or see codes whole.
@sultan unable to understand what you want to say.

Sedran said...

Why do some people's avatars look the same although they don't use the same avatars?

ClearlyEnlight, said...

I cannot find the second code that need to be replaced.

Anshul said...

@clearly then i need to see your all codes and tell you.

Ariadna said...

Thank you I tried but it doesn´t work in my blog. Can you help me?

http://suma-wszystkich-smakow.blogspot.com/

suma-wszystkich-smaków@gmail.com

QwertyWEB said...

dude , see my blog http://qwertyweb.blogspot.com
i m unable to find code of comments - block ,
any other way to enable avatars ?

Anshul said...

@qwerty i have added more part in post read it completely now.

QwertyWEB said...

Neither div or dl comment block ,
and also not
data:comment.anchorName
Still cant understand yaaar ,
Can i send you its html copy ,How can i
Thanks

Anshul said...

@querty Just grant me admin it will be good if you don't want send me html with expanding widgets in notepad file at my email mentioned in post.

qwertyweb said...

Just tweeted u link of html expanded template of my blog in your twitter account , check @ replies

ADMIN 4ALL said...

hi,Anshul

my template have no a code

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

i try follow your second method but comment profile not shown

please help me, thank you.

http://hackublog.blogspot.com/2009/09/2.html?showComment=1260261498643

Anshul said...

@admin just mail me your codes i will do that for you.

ADMIN 4ALL said...

@ Anshul , Thank for your support .

but i don't known your email

and my email is nuthawud1@gmail.com

ADMIN 4ALL said...

sorry again..

this is my code...

http://www.mediafire.com/?5wnj2ezujnt

Thank you very much.

Anshul said...

@admin the codes you gave had comments avatars activated in them i checked by installing.You might not have activated the option to show avatars. Activate them as mentioned at beggining of my post.
As you can see here http://blogger-design-tutorials.blogspot.com/2009/05/funny-road-accidents.html
I did nothing to your codes and showing avatars.

ADMIN 4ALL said...

Hi, Anshul

I have already setting to show profile follow your first step ,but i can not see avatar yet.

This is a picture when i setting to show profile.

http://3.bp.blogspot.com/_uJ9ptu1GqQ0/Sx__8Wb7K8I/AAAAAAAABCc/wh7leB0Lnl8/s1600/Avartar%20setting.png

Thanks for the help and kindness.

Anshul said...

@admin ya but in your codes it was installed.If you really want then u have to grant admin to me to your blog to check now and solve it.

بطوط حبوب said...

hi,Anshul

the first code in my template is
dl class='comments-block' id='comments-block'
so I don't know how to replace it by ur code
&
I can't find the second code
expr:name='data:comment.anchorName

so could u help me?
U can download my backup template from here

http://www.4shared.com/file/181853087/d6b7190a/template-6821969237183798756.html

Anshul said...

you all commensts have been made in wordpress style need to change template or whole comments codes.

بطوط حبوب said...

thank u anshul

well , now I want to change my comments codes , but I need to know what codes need to be changed and what codes need to be put?

I'm sorry but can u help?

Anshul said...

just download your xml with activated avatars from below link.Just get download button at bottom of page.
http://www.filefactory.com/file/a149c39/n/send.xml

Soufiane LeBlogger said...

www.anshuldudeja.com is PageRank 5 now, hooora !

Anshul said...

@soufiane thx for informing and ya its new year gift from google hoora ! and happy new year !!!

tiz me said...

really good , followed it and it worked straight away - thank you x

Vito Winarianto said...

I've followed all the steps..
but why not work on my blog..
do you have any solutions?
please help me I really need it..

thanks before & regards..

check my blog

Anshul said...

@vito your avatars are working i checked.Just they are showing half due to not proper coding.Just add
#comments {margin-left:12px;}
It will be ok then i think.

post2.soo said...

ty very much for the info!

Adrian said...

thanks for the info, now my blog can use this!

Clara Lascale said...

Hi Anshul! ...really need your help.. I dont like to have the »orange B« in the comments, neither an avatar-image, i just like to have the same image fo everybody or alternativly nothing/just white space... do you know what I mean? Do you know a solution for this? I am already totally confused, sorry about that..

Anshul said...

@clara just go to blogger settings > comments and selct this option "Show profile images on comments?
"as No.

Clara Lascale said...

... good morning... thanks for your answer Anshul! But if I select the option »No« still apperars the blogspot-Logo/»orange b« and I like to have just the name of the Person, without any Image or default-logo before... Do you think ist possible or do I have to use a totally different code for the comments?

Clara Lascale said...

Hello Anshul! ... just wanted to tell you that i fixed the problem by myself :-)

I was using the posted code in your post about the avatars/the post in »leblogger« the other way round and now I have a nice and clean looking comments-section, only type and no pictures!

But if you have a different solution, I am still very curiuos about it...
(I am not sure whats the time now where you are, I am writing from germany and so probably ist very different...)

but, there is another Problem, similar to the one before...

its about the »Followers-section«: I really like to have the more or less same design, also no Pictures, just the name, is ist possible??

greetings!

Anshul said...

@clara ya giving no optin will still show blogger favicon but will not show profile pictures.To remove favicon there are some codes but messed up in comments so difficult to tell you as may be you would have removed them only.

No for followers widget you have to keep pictures.

Eric T. Lurick said...

The Blogger icon looks ugly when it's resized from 16px to 35px. Here's my solution:

1. Get your own icon, resized it to 35px/35px and upload it to your server.

2. Add this lines to your CSS rule :

.avatar-image-container .avatar-hovercard img {
display: none;
}

.avatar-hovercard {
display: block;
width: 35px;
height: 35px;
background: transparent url(PATH TO YOUR ICON);
}

It seems to work fine on my blog

Anshul said...

@eric its wrong display:none doesn't allow to show profile images.If you remove it then all images will be the aove one used in your css.

Zero Music said...

hello there...can you hve a look at my site... i need help please!!

i have tried everything and anything to make the avatars come on the FOLLOWERS and COMMENTS....but doesnt...
i am using a customized design....

Also, i would like to know how i can change the style of "how the comments are posted " in my posts...it looks ugly with the white...
can u help me there... which code shud i change...

the site is... http://handpickednotes.blogspot.com

Anshul said...

@zero the template you using is working fine.See the comments avatars working here.
http://bloggertube-demo-dantearaujo.blogspot.com/2009/09/michael-jacksons-greatest-live.html

If have any problem visit this page
http://www.dantearaujo.net/2009/09/blogger-video-template.html

Zero Music said...

@anshul...

I did the template u gave...
when i posted a comment there, my avatar was not shown... it was simply using the ANONYMOUS image.

Could you help me find a solution...

Anshul said...

@zero see now i posted comment on your blog its showing avatar of mine.Working fine yar.
http://handpickednotes.blogspot.com/2010/05/economic-slowdown.html

RP4 said...

Friend, I'm using the Chucky template and i'd like to show the images of the blogger profile.
My test blog: www.psn-brasil.blogspot.com
Thanks :D

Anshul said...

@RP4 Ya i know, will update the themes in few days wait for it.As me updating all my themes this month and making gallery of them for my readers.

RP4 said...

@Anshul Thanks!! :D

Svetlana said...

Hey hi.. I see no change in my blog.. I followed another tutorial also but I got no images just a strange box. I don't like hacks from different sources coz then i will mess up with my template, thats why I come only to you. I am using your the latest template (older one) and it is not working

Anshul said...

@svetlana ya i have updated the latest template in that avatars are working.Why dont u also back up ur templates and widgets first and update the template.Pages also workng now on updated template.

Post a Comment