Creating an RSS template

The RSS feed template was deprecated in MT 4.1 in favor of the atom template which offers all the same functionality as RSS.

  1. Create a new index template. Name it RSS Feed and specify the output file as rss.xml. Use the following as the template code:

        <$mt:HTTPContentType type="application/rss+xml"$><?xml version="1.0" encoding="<$mt:PublishCharset$>"?>
        <rss version="2.0">
            <channel>
                <title><$mt:BlogName remove_html="1" encode_xml="1"$></title>
                <link><$mt:BlogURL$></link>
                <description><$mt:BlogDescription remove_html="1" encode_xml="1"$></description>
                <language><$mt:BlogLanguage ietf="1"$></language>
                <copyright><__trans phrase="Copyright [_1]" params="<$mt:Date format="%Y"$>"></copyright>
                <lastBuildDate><mt:Entries lastn="1"><$mt:EntryDate format_name="rfc822"$></mt:Entries></lastBuildDate>
                <generator>http://www.sixapart.com/movabletype/</generator>
                <docs>http://www.rssboard.org/rss-specification</docs>
        <mt:Entries lastn="15">
                <item>
                    <title><$mt:EntryTitle remove_html="1" encode_xml="1"$></title>
                    <description><$mt:EntryBody encode_xml="1"$></description>
                    <link><$mt:EntryPermalink encode_xml="1"$></link>
                    <guid><$mt:EntryPermalink encode_xml="1"$></guid>
            <mt:EntryCategories>
                        <category domain="http://www.sixapart.com/ns/types#category"><$mt:CategoryLabel remove_html="1" encode_xml="1"$></category>
            </mt:EntryCategories>
            <mt:EntryTags>
                        <category domain="http://www.sixapart.com/ns/types#tag"><$mt:TagName remove_html="1" encode_xml="1"$></category>
            </mt:EntryTags>
                    <pubDate><$mt:EntryDate format_name="rfc822"$></pubDate>
                </item>
        </mt:Entries>
            </channel>
        </rss>
    
  2. Save the RSS Feed index template.

  3. Publish the RSS Feed index template.
  4. Add the following to the template containing your html header code. (Should be the "Header" or "HTML head" template module):

    <link rel="alternate" type="application/atom+xml" title="Atom" href="<$mt:Link template="RSS Feed"$>" />
    
  5. Republish blog.

This page was last updated on 2008-09-03, 17:38.  

Leave a note

Have a question, please use the MT Forums. Notes sumbitted here should pertain to tips & hints regarding documentation. Your note may be removed once it's contents has be integrated into the body of the page.