Create an RSS Feed for last comments


This tip has been first posted in the forum, using a completely other logic. This was immediately followed by a big hint from MattD, showing the right direction TXP Tip on creating an author feed


Two plugins have to be installed and activated :


  • go to Admin Extensions tab > External output > Create a new output
  • name it whatever you want (for example here: commrss)
  • give text/xml as Content-type
  • copy-paste the following code:
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="" xmlns:content="" xmlns:atom="">
 <title><txp:site_name /></title>
 <description><txp:site_slogan /> - comments</description>
 <link><txp:site_url /></link>
 <atom:link href="<txp:site_url />?rah_external_output=commrss" rel="self" type="application/rss+xml" />
 <pubDate><txp:php>echo safe_strftime('rfc822');</txp:php></pubDate>

 <txp:recent_comments break="">

   <txp:variable name="item_content" value='<![CDATA[<txp:comment_message />]]>' />
   <txp:variable name="item_author" value='<txp:etz_striptags><txp:comment_name /></txp:etz_striptags>' />
   <txp:variable name="link_guid" value='<txp:php>global $thiscomment; echo permlinkurl($thisarticle)."#c".$thiscomment["discussid"];</txp:php>' />

     <title>Comment on <txp:title no_widow="0" /> by <txp:variable name="item_author" /></title>
     <link><txp:variable name="link_guid" /></link>
     <guid><txp:variable name="link_guid" /></guid>
     <pubDate><txp:comment_time format="rfc822" /></pubDate>
     <description><txp:variable name="item_content" /></description>
     <content:encoded><txp:variable name="item_content" /></content:encoded>
     <dc:creator><txp:variable name="item_author" /></dc:creator>



Recent comment are retrieved with <txp:recent_comments>, data are stored once and for all using <txp:variable>, then rendered between the tags <item> ... </item>

To retrieve the feed :

  • in a textpattern form or page: <txp:site_url />?rah_external_output=commrss
  • “hard coded” (where is your domain name):

comments powered by Disqus