Setting up an RSS feed for your MODX Articles blog can be a little tricky. I don't claim to be an RSS feed expert, but here's how I did it at Bob's Guides.
The RSS Icon Image Tag
First, find an RSS icon you like somewhere on the Web and download it to somewhere in your assets/ directory. I put mine in the assets/images/ directory, but it can go wherever you like. If you put it somewhere else, adjust the URL in the next code section to point to it.
This HTML code goes wherever you want the RSS icon to appear. I put it near at the bottom of the the Articles Container Template and the Article Template.
<a href="[[~309]]"> <img style="border:none;"
src="[[++site_url]]assets/images/feed-icon-28x28.png" height="28" width="28"
alt="RSS Feed" title="RSS Feed"/></a>
Notice that the href tag above is for Resource 309. That's the ID of the Resource I created. Yours will have a different ID. Once you create and save the Resource below, make a note of its ID (in parentheses next to the name in the Resource Tree) and change the 309 in the code of your Templates to that new ID.
The Resource
Create a new Resource and fill in the Title, Summary (introtext) and Alias fields. I used the Title "What's New at Bob's Blog," and for the Summary (introtext) field: "Bob's Guides Blog RSS Feed". Important: Using the Template drop-down list at the upper right, select the (empty) option for no Template.
I used getResources to create the feed. Here's the code for my Resource 309. It goes in the Resource Content field:
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="https://www.w3.org/2005/Atom" xmlns:dc="https://purl.org/dc/elements/1.1/">
<channel>
<title>[[*pagetitle]]</title>
<link>
[[~[[*id]]? &scheme=`full`]]</link>
<description>[[*introtext:cdata]]</description>
<language>[[++cultureKey]]</language>
<ttl>120</ttl>
<atom:link href="[[~[[*id]]? &scheme=`full`]]" rel="self" type="application/rss+xml"/>
[[!getResources?
&tpl=`rssItem`
&parents=`282`
&resources=`-183,-184,-198`
&limit=`10`
&includeContent=`0`
&includeTVs=`1`
&processTVs=`1`
&showHidden=`1`
&hideContainers=`1`
&sortby=`editedon`
]]
</channel>
</rss>
The &limit property says how many articles to show. I have it set to 10, but you can use whatever number you like. You can set it to 0 if you want to show them all, though I think it's generally a bad idea.
I chose editedon for the &sortby property because I wanted updated pages to bubble to the top of the list. You may choose to use createdon or publishedon. If you select publishedon, unpublishing and re-publishing an article will move it to the top of the list. You can use any Resource field here, though the ones listed above are the most common and it makes sense to use a date field so you'll be showing the most recent articles.
The default sort direction is descending, so the tag above will show the 10 most recent articles. If you need more complex searching and/or sorting, see the getResources documentation. It's possible to sort by a TV value as well.
The &resources=`-183,-184,-198` property is optional. It lists pages I don't want to show in the feed.
The &parents property is set to 282, which is the ID of my main Blog container page. Change that to the ID of yours, or if your blog has separate sections, you can use a comma-separated list of IDs here.
Be sure to make the resource published and you probably want it hidden from menus. Don't forget to save it.
The RSS Item Tpl
The format of an individual item in the feed is in the chunk specified in the &tpl property. My Tpl chunk is called rssItem, but you can call it whatever you like. Here is the code of my rssItem Tpl chunk:
<item>
<title>[[+pagetitle:htmlent]]</title>
<link>
[[++site_url]][[~[[+id]]]]</link>
<description>
[[+introtext:default=`[[+content:ellipsis=`600`]]`:cdata]]
</description>
<pubDate>[[+publishedon:strtotime:date=`%a, %d %b %Y %H:%M:%S %Z`]]</pubDate>
<guid isPermaLink="true">[[++site_url]][[~[[+id]]]]</guid>
<dc:creator>
Bob Ray
</dc:creator>
</item>
Be sure the name of the Tpl chunk you create matches the chunk specified in the &tpl property of your getResources Snippet tag. Be careful, the names are case-sensitive.
If your site is multi-lingual and you'll have RSS feeds in different languages, you'll probably want to use the strftime output modifier in your Tpl chunk rather than the date modifier — strftime will respect the locale setting and date won't.
Testing Your RSS Feed
After clearing the site cache, you should be able to see the XML code of your RSS feed by clicking on the RSS icon on one of your blog pages. If not, review the steps above to make sure you haven't missed something.

Comments (6)
Martin Gartner — Feb 07, 2014 at 06:31 AM
Hi Bob,
Nice tutorial!
But you should also add the following code to the <head></head> of your site:
<link rel=”alternate” type=”application/rss=xml” title=”Bob's Guides Blog RSS Feed” href=”~309” />
This enables RSS Readers to auto-detect RSS feeds on your site.
Martin Gartner — Feb 07, 2014 at 06:36 AM
While posting the comment, the opening and closing MODX tag markers inside the href="" were removed.
Bob Ray — Mar 04, 2014 at 01:36 PM
Done. Thanks!
Brian Kellond — Jul 13, 2015 at 09:08 AM
Thanks Bob. This was great - suited me down to the ground.
Brian Kellond — Jul 14, 2015 at 05:25 AM
Hi Bob
In implementing this on my site I discovered a small syntax error in the meta tag. The type component of the tag type=”application/rss=xml” should contain a plus sign not an equals sign i.e. type=”application/rss+xml”
Regards
Brian
Bob Ray — Oct 10, 2015 at 12:02 AM
Thanks. Fixed above. :)
Please login to comment.