Permalink
Browse files

Add RSS Feed

Ability to have an RSS Feed for your blog
  • Loading branch information...
1 parent 63dd91d commit 4baa3d0dd85ae51f71de5b8b9c57d09364bbd129 @matthewroach committed Dec 29, 2012
Showing with 39 additions and 0 deletions.
  1. +21 −0 a/templates/feeds/all.inc
  2. +12 −0 api/private/pages.cfc
  3. +5 −0 index.cfm
  4. +1 −0 settings.json
View
@@ -0,0 +1,21 @@
+<cfcontent type="text/xml" reset="true" /><?xml version="1.0" ?>
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+<atom:link href=" #### FEED URL #### " rel="self" type="application/rss+xml" />
+
+<channel>
+
+<title> FEED TITLE </title>
+<description> DESCRIPTION </description>
+<link> FULL URL TO YOUR SITE </link>
+
+ <cfloop collection="#page.content#" item="item"><cfoutput>
+ <item>
+ <title>#page.content[item].title#</title>
+ <description>#XMLFormat( page.content[item].body )#</description>
+ <link>http:// URL HERE /?/#_settings.url#/#page.content[item].url#</link>
+ </item>
+ </cfoutput></cfloop>
+
+</channel>
+
+</rss>
View
@@ -41,6 +41,18 @@ component {
}
+ function feed( ) {
+
+ items = getHome( 99999 );
+
+ page = {
+ template : application.settings.templates.feed,
+ content : items
+ };
+
+ return page;
+
+ }
function getFile( page ) {
View
@@ -11,6 +11,7 @@
if ( requestString != '' ) {
firstQString = requestData[1];
+
if ( arrayLen( requestData ) == 2 ) {
requestAction = requestData[2];
}
@@ -23,6 +24,10 @@
page = _pages.all();
+ } else if ( _settings.url & '.xml' == firstQString ) {
+
+ page = _pages.feed();
+
}
else {
View
@@ -13,6 +13,7 @@
"footer" : "/a/templates/global/footer.inc",
"view" : "/a/templates/pages/view.inc",
"archive": "/a/templates/pages/archive.inc",
+ "feed" : "/a/templates/feeds/all.inc",
"_404" : "/a/templates/error/404.inc"
}

0 comments on commit 4baa3d0

Please sign in to comment.