Textpattern Plugin : ajw_comments_feed

10 November 2005 @ late morning | Comments (4)

Plugin Details

Download:
ajw_comments_feed
Version:
0.6
Forum:
Read discussion
Status on this site:
Active

Please use forum for all bug reports and questions

Summary

This plugin extends Textpattern’s RSS & Atom functionality to allow for sitewide, section, category, or article comments feeds. It works exactly like normal feed urls and utilizes the “area” querystring variable, i.e. area=comments. The usage of other modifiers, such as section=foo or category=bar, is also possible.

Requires Textpattern v4.0.4

Setup

No setup needed. Simply install & activate the plugin and — voila! — comments will be served up from feed urls using area=comments in the querystring. To output a custom link to a comment feed, use the ajw_comment_feed_link template tag.

Template tag: ajw_comments_feed_link

This will be used in your templates or forms in order to output a dynamic link to your comments feed, based on the attributes you give it and what page is being viewed. This is the only template tag you will ever use with this plugin.

The ajw_comments_feed_link template tag will allow you to display a permanent link to your comments feed from within page templates or forms. This tag functions exactly like <txp:feed_link />. Acceptable attributes include: sitewide, wraptag, limit, flavor, label, & title.

The sitewide attribute allows you to use a comments feed link in a template that always refers to a sitewide feed link, rather than article-specific. For instance, sitewide="y" will cause an RSS feed link url to become http://site.tld/?rss=1&area=comments (no id variable).

Usage

Example template tags:

  • <txp:ajw_comments_feed_link />
  • <txp:ajw_comments_feed_link sitewide="y" />
  • <txp:ajw_comments_feed_link flavor="atom" />
  • <txp:ajw_comments_feed_link limit="25" label="RSS Comments Feed" />

Example comments feed urls:

  • http://site.tld/?rss=1&area=comments
  • http://site.tld/?atom=1&area=comments
  • http://site.tld/?rss=1&area=comments&id=123
  • http://site.tld/?rss=1&area=comments&section=foo

Disclaimer

This plugin utilizes the feed formatting code-base from Textpattern v4.0.3 r1228, thus any problems or bugs that exist in Textpattern’s RSS/Atom output will be contained within this plugin.

If you have a problem or bug relating to Textpattern’s RSS/Atom output that has already been reported in the Textpattern forum, please do not reply to the plugin discussion thread, but rather report it to the development team or lend a hand.

FAQ

The Atom comments feed gives me a warning during validation. Why?
This is due to the unpredictable and flexible format of the feed url. Please refer to this Textpattern forum thread for more explanation.

Revision History

  • v0.6
  • Updated for Textpattern v4.0.4
  • v0.5
    • Fixed bug with clean comments feeds
  • v0.4
    • Fixed broken Atom feed when an article has no comments.
  • v0.3
    • Added sitewide attribute to signal whether you want ajw_comments_feed_link to always output a sitewide link, rather than an article-specific link.
  • v0.2
    • Atom encoding tweak

4 comments

1

thanks a lot. I am in the middle of “upgrading” from a heavily hacked RC1 to 4.0.2, and your plugin comes in quite handy.

I have added another function, that returns a link tag instead of an anchor.

here you go. I’m not a plugin-writer or anything, so feel free to take it, change it as you wish and maybe release a v0.4?

(Editor's note: code removed because of formatting. I saved a copy - thx!)

I guess you could just extend your output-function to return either a link or the meta tag, but hey, this works fine for me.

Cheers,

Matthias

matthias willerich → contentwithstyle.co.uk
2

and, i didn’t read the disclaimer about where to discuss the plugin…

matthias willerich → contentwithstyle.co.uk
3

Haha yeah it’s ok. Mainly because it’s tough to format code in comments, so it reads poorly. I’ll take a look at your suggestion, and thanks!

Andrew → compooter.org
4

Thanks, man. This works like a charm!

Gerrit → praegnanz.de

Comments are closed for this article.

Previously