Added function to show RSS feed of Specific tag

Since the controller action tag is allowed but not actually used as function, I've overridden it so that if OtherID is RSS it returns an RSS feed for that tag
This commit is contained in:
Richard Rudy 2013-09-26 17:37:52 -04:00
parent 4f3c258bf4
commit f3e96d56d8

View File

@ -295,6 +295,24 @@ class BlogTree_Controller extends Page_Controller {
}
}
/*
* Function to Allow RSS feeds of specific tag using BlogURL/tag/$tagname/rss/
*/
function tag() {
if ($this->request->param('Action') == 'tag' && $this->request->param('OtherID') == "rss") {
$entries = $this->Entries(20, Convert::raw2xml($this->request->latestParam('ID')));
if($entries) {
$rss = new RSSFeed($entries, $this->owner->Link('rss'), ($blogName ? $blogName : $altBlogName), "", "Title", "RSSContent");
return $rss->outputToBrowser();
}
} else {
return $this;
}
}
/**
* Protection against infinite loops when an RSS widget pointing to this page is added to this page
*/