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:
- 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.
- MT doesn’t resolve relatively linked items, so your feed won’t validate.
- 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.
- Priority numero uno: get your e-mail address off the damn template. That can mean changing
joe@smith.comtojoe@REMOVEsmith.THIScomor 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. - 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.htmltohttp://www.site.com/dir/file.html. Then you’ll have net cred at the validator. -
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
MTEntryExcerpttag strips them out. My solution is to replace it with this:
<description><![CDATA[<$MTEntryBody resolve_urls="1"$>
<MTEntryIfExtended><p align="right"><em><MTWordCount> words in the <a href="<$MTEntryPermalink encode_xml="1"$>">full entry</a> »</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
CDATAis cheating, but uh, whatever. Note that this will make your RSS feed significantly bigger. Also note that I’m using the simple but useful pluginMTWordCount, which gives a count of the words in the full entry (not just body).
September 8th, 2004 at 1:32 pm
Tweaking MT2.66 Templates
http://underscorebleach.net/content/jotsheet/2004/03/rss_atom_templates