1770 Posts in 495 Topics by 531 members
Blog Module
SilverStripe Forums » Blog Module » RSS feed for blog entries with a certain tag
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1172 Views |
-
RSS feed for blog entries with a certain tag

23 August 2009 at 10:34pm
I want to provide my blog with an rss feed for tags. I tried for 2 hours without any result. I woud appreciate any help.
-
Re: RSS feed for blog entries with a certain tag

23 August 2009 at 11:46pm
After three hours of trial and error I found a solution. All changes are done in BlogHolder.php
In the init() I chnged the link:RSSFeed::linkToFeed($this->Link(). "rss/" .$this->ShowTag(), _t('BlogHolder.RSSFEED',"RSS feed of this blog"));
In the rss() I added a parameter to $entries:$entries = $this->Entries(20, Director::urlParam('ID'));
The rss widget still works the same way. The browsers rss link in the address line is now dynamic and shows entries by the selected tag.
Now I just need a template link to rss. -
Re: RSS feed for blog entries with a certain tag

24 August 2009 at 12:56am
Here is the template link to RSS:
function LinkToTagRSS() {
$url=$this->Link(). "rss/" .$this->ShowTag();
return $url;
}
Very simple ;) I hope I did not break a big security hole in my installation. -
Re: RSS feed for blog entries with a certain tag

24 August 2009 at 11:11pm
Hi!
That's a nice addition (BTW, did you submit it to Trac?), thank you!
Nevertheless, $LinkToTagRSS does not work in templates of widgets included in the Sidebar (i.e. SubscribeRSSWidget.ss and TagCloudWidget.ss). I don't know if it is a bug or a feature… ;)
Best regards,
Juan -
Re: RSS feed for blog entries with a certain tag

26 August 2009 at 5:11am
Hi Juanitou,
I didn´t submit it to trac yet, mabe I finde some time tomorrow.
I´m not familiar with the widget arcitecture, but I know that those widget have their own controllers (eg RSSWidget.php). Maybe you have to implement the LinkToTagRSS-method there to call it on a widget template.Greetings,
Roland
| 1172 Views | ||
|
Page:
1
|
Go to Top |

