Neil Turner's Blog

Blogging about technology and randomness since 2002

Adding a Comments RSS feed to MT

Yesterday’s post about comment RSS feeds attracted some attention, and so this morning I have implemented the feeds on here. As a guide, this took me about half an hour but that including writing the template from scratch and testing it, so it shouldn’t take one of you guys as long.


Firstly, you will need a template, and so here’s one I made earlier. This will show all comments on an entry in chronological order (earliest first) but won’t show trackback pings. I may do a version with pings that uses SimpleComments some other time.
Now, to add it. Open Movable Type, select Templates and click on ‘Create a new archive template’. Copy and paste the code into the box and called it something like ‘Comments RSS feed’. Next, go to Weblog Config and choose Archiving.
Now, below ‘Create a new Template/Archive Association’, set ‘Archive Type’ to ‘Individual’ and ‘Template’ to ‘Comments RSS Feed’ (MT2.x users need to click the ‘Add New…’ button first) and then click the Add button. The page will refresh and show your new template in the table. Here, you may wish to specify a filename for the template – I’d suggest “<$MTArchiveDate format="%Y/%m"$>/<$MTEntryTitle dirify="1"$>_comments.xml” as this matches the format used by MT3.x for entries.
The feeds will now rebuild whenever you post an entry. Now, you’ll need to tell the world about these feeds, by adding a link to them on you individual archive pages. And we’re done!
You may also like to add category RSS feeds which allow users to subscribe to specific categories.

One Comment

  1. An Upgrade and A Headache

    For the past few days I’ve been tinkering with the backend of my weblog. Did a full upgrade of it’s system. Previously powered by MT2.661 I upgraded it to the latest version which is 3.11. And headaches ensued right after…..