RSSFeedLink
Question
Some 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?
Answer
First, you need to have RSS feeds enabled on your site -- see PmWiki.WebFeeds 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' />";
type='application/rss+xml'
instead. --OtherMichael
type='application/atom+xml'
Tautrimas
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 feeds
Problem: 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 http://[path-to-wiki]/index.xml
Note that everything after ?action=rss
should be customized to your requirements, and must match what you have set above. This is, unfortunately, a parallel dependency.
Notes
See Also
Contributors
- Pm, 2004-12-15
Feedback
RSS for each Wiki page?
That's exactly what I was looking for ;-) Great!
Where do I have to put this link if I want to provide this RSS file for EACH side, so not only for AllRecentChanges (Therefore AllRecentChanges has to be replaced by some variable???)
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' />";
User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.