Create a RSS Feed

johnmuhl edited this page Aug 24, 2010 · 2 revisions
Clone this wiki locally

To create an RSS feed in Radiant, you’ll need to make both a new Layout and Page.

RSS Layout

In Radiant, go to the Layouts tab and click ‘New Layout’. Fill in the sections as follows and click ‘Create Layout’ when you’re done:

  • Name: RSS
  • Content-Type (click the ‘More’ link): application/rss+xml

Fill in Content with the following code:

<r:content />

RSS Page

Go to the Pages tab and click the ‘Add Child’ link next to your Home Page (top row). Fill in the sections as follows and click ‘Create Page’ when you’re done:

  • Page Title: RSS
  • Slug (click the ‘More’ link): rss
  • Layout: RSS

Now fill in the Body content with the following code:

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="">
  <link>WEBSITE-URL<r:url /></link>
  <r:children:each by="published_at" order="desc" limit="10">
      <title><r:escape_html><r:title /></r:escape_html></title>
      <description><r:escape_html><r:content /></r:escape_html></description>
      <pubDate><r:rfc1123_date /></pubDate>
      <guid>WEBSITE-URL<r:url /></guid>
      <link>WEBSITE-URL<r:url /></link>

The next step is to replace all the CAPITALIZED terms in the code with content specific to your website. For example, if your website was, you might do the following:

  • WEBSITE-TITLE: Fake Radiant Website
  • WEBSITE-DESCRIPTION: A fake website about Radiant CMS
  • WEBSITE-URL (no trailing slash!):

Then, will pull in the 10 newest sub-pages of as an RSS feed.

To make your RSS feed fancier, you can add other RSS tags inside the <item> tag — just be sure to wrap them in <r:escape_html> tags to prevent RSS readers from choking on symbols (apostrophes, quotes, etc.) in your content.

You can also modify the <r:children:each> tag per Radiant standards to change the number of pages aggregated, the order the pages are retrieved in, etc..

More Info

Thanks to Andrew Neil and Sean Santry for publishing the initial code on which this wiki page was based.