Personal tools
You are here: Home Linux and free software A hack to enable full-text RSS feeds in Plone

A hack to enable full-text RSS feeds in Plone

— filed under: , , ,

You can let people syndicate your Plone site, searches or collections in full. Here's how.

This is a quick hack I came up with after Googling for hours and making many experiments.  Follow these instructions:

  1. Launch your ZMI and locate your Plone instance.
  2. Go to portal_skins/plone_templates/rss_template
  3. Customize it
  4. Locate the line that says
    <description tal:content="obj_item/Description">Description</description>
  5. After that line, add
    <content:encoded 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      tal:condition="obj_item/getText | nothing"
      tal:content="structure python: '&lt;![CDATA[' + obj_item.getText() + ']]&gt;' ">blah
    </content:encoded>

That is it.  Try a search and click the RSS link.  Then view the source.  You should see the content inside the <content:encoded> tags.

But what about spammers harvesting my content?

By now, you must also be familiar with the problem of spammers harvesting full-text feeds for their link farm sites.  We've got a solution that will let you keep your full-text feeds.

Making full text conditional to an URL parameter

If you want to make the full text feed conditional to a query string parameter, just add this instead:

<content:encoded 
  xmlns:content="http://purl.org/rss/1.0/modules/content/" 
  tal:define="text obj_item/getText|nothing; full request/full|nothing"
  tal:condition="python: text and full"
  tal:content="structure python: '&lt;![CDATA[' + obj_item.getText() + ']]&gt;' ">blah
</content:encoded>

...and now, the regular feeds will remain unchanged, but whenever your users append ?full=1 to the URL they are using for feeds, their feeds will contain the full article text.

Suggestions, as always, welcome.

Document Actions
Add comment

You can add a comment by filling out the form below. Plain text formatting.

Info
You are not logged in. You may optionally enter your username and password below. If you don't enter anything, this comment will be posted as 'Anonymous User'.
(Required)
(Required)
(Required)
Enter the word