revjim.net Rotating Header Image

how to add a comments feed: version 2

About a month ago I wrote a tutorial on how to add a comments feed for MovableType. I've realized that there are a few errors in it and so I offer to you version 2. revjim.net has been updated with this new template.

If you've already added a comments feed, all you need to do is edit your comments feed template and replace the code found there with the code below. If you haven't you'll need to follow all of the instructions.

  1. Log into your MovableType install.
  2. Select "Manage Blog" underneath the blog you wish to add a Comments Feed for.
  3. Choose "TEMPLATES" in the navigation bar onthe left.
  4. Click on "Create new Index Template" at the top right hand corner.
  5. Type "Comments Feed" in the "Template Name" box.
  6. Type "comments.rdf" in the "Output File" box.
  7. Paste this under "Template Body":
    <?xml version="1.0" encoding="iso-8859-1" ?>
    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
        xmlns:dc="http://purl.org/dc/elements/1.1/"
        xmlns:admin="http://webns.net/mvcb/"
        xmlns="http://purl.org/rss/1.0/">
        <channel rdf:about="<$MTBlogURL$>">
            <title><$MTBlogName encode_xml="1"$> - recent comments</title>
            <link><$MTBlogURL$></link>
            <description><$MTBlogDescription encode_xml="1"$></description>
            <dc:language>en-us</dc:language>
            <dc:date><$MTDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date>
            <admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" />
            <items>
                <rdf:Seq>
                    <MTComments lastn="15">
                        <rdf:li rdf:resource="<$MTCommentEntryLink$>#<$MTCommentID pad="1"$>" />
                    </MTComments>
                </rdf:Seq>
            </items>
        </channel>
        <MTComments lastn="15">
            <MTCommentEntry>
                <item rdf:about="<$MTEntryLink$ encode_xml="1">#<$MTCommentID pad="1"$>">
                    <title><$MTCommentAuthor encode_xml="1"$> comments on &quot;<$MTEntryTitle encode_xml="1"$>&quot;</title>
                    <description><$MTCommentBody encode_xml="1"$></description>
                    <link><$MTEntryLink encode_xml="1"$>#<$MTCommentID pad="1"$></link>
                    <dc:contributor><$MTCommentAuthor encode_xml="1"$></dc:contributor>
                    <dc:date><$MTCommentDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date>
                </item>
            </MTCommentEntry>
        </MTComments>
    </rdf:RDF>
  8. Click "SAVE".
  9. Click "REBUILD".
  10. Wait for the window to pop-up.
  11. Click "REBUILD" on that new window.
  12. Announce in your blog that you now have a comments feed.
Google Buzz
blog comments powered by Disqus