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 (http://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 (http://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?