psst.. this blog is on hiatus.

Tweaking Movable Type’s RSS, RDF, and Atom templates

Movable Type 2.66’s RSS 1.0, RSS 2.0, and Atom templates need some work. Out of the box, here are the three main issues I’ve noticed:

  1. It places your e-mail address in plain text all three templates. Love spam? You will after having that default template linked for a few weeks.
  2. MT doesn’t resolve relatively linked items, so your feed won’t validate.
  3. The RSS 1.0 and RSS 2.0 templates use MTEntryExcerpt, which strips out nice things like images.

I have a solution for each issue, and because you’re a geek like me with nothing better to do, you want to know the answers.

  1. Priority numero uno: get your e-mail address off the damn template. That can mean changing joe@smith.com to joe@REMOVEsmith.THIScom or just putting some nonsense in the <dc:creator> and <email> fields for RSS1.0/2.0 and Atom, respectively. Whatever you need to do, do it, because the spambots don’t care whether that file is .XML, .RDF, .RSS, or .SUPERDUPER, they’ll get your e-mail addy if it’s in plain text.
  2. In order to validate, all links in an RSS feed must be absolutely referenced. However, this is inconvenient to type in your entries, wastes bandwidth, and is a bad idea if you plan to move directories around or even change domains. A better mousetrap is the ResolveURLs plugin, which changes /dir/file.html to http://www.site.com/dir/file.html. Then you’ll have net cred at the validator.
  3. I noticed a long time ago that some of the RSS feeds I subscribe to on BlogLines have images. Out of the box, Movable Type’s do not, because the MTEntryExcerpt tag strips them out. My solution is to replace it with this:


    <description>&lt![CDATA[<$MTEntryBody resolve_urls="1"$>
    <MTEntryIfExtended><p align="right"><em><MTWordCount> words in the <a href="<$MTEntryPermalink encode_xml="1"$>">full entry</a> &raquo;</em></p></MTEntryIfExtended>]]>
    </description>

    This inserts the body of your entry rather than the excerpt and provides a link to the entry permalink if there is an extended entry. Some people think that CDATA is cheating, but uh, whatever. Note that this will make your RSS feed significantly bigger. Also note that I’m using the simple but useful plugin MTWordCount, which gives a count of the words in the full entry (not just body).

One Response to “Tweaking Movable Type’s RSS, RDF, and Atom templates”

  1. 1
    flex-mx Says:

    Tweaking MT2.66 Templates

    http://underscorebleach.net/content/jotsheet/2004/03/rss_atom_templates