Skip to content

Commit

Permalink
FIX Re-introduced missing RSS feed output
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Nyeholt committed Nov 2, 2016
1 parent 871a580 commit e5f23eb
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion code/pages/NewsHolder.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,5 +291,18 @@ public function TotalChildArticles($number = null) {
}

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() {
$parent = $this->data()->ID;
$objects = NewsArticle::get()->filter('ParentID', $parent)->sort('LastEdited DESC')->limit(10);
$rss = new RSSFeed($objects, $this->data()->Link(), _t('News.RSSTITLE',"10 most recent news"), "", "Title", "Content");
$this->response->addHeader('Content-Type', 'application/rss+xml');
return $rss->outputToBrowser();
}
}

0 comments on commit e5f23eb

Please sign in to comment.