June 24, 2008

Recent Comments for FTP Bloggers

All blogs which are hosted on Blogger publish a comments feed along with their blogs. But those who choose to publish via FTP to their own hosting account are unable to publish a feed for their comments. Update: FTP blogs do publish a comment feed! I have written a separate post about comment feeds for FTP blogs, which includes the URL structure you should use, and also a script which can be used to display recent comments.

Thanks to Pete for this helpful information!

In this post, I'll explain two different methods you could use to display recent comments in your FTP published Blogger blog without accessing the comments feed.

Method 1: Using template tags to display recent comments from the main page


Blogger recommends making use of template tags to display recent comments in the sidebar of Classic templates.

This is not strictly a list of recent comments, as it can only parse and display comments from the page on which it is displayed.

Therefore, on the home page, this code will display comments which are associated with posts displayed on the home page. More recent comments may have been made on previous posts in the archives, but due to the nature of this code, these comments will not be displayed.

If you would like to make use of this method, you can make use of the following section of code:

<MainPage>
<h2 class="sidebar-title">Recent Comments</h2>
<ul>
<Blogger>
<BlogItemCommentsEnabled>
<BlogItemComments>

<li><$BlogCommentAuthor$> //
<a href="<$BlogCommentPermalinkURL$>">
<$BlogCommentDateTime$></a></li>

</BlogItemComments>
</BlogItemCommentsEnabled>
</Blogger>
</ul>
</MainPage>


Paste this code into the sidebar (or other) section of your blog's HTML code, which can be seen in the Template>Edit HTML section of your blog's dashboard.

This will display a list of the names of commenters, followed by the comment permalink.

If you would prefer to also display the body of the comment in this list, you could use the following section of code instead:

<MainPage>
<h2 class="sidebar-title">Recent Comments</h2>
<ul>
<Blogger>
<BlogItemCommentsEnabled>
<BlogItemComments>

<li><$BlogCommentAuthor$> //
<a href="<$BlogCommentPermalinkURL$>">
<$BlogCommentDateTime$></a>
<p class="comment-body">
<$BlogCommentBody$>
</p>
</li>

</BlogItemComments>
</BlogItemCommentsEnabled>
</Blogger>
</ul>
</MainPage>


This will display the commenter's name and comment permalink followed by the entire body of the comment.

Be careful when using this method, as there is no way to display only a summary of the comment. If readers leave rather long comments on your posts, this will take up much space in the sidebar!

Method 2: Using Storago's Recent Comments Service


Storago provides a useful service to display recent comments which will display a true list of recent comments for those publishing by FTP.

This system works by collecting recent comments posted to your blog, and using JavaScript to display them. Storago collects these comments using Blogger's comment notification by email system. You will need to add a unique Storago email address to your comment notification settings for this to work, and it may take a while for the recent comments to begin displaying in your sidebar.

Here's how you can set up the Storago method to display recent comments in your Blogger FTP blog:

Sign up for your free membership to Storago and wait for your welcome email (mine arrived in about 10 seconds, you you shouldn't be waiting too long!) Once this arrives you can validate your membership and log into your account.'

After logging in, you will see a page featuring the tools accessible to you. Choose the "Free recent comments add-on" link.



Then choose to add a new blog.

The following page may seem a little confusing as there are no clear instructions of what you should be doing with the information presented:



On this page, you need to copy the "Comment Notification Email" address, which will be something like recom-123-someword@storago.com.

Then go to Settings>Comments in your Blogger dashboard. Add this email address into the comment notification area near the bottom of the page, then save your settings.



Once you have added the comment notification email address provided by Storago, go back to the Storago page and choose the "Add recent comments to your Blogger template" link. This should bring up a page which looks like this:



You should copy and paste the JavaScript code from inside the gray box into the sidebar section of your blog's HTML code (where you would like this to appear in your design).

By default, the recent comments script is designed to display the commenter's name and the title of the post on which they have commented with the date of the comment beneath.



As far as I can tell, Storago does not allow us to post the body of the comment in the widget. However, we can force the full title and other features by adding code phrases to the JavaScript code (which are detailed on the page where you can find the widget code for Storago).

Comments published on your FTP blog will display in your recent comments widget as soon as they are posted. If you do choose to moderate comments, you will need to approve comments before they are posted in your recent comments widget.

I hope these methods have helped you understand how recent comments may be added to your FTP published Blogger blog without accessing the comments feed.

Please note that this post has now been edited to reflect the information posted by Pete in the comments, and that an update about FTP comment feeds can be read here instead.

Advertise on Blogger Buster

Browse through the Archives

All existing posts are still available to view while I'm working on the site, albeit seen in a much simpler interface. Feel free to browse through the archives to find tutorials, templates and articles to help you build a better blog:

Blog Archive

© Blogger Buster 2010 Home | About | Contact | Hire Me | Privacy Policy