Permalink
Browse files

Merge pull request #13 from ivoba/ss24

rss feed for 2.4 branch
  • Loading branch information...
2 parents 7606f48 + 008a61d commit 876e66789a326258d86528646716273bfcaabed2 @nyeholt committed Aug 15, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 code/pages/NewsHolder.php
View
@@ -221,5 +221,17 @@ public function pagesAffectedByChanges() {
}
class NewsHolder_Controller extends Page_Controller {
+
+ public static $allowed_actions = array('Rss');
+
+ public function init() {
+ RSSFeed::linkToFeed($this->owner->Link() . "rss", _t('News.RSSLINK',"RSS feed for the News"));
+ parent::init();
+ }
+
+ function Rss() {
+ $rss = new RSSFeed(DataObject::get("NewsArticle", "", "LastEdited DESC", "", 10), $this->owner->Link(), _t('News.RSSTITLE',"10 most recent news"), "", "Title", "Content");
+ $rss->outputToBrowser();
+ }
-}
+}

0 comments on commit 876e667

Please sign in to comment.