RSS Templates for TypePad Pro/MovableType

This entry was published at least two years ago (originally posted on February 6, 2004). Since that time the information may have become outdated or my beliefs may have changed (in general, assume a more open and liberal current viewpoint). A fuller disclaimer is available.

I just had someone ask how I was able to create the four RSS feeds for my site. Here’s a quick rundown, along with the templates themselves, should anyone else want to do the same thing. All the templates are RSS 2.0, and have been checked with the RSS Feed Validator.

TypePad users will need a Pro account, and will also need to be using an Advanced Template set, as you’ll need to create a new template for each RSS feed you want to add. I give each template a name that’s fairly indicative of which feed it is for, and I make sure that the output file is also named similarly.

Here are the templates I use:

####Default feed: Full text, no comments####

Template Name: RSS 2.0 Full
Output File: index.rdf

<?xml version="1.0" encoding="iso-8859-1"?> <rss version="2.0"      xmlns:dc="http://purl.org/dc/elements/1.1/"     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"     xmlns:admin="http://webns.net/mvcb/"     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"     xmlns:content="http://purl.org/rss/1.0/modules/content/"> 

<channel> 
<title><$MTBlogName remove_html="1" encode_xml="1"$></title> 
<link><$MTBlogURL$></link> 
<description><$MTBlogDescription remove_html="1" encode_xml="1"$></description> 
<dc:language>en-us</dc:language> 
<dc:creator><MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries></dc:creator> 
<dc:rights>Copyright <$MTDate format="%Y"></dc:rights> 
<dc:date><MTEntries lastn="1"><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></MTEntries></dc:date> 
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" /> 
<admin:errorReportsTo rdf:resource="mailto:<MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries>"/> 
<sy:updatePeriod>hourly</sy:updatePeriod> 
<sy:updateFrequency>1</sy:updateFrequency> 
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase> 

<MTEntries lastn="15"> 
<item> 
<title><$MTEntryTitle remove_html="1" encode_xml="1"$></title> 
<link><$MTEntryLink encode_xml="1"$></link> 
<description><$MTEntryExcerpt remove_html="1" encode_xml="1"$></description> 
<guid isPermaLink="false"><$MTEntryID$>@<$MTBlogURL$></guid> 
<content:encoded><![CDATA[<$MTEntryBody$><MTEntryIfExtended><p><a href="<$MTEntryLink$>" title="Continue Reading: <$MTEntryTitle$>">Continue reading <$MTEntryTitle$>...</a></p></MTEntryIfExtended>]]></content:encoded> 
<dc:subject><MTEntryCategories glue=" | "><$MTCategoryLabel remove_html="1" encode_xml="1"$></MTEntryCategories></dc:subject> 
<dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date> 
</item> 
</MTEntries> 

</channel> 
</rss> 

####Enhanced Feed: Full posts with comments####

Template Name: RSS 2.0 full plus comments
Output File: fullposts.rdf

<?xml version="1.0" encoding="iso-8859-1"?> <rss version="2.0"      xmlns:dc="http://purl.org/dc/elements/1.1/"     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"     xmlns:admin="http://webns.net/mvcb/"     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"     xmlns:content="http://purl.org/rss/1.0/modules/content/"> 

<channel> 
<title><$MTBlogName remove_html="1" encode_xml="1"$>: With Comments</title> 
<link><$MTBlogURL$></link> 
<description><$MTBlogDescription remove_html="1" encode_xml="1"$></description> 
<dc:language>en-us</dc:language> 
<dc:creator><MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries></dc:creator> 
<dc:rights>Copyright <$MTDate format="%Y"></dc:rights> 
<dc:date><MTEntries lastn="1"><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></MTEntries></dc:date> 
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" /> 
<admin:errorReportsTo rdf:resource="mailto:<MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries>"/> 
<sy:updatePeriod>hourly</sy:updatePeriod> 
<sy:updateFrequency>1</sy:updateFrequency> 
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase> 

