From f3e96d56d83daeca46f625fd4e20278b7fcd6b08 Mon Sep 17 00:00:00 2001 From: Richard Rudy Date: Thu, 26 Sep 2013 17:37:52 -0400 Subject: [PATCH] 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 --- code/BlogTree.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/code/BlogTree.php b/code/BlogTree.php index 33f268c..a9f1971 100644 --- a/code/BlogTree.php +++ b/code/BlogTree.php @@ -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 */