mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
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:
parent
4f3c258bf4
commit
f3e96d56d8
@ -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
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user