|
Cookbook /
RSSFeedLinkSummary: How to create auto-detect RSS feed links
Version: 2004-12-15
Prerequisites:
Status:
Maintainer: Pm
Categories: RSS
QuestionSome sites have RSS feeds that are automatically detected by the browser (such as Firefox's "Live Bookmarks". How can I configure my wiki to do this? AnswerFirst, you need to have RSS feeds enabled on your site -- see PmWiki.RSS and Category.RSS. Then, add the following into a local customization file:
$HTMLHeaderFmt['rss'] =
"<link rel='alternate' title='\$WikiTitle RSS'
href='\$ScriptUrl/\$SiteGroup/[=AllRecentChanges=]?action=rss'
type='text/xml' />";
If feed readers have trouble finding the feed (and you have verified its existence/readability via other methods), try type='application/rss+xml' instead. --OtherMichael
This adds an "alternate" link that some browsers will recognize as a link to subscribe to an RSS feed based on the Site.AllRecentChanges page for your site. (You can of course change this to generate RSS feeds based on any other RecentChanges or WikiTrail page.) Rewrite rule for changing feedsProblem: When someone subscribes to your current link and later you change the way how you generate the feed, readers will not adapt to this change. Solution: Make an alias for RSS link that will be more stable. If you are hosted on an Apache server, you can make an alias in .htaccess RewriteRule ^index\.xml$ ?action=rss&group=-pmwiki,-site,-main,-contributions,-profiles,-Category&name=-RecentChanges,-Template,-GroupHeader,-GroupFooter [NC] and then offer the RSS link as Note that everything after -OtherMichael, thanks to Roman
NotesSee AlsoContributors
FeedbackRSS for each Wiki page?That's exactly what I was looking for ;-) Great! ummm, by "each side" above do you really mean each WikiGroup within a site, or...? --Pm
1) I mean a RSS for each site, e.g. for this RSSFeedLink. Whenevery something changes -> show headlines. 2) Another option is, as you said, for each group. So in this site it would be the Cookbook. This option is possibly the more sensible one ;-) Thanks for any help, -- Markus
RSS works best on a page with a WikiTrail and one way to guarantee that is to point to a RecentChanges page. To point to the current group should be:
$HTMLHeaderFmt['rss'] =
"<link rel='alternate' title='\$WikiTitle RSS'
href='\$ScriptUrl/\$Group/[=RecentChanges=]?action=rss'
type='text/xml' />";
|