A hack to enable full-text RSS feeds in Plone
This is a quick hack I came up with after Googling for hours and making many experiments. Follow these instructions:
- Launch your ZMI and locate your Plone instance.
- Go to portal_skins/plone_templates/rss_template
- Customize it
- Locate the line that says
<description tal:content="obj_item/Description">Description</description>
- 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: '<![CDATA[' + obj_item.getText() + ']]>' ">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: '<![CDATA[' + obj_item.getText() + ']]>' ">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.