<MTEntries lastn="15"> 
<item> 
<title><$MTEntryTitle remove_html="1" encode_xml="1"$></title> 
<link><$MTEntryLink encode_xml="1"$></link> 
<description><$MTEntryExcerpt remove_html="1" encode_xml="1"$></description> 
<guid isPermaLink="false"><$MTEntryID$>@<$MTBlogURL$></guid> 
<content:encoded><![CDATA[<$MTEntryBody$><MTEntryIfExtended><p><a href="<$MTEntryLink$>" title="Continue Reading: <$MTEntryTitle$>">Continue reading <$MTEntryTitle$>...</a></p></MTEntryIfExtended><MTEntryIfAllowComments><p>Comments on this Entry:</p><MTComments><h4><MTCommentAuthorLink show_email="0"> on 
<MTCommentDate format="%b %e, %Y %l:%M %p">:</h4><MTCommentBody></MTComments></MTEntryIfAllowComments>]]></content:encoded> 
<dc:subject><MTEntryCategories glue=" | "><$MTCategoryLabel remove_html="1" encode_xml="1"$></MTEntryCategories></dc:subject> 
<dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date> 
</item> 
</MTEntries> 

</channel> 
</rss> 

####Short Feed: Excerpts Only####

Template Name: RSS 2.0 Excerpts
Output File: excerpts.rdf

<?xml version="1.0" encoding="iso-8859-1"?> <rss version="2.0"      xmlns:dc="http://purl.org/dc/elements/1.1/"     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"     xmlns:admin="http://webns.net/mvcb/"     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"     xmlns:content="http://purl.org/rss/1.0/modules/content/"> 

<channel> 
<title><$MTBlogName remove_html="1" encode_xml="1"$>: Excerpts</title> 
<link><$MTBlogURL$></link> 
<description><$MTBlogDescription remove_html="1" encode_xml="1"$></description> 
<dc:language>en-us</dc:language> 
<dc:creator><MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries></dc:creator> 
<dc:rights>Copyright <$MTDate format="%Y"></dc:rights> 
<dc:date><MTEntries lastn="1"><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></MTEntries></dc:date> 
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" /> 
<admin:errorReportsTo rdf:resource="mailto:<MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries>"/> 
<sy:updatePeriod>hourly</sy:updatePeriod> 
<sy:updateFrequency>1</sy:updateFrequency> 
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase> 

<MTEntries lastn="15"> 
<item> 
<title><$MTEntryTitle remove_html="1" encode_xml="1"$></title> 
<link><$MTEntryLink encode_xml="1"$></link> 
<description><$MTEntryExcerpt remove_html="1" encode_xml="1"$></description> 
<guid isPermaLink="false"><$MTEntryID$>@<$MTBlogURL$></guid> 
<content:encoded><![CDATA[<$MTEntryExcerpt$>]]></content:encoded> 
<dc:subject><MTEntryCategories glue=" | "><$MTCategoryLabel remove_html="1" encode_xml="1"$></MTEntryCategories></dc:subject> 
<dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date> 
</item> 
</MTEntries> 

</channel> 
</rss> 

####Comments only feed####

Template Name: RSS 2.0 Comments
Output File: comments.rdf

Update: The code here has been slightly altered since the original posting to account for an issue with incorrect dates.

<?xml version="1.0" encoding="iso-8859-1"?> <rss version="2.0"      xmlns:dc="http://purl.org/dc/elements/1.1/"     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"     xmlns:admin="http://webns.net/mvcb/"     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"     xmlns:content="http://purl.org/rss/1.0/modules/content/"> 

<channel> 
<title><$MTBlogName remove_html="1" encode_xml="1"$>: Comments</title> 
<link><$MTBlogURL$></link> 
<description><$MTBlogDescription remove_html="1" encode_xml="1"$></description> 
<dc:language>en-us</dc:language> 
<dc:creator><MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries></dc:creator> 
<dc:rights>Copyright <$MTDate format="%Y"></dc:rights> 
<dc:date><MTEntries lastn="1"><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></MTEntries></dc:date> 
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" /> 
<admin:errorReportsTo rdf:resource="mailto:<MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries>"/> 
<sy:updatePeriod>hourly</sy:updatePeriod> 
<sy:updateFrequency>1</sy:updateFrequency> 
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase> 

<MTComments lastn="20">
<item> 
<MTCommentEntry> 
<title><$MTEntryTitle remove_html="1" encode_xml="1"$></title> 
<link><$MTEntryPermalink encode_xml="1"$>#c<$MTCommentID$></link> 
<description><$MTCommentBody remove_html="1" encode_xml="1"$></description> 
<guid isPermaLink="false"><$MTCommentID$>@<$MTBlogURL$></guid> 
<content:encoded><![CDATA[<MTCommentAuthorLink show_email="0">: <$MTCommentBody$>]]></content:encoded> 
</MTCommentEntry>
<dc:date><$MTCommentDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date> 
</item>
</MTComments> 

</channel> 
</rss>