Atom 1.0 template for Movable Type

I just finished my Atom 1.0 feed template for Movable Type. I believe it is compliant with the Atom 1.0 specification and my feed validates according to Feed Validator.

I will not switch my blog’s advertised Atom feed from 0.3 to 1.0 until Bloglines, NetNewsWire, and NewsGator support Atom 1.0 format.


Commentary on "Atom 1.0 template for Movable Type":

  1. aharden on wrote:

    Niall, thanks for the template. I had to close the “updated” tag to get it to validate.

  2. Niall Kennedy on wrote:

    Thanks! I added the updated element at the last minute because it looks like the specification requires it even though my feed was validating without it. As far as I know Movable Type does not have a global template tag for the last modified entry date in any entry so I had to use the modified date of the last entry.

  3. Robert Sayre on wrote:

    Hi Niall, you want <content type=”html” with no div inside.

  4. Niall Kennedy on wrote:

    Thank you Robert. I fixed my template and my feed per your instructions.

  5. g026r on wrote:

    Just out of curiousity: are the MTEntryModifiedDate tag and the utc attribute available by default in 3.2, or do you still have to use a plugin to get at them?

  6. Niall Kennedy on wrote:

    There are many undocumented template tags and attributes for Movable Type. MTEntryModifiedDate does support the utc attribute without any plugins.

  7. g026r on wrote:

    Thanks, Niall. I wasn’t aware that those tags were included by default now, as it wasn’t showing up in my locally installed documentation.

    (I have, however, discovered why: mod_gzip was messing up, and hadn’t updated the compressed copies of the files to reflect the fact that they’d changed. Therefore I was getting the MT 2.63 documentation. Yay, another problem to fix…)

  8. Jason on wrote:

    Niall, thank you for this — it’s nice to see I don’t have to reinvent the wheel on this.

  9. Jason Levine on wrote:

    One comment — you’re using the permalink for the id element on each entry. Check out Mark Pilgrim’s “How to make a good ID in Atom”, which makes some persuasive arguments not to use a permalink; it’s worth a thought.

  10. Phil Ringnalda on wrote:

    Hmm. Interesting problem with your plain-text summaries, that I don’t think can be fixed without another global filter. You have encode_xml=”1″ on them, which does a bunch of harmless stuff you don’t need, converting quotes and apostrophes to named entities, and also does two things you might need, whether you need them or not. Any ampersand or less-than gets converted to a named entity, which would save your bacon if you let through a literal one of either, but because you are careful and never type one in your post without escaping it, encode_xml double-escapes them, which means that your plain-text summary has them still escaped when it comes out the other end, leaving you saying that “1 &lt; 2” instead of “1 < 2″

    I don’t see any way around that other than having encode_text_xml, which first decodes HTML entities, and then escapes XML-significant characters. (You could do it with decode_html=”1″ encode_xml=”1” if order was guaranteed, but last I remember it wasn’t. Though, I think I did file a bug on that, so maybe now it is.)

  11. Phil Ringnalda on wrote:

    Double hmm. feed/id as <MTBlogURL> followed by a space? Not only do you have the problems Jason refers to when using a changeable URI as an id, but that space is awfully risky: it’s just begging for someone to screw up and percent-encode it.

  12. Phil Ringnalda on wrote:

    You’ve got the email and MTIfNonEmpty tags swapped, so if the last post was written by an author without an email address, you’ll produce not-well-formed XML.

  13. Jakob S on wrote:

    Thanks Niall, looks like my site will finally produce an Atom-feed ;)

  14. Gerald on wrote:

    Thanks for the template.

    Feedvalidator is blowing me out and I don’t understand why.

    The offending line is:
    <category term=”/home_garden” scheme=”” label=”<![CDATA[Home & Garden]]>” />

    And similar lines appear elsewhere in the feed, including ampersands, so I don’t know why this line fails and others don’t.

    Any chance you could take a look?

    The feed is at:


  15. Leon Krijnen on wrote:

    Good job Neil, thanks for the template. My atom feed is valid now.
    Just one warning regarding the utf-8 encoding, I’ll sort that out.

    Kind regards, Leon, The Netherlands.

  16. bloodnok on wrote:

    perfect! thanks for the template.