Friday, February 15, 2008

Now See This: Adding Comments to your Blogger sidebar

One of the features I have always enjoyed with Chron.com TechBlog and other blog sites is being able to see recent comments up front.  In fact, the TechBlog is one of the few places where I actually subscribe to the comments feed along with the main posts.

I have now added a sidebar element to the GSD blog which meets this need.  Scroll down a bit and you should see it along with (at this time) comments from Fird, TxGoodie, Jim and Therion Ravenwing. (Thanks all!)  I feel really fortunate that there are such kind and warm folks who take the time to leave a comment over here.

I think providing recent comments on your main page can work to to illustrate to new visitors that a blog has a good community behind it; "street-cred" if you will.  And faithful readers can quickly catch up on older posts that are still generating interest.

In addition, some of the threads generated in the comments can become a story unto itself, often surpassing the original blog post in information and detail.  I almost always take the time to look for comments on a post I am reading to see what the "vibe" is and if there is any supplemental information provided by readers.

If you are a regular blog reader and are feeding the main page, or dropping in to it directly,  you almost always miss the comments.  Unless you click on the main post, proper, you might never see them.

And, there is always something rewarding and fun when you are able to view your comments along with your name.  And it seems like a fine way to thank your faithful commentors.

Unfortunately, Blogger doesn't have a "ready" widget to use to add recent comments to your layout.

So I went looking.

Blogger Buster "Customize Recent Comments Widget"

This was the first site/solution I located.

Blogger Buster is a fantastic resource for folks looking to understand and enhance their Blogger blogs.  Lots of templates, quite a few tools, and a notebook full of tips.  Great site to bookmark for all you Blogger/Blogspot fans out there.

On the site I found this post

  1. Just insert your widget title,
  2. Add in your blogger/blogspot address,
  3. Set the number of comments to display,
  4. Decide if you want to show comments and post title, and how many characters of the comment.
  5. Apply and add the Widget to your blog.
  6. Done.

I tried it and almost worked great.

For some reason it wasn't formatting the Grand Stream Dreams comment feed correctly in the code.  Once I inspected the code and found the errors, I was able to fix them and it worked and looked very nice.

However there was one drawback.  It works off a .js (JavaScript) file located on the Blogger Buster servers.  That's not a problem in-of-itself, but there are some web users (and site administrators) who don't like that for security reasons.  I'm not saying that there are any problems with this one, but if the remote server were to be compromised (or simply go off-line) and the code was compromised, then that compromise gets spread across all the endpoint blogs using it.

So while I can say the Blogger Buster widget works great, that might be a concern for some folks.

Download Squad actually picked up that post and featured it.  How to add recent comments to your Blogspot blog

What else could I find?

Tips for New Bloggers - Custom JavaScript Solution

I did like the JavaScript solution, but wanted a way I could maintain some control over it (not that I am a JavaScript coder or anything) to ensure I could always inspect it and was "hosting" it myself.

A bit more digging turned up the solution I am now using:

Another simply amazing website filled to the brim with tips, tricks, templates, widgets, javascript and all kinds of other goodies for Blogger users. bizwhiz's detail in going over code elements, how things work together, and why some solutions are better than others is simply invaluable for beginners and pros alike.  Highly recommended website.

Anyway, in this post, bizwhiz first illustrates how to turn on Comment feeds for your Blogger blog.

Next is a discussion on JavaScript and the fact that some folks don't like it due to security concerns.  I was impressed to see this discussion addressed.

Instead of giving you a pre-formatted .js code to link to in your widget, bizwhiz provide you the code directly.  You can inspect it, review it and decide what you think.

If you like it (which I do) using it is very, very simple.

  1. Log into your Blogger Dashboard and go to the Layout section.  Go into the "Page Elements" and select "Add a Page Element".
  2. In the list of items, find the "HTML/JavaScript" widget and add that.
  3. Copy the JavaScript code from the blog-post and paste it into the widget's text-box field.
  4. Adjust the comment.length and comment.substring values up or down from the default value of "100" if you wish. (Just make sure they match).  It's pretty clear in the post where these are located.
  5. If you want more than 5 comments to appear, adjust the variable that controls that in the top of the code.
  6. Finally, insert your blog's comment-feed URL where indicated in red.

Save the changes and refresh your blog homepage.

Done!

Other Solutions

There are actually even easier solutions than these if you wish.

David over at eBlogTemplates illustrates a VERY easy solution.

How to Setup Your Recent Posts and Recent Comments Blogger Page Elements - eBlog Templates

  1. Add a Feed widget from within Blogger,
  2. Insert your feed URL  ( http://[yourblognamehere].blogspot.com/feeds/comments/full )
  3. Give it a title: Recent Comments.
  4. Set the options for number of items, show dates (y/n), and show names (y/n).
  5. Save and done!

Whatever solution you go with, it is very easy to recognize the contributions of your blog's commenters.

Cheers!

--Claus

No comments: