Pages

Thursday, November 17, 2011

9

Comment bubbles for Blogger using an image

Similar hacks have been available before, this one adds nothing new or special to them, except the CSS code may be a bit tidier. Some might want to use this in their Blogspot blog for its simplicity: the same version gives same results in all browsers, and the CSS code is not long.

In this blog I use a combined method that uses CSS3 whenever supported, so this image comment bubble hack is not installed in this blog, instead a combination of this hack and the CSS3 comment bubble hack, more about that in this post.

Add comment count code

First we will add the link to "post.url#comments" next to the post title. Open your template html, and expand widget templates. Find lines:
<b:includable id='post' var='post'>
  <div class='post hentry'>
    <a expr:name='data:post.id'/>
    <b:if cond='data:post.title'>
      <h3 class='post-title entry-title'>
After those lines add (doubleclick to select for copying):
<b:if cond='data:post.allowComments'><a class='comment-bubble' expr:href='data:post.url + &quot;#comments&quot;' expr:title='&quot;Comments to &amp;quot;&quot; + data:post.title + &quot;&amp;quot;&quot;'><data:post.numComments/></a></b:if>
Save the template.

Add CSS for comment bubbles

If you want to have own bubble image, first you need to upload the comment bubble image to some server, to your Picasa web album, for example, and get its url address. I use this image uploaded to my Picasa web album, its url is http://lh6.googleusercontent.com/-IVVxPuuguig/Tr_NWRIN3HI/AAAAAAAAAWs/weLvk3eWQtM/s800/comment_bubble.jpg.

Then go to Template designer, choose Advanced, Add CSS. Add the following simple CSS definition:

Data provided by Pastebin.com - Download Raw

Change image url, if you want, and image width and height. Paddings can be changed to change text position inside the comment bubble image. Apply to blog – comment bubbles are installed.
[Hide comments] - [Show comments]
Click on a single comment to hide/show its text

9 comments:

kumar said... [reply]

Thank you for sharing .
www.urldata.blogspot.com

Aparecido Rosario said... [reply]

I loved this hack a lot! I've just implemented it in my blog.
It's awesome!!! :)

MS-potilas said... [reply]

@Aparecido Rosario
Great you liked this, it is easy to install and customize by changing the image. Thanks.

robbie said... [reply]

Well done!

I noticed a change in blogger's comment URL, it's now #comment-form vs the previous "#comments"


;)

MS-potilas said... [reply]

@robbie Hi, and thanks for the observation.

It may depend on the template, seems that the templates I'm using have both anchors on the post pages. #comments is positioned at the beginning of comments block, and #comment-form is positioned at the end of the comments block, where the comment form or the link to posts comments is.

But this may have changed in couple of months (I made by YABTB demo blog in January 2012 and there's still #comments). One could either add the #comments anchor to top of the comments by editing template, or change the link to point to comment form.

robbie said... [reply]

@MS-potilas

Yes, I should have added the caveat that it's template specific, and I can see pros and cons of each, really.

Inspiring, work here!

Jessica said... [reply]

I am having a hard time implementing this on my blog. For some reason it just shows up as a number on the left of my post title with no bubble or anything... Here is my blog http://themorningletters.com Any advice?

MS-potilas said... [reply]

@Jessica Hi, I think you've succeeded with the first part (add comment count code), but there's some problem with adding the CSS codes. In the new interface, click Template, then Customize. Template designer opens. Select Advanced, Add CSS, and add the CSS definition, just change background URL to the image you want to use (or you can use the same I have). Hope you get it working. :)

scott grin said... [reply]

Thank you so much. I was really encountered with this problem several time, AWWW i received the good solution now
seo company

Post a Comment

Related Posts Plugin for WordPress, Blogger...
See the hack
for this dynamic
views icon: