June 12, 2005
Simple RSS Customizations
Updated June 12, 2005. Originally posted in Spring of 2004.
The default Movable Type installation automatically publishes RSS feeds for your weblog. The three formats supported are Atom, RSS 1.0 and RSS 2.0. You can find the templates associated with these syndication formats in the templates section of your MT edit screen.
The default RSS 1.0 and RSS 2.0 syndication feed templates for MT version 3.x produces a feed with the content in your MT entry body. The default Atom feed template produces a feed with both the entry body and the extended entry. The default RSS 1.0 and RSS 2.0 feeds in MT version 2.661 generated feeds with only the entry excerpt.
You may or may not want to publish full feeds for your weblog. There is an ongoing debate about this as avid weblog readers who use newsfeed readers generally prefer to get the full feeds of the weblogs they read. The flip side for the weblog publisher is that publishing full entry feeds can use up more bandwidth from your webhost, unless you use a service like Feedburner to host your feeds. Also, once you release all of your content in a full feed, it is very easy for an aggregator to automatically pull all of your content into their pages. Even if you have copyright protection noted on your entries, that may not stop people from using your content to create their own automatically generated portal sites. It is up to you, the weblog publisher, to determine how much of your content you want to make instantly and easily available to others without requiring them to come to your website.
Here are some simple changes you can make to your feed templates to generate a full entry feed, including the extended entry, to reduce the Atom feed to only the entry body, to create an RSS feed for a specific category or by using your RSS 2.0 template to include comments with your feed.
Changing from entry body to entry body plus extended entry
For both the RSS 1.0 and RSS 2.0 index templates, find the second instance of the description tag in the templates. In both templates that code should look like this:
Change this line so that it now reads:
Save and rebuild your templates.
Changing from full entry to entry body or entry excerpt in the Atom feed
If you want to reduce your Atom feed to only showing the entry body and not the full extended entry, find the following code in your Atom Index:
<$MTEntryMore encode_xml="1"$> line.
If you want to change your Atom feed to only showing the entry excerpt, remove those two lines and add
<$MTEntryExcerpt encode_xml="1"$> in their place.
Save and rebuild your template.
Providing an RSS feed for a category.
If you would like to create RSS feeds for all of your categories, see Shelley's tips in her Generate RSS Feeds by Category tutorial.
Alternatively you can publish an RSS feed for just one specific category of posts from your weblog. For example, I publish an RSS feed for my recipe site as well as for the low carb recipes on that site. Here is the method I use, using the RSS 1.0 template. First copy and paste the RSS 1.0 Index template into a new Index template. Name the new index file something different and name the output file something other than index.rdf, for example index_yourcategory.rdf.
In your new RSS index template, find the following code:
Add a category attribute to the two MTEntries tags, with the name of the category you have selected to create a feed. In the following example from my recipe website I am creating a feed for my Low Carb recipes:
You may want to change the title of the feed as it would appear in a newsreader. To do so, find this part of the code in your new RSS index template:
Add the name of your category to the title:
Save and rebuild your template.
Including Comments With Your Feed
In addition to updated entries in your RSS feed you can also include in that feed new comments to your most recent entries. Here is an RSS 2.0 template that I am now using for LMT that includes the main body post, a link to the extended entry (if there is one), and any new comments made to the last "n" entries. (Via Arvind at Movalog and Jennifer at etc.)
Just replace your existing RSS 2.0 template with the above and you will generate a feed that includes the entry body text and comments. (But don't ask me how this code works, I'm just using a template I found somewhere else!)
If you have a useful MT syndication feed template that you would like to share with others, please let me know about it in the comments.
RSS Specifications - "everything you need to know about RSS"
Generate RSS Feeds by Category - Girlie's tip on how to easily generate RSS feeds for all of your categories by incorporating a new RSS template with a new archiving type.
Sideblog RSS - tip for making your linkblog's RSS feed to direct the title of your entry to the linked page itself, rather than your linkblog.
Comments-only Feed - scroll to the bottom of the page to get the RSS template for a comments-only RSS feed.
Forcing an Unsubscribe
Has this tutorial been helpful? Please consider linking to Learning Movable Type at http://learningmovabletype.com/ . Thanks!
If you would like to send a trackback
please use the following URL: http://learningmovabletype.com/cgi-bin/mt32/mt-tb.cgi/226
Elise of Learning Movable Type has put together an excellent tutorial for customizing the RSS feeds that come with MovableType. Specifically, she explains in easy terms how to make full......[read more]
Tracked: August 18, 2004 08:28 PM» short or long summaries? from Silk and spinach
I'm in a bit of a quandary, and I would therefore like to enlist your opinion, dear reader. As things currently stand, this blog generates Atom and RSS feeds that include the whole text of each post. And each of the indexes (the category indexes, the m......[read more]
Tracked: December 27, 2004 01:26 PM» Updated RSS Feeds from Michael Williams -- Master of None
I've updated my RSS feeds to be more feature-rich. You can use these feeds with an RSS aggregator, most of which are free. RDF RSS Feed (RSS 1.0) XML RSS Feed (RSS 2.0) (HT: Ben Hammersley and Learning Movable Type.)......[read more]
Tracked: May 10, 2005 05:08 PM» My web feeds templates from Knowledge Jolt with Jack
Several people asked for the templates for my web feeds, particularly the one that provides comments interspersed with the entries. Here it is....[read more]
Tracked: June 18, 2005 08:44 PM» Adding Footers to Your Feed from Plagiarism Today
If, like many, you've grown weary of the rampant automated plagiarism going on and want to protect your RSS feed from skimming or scraping, then adding copyright footers to each article is a potential solution to the problem. However, that can be a......[read more]
Tracked: September 15, 2005 03:40 PM