Comments add value to your weblog. Share them with your feed subscribers.
I wanted to add comments to my existing feed for my weblog. I did not want to create a separate feed for my weblog’s comments for the same reason that I retired my category-based feeds: sometimes simpler is better, and one feed is better than many.
Because I make extensive use of template modules in Movable Type, adding comments to my feed was a simple matter of adding one line to my
atom.xml template file. Here’s the relevant section and the change (shown in bold):
... <content type="html" xml:lang="<$MTBlogLanguage ietf="1"$>" xml:base="<$MTBlogURL encode_xml="1"$>"> <$MTEntryBody encode_xml="1"$> <$MTEntryMore encode_xml="1"$> <$MTInclude module="my-comments" encode_xml="1"$> <$MTInclude module="my-feed-fun" encode_xml="1"$> </content> ...
Next, I added the
<MTElse> tags to the my-comments module so that the comments section is only displayed when (1) comments are open or (2) comments are closed and there are existing comments. When comments exist and are closed, a message appears in the comments section indicating that comments are closed. When comments do not exist and are closed, the comments section does not appear. When comments are open, whether or not there are any comments, the comments section appears. For more info, see (and view the source of) the my-comments template module (https://www.giantpeople.com/mt/mt-templates/my-comments.html).
Finally, I added the
<MTIfCommentsAccepted> tag to the template module that I include at the footer of each article of my weblog feed. This displays the “Add a comment” link only when you can actually add a comment. For more info, see (and view the source of) the my-feed-run-random template module (https://www.giantpeople.com/mt/mt-templates/my-feed-fun-random.html).
Now, with my Atom/RSS reader, I can save/bookmark the entries from my weblog feed and monitor them for changes (i.e. new comments, spam comments) as they occur.
For my other Movable Type “how to” articles, see:
- Movable Type And Mailman (6/2/2003)
- Movable Type And Mailman, Part 2 (6/2/2003)
- Movable Type Brain Dump (4/28/2004)
- How To Quickly Block Blog Spam (8/25/2004)
- Changes To My Weblog With Movable Type 3.2 (12/2/2005)
- How To Add Keywords To Your Blog With MT-KeywordExtractor (5/8/2006)
- How To Add Tags To Your Movable Type Blog With Tagwire, or Tagmogrify Your Blog, or Burn Your Feed Without FeedBurner, or Mr. Pibb + Red Vines = Crazy Delicious (5/9/2006)
Of course, many of those articles are likely displayed in the “Related Entries” section below, which is generated automatically. Ain’t technology grand?
4 Replies to “* How To Add Comments To Your Weblog Feed In Movable Type”
As I think you know, I use SharpReader. I initially had this post locked but marked as read. When you added your comment, it appeared as changed. I then deleted it from SharpReader, added a new comment, and the post did not re-appear in SharpReader. Which is how it should work, I believe. If an article has changed, it should appear as changed, not as new, in your feed reader. Does your reader operate differently?
If you delete an article as read in your feed reader, will it re-appear as unread when new comments are added? Is that what you’re asking? It may. I think it depends on the reader.
I think it also makes sense to only have the most recent articles open for comments, which will prevent really old posts from re-appearing in your feed reader if, for example, blog spam is addded.
Yes, that’s exactly what will happen. It all depends on whether you consider that a feature or a bug. The alterntives are (1) no comments in your feed, which forces readers to go to the website for the comments (I think you blogged against summary RSS feeds this week, which do the same thing) or (2) comments in a second feed, which forces readers to subscribe to a second feed (awkward).
I think my feed should look like my website pages, complete with comments, links, ads, interactivity, and the like.
Feature or bug. It depends on your perspective. By the way, I discovered your comment in precisely the way you mentioned (i.e. in my feed reader). So for me, it’s a feature.
Won’t this result in your feed item status updating every time a comment is left, resulting in me having to repeatedly view your item in my aggregator? If I understand what you’ve done, after I’ve marked the item as read, the next comment that gets left will trigger an update to the feed, which will tell my aggregator that you have new content, which will make the feed appear ‘unread’ again… for high-traffic posts, this could get really cumbersome for your readers.
Or am I missing something?