Full RSS in Plone 3

by Alfredo Daniel Rezinovsky last modified Dec 06, 2009 09:27 PM
Plone built in RSS template shows only the description. This article explains a way to change this template to have the full content in the RSS.

Purpose

RSS is a web source format to provide readers with updated content.

Plone built in RSS template provides the Item description only.

One of the main goals of web source formats is to let readers automatically track new content for lots of sites without the need to enter each site. If the feed doesn't have the full content, the user can track new posts but needs to enter the site to view the complete content. This way the whole feed idea has no sense.

There are already some howtos about this. Some of them lets you change the description for the content but don't show the description. Others use Python structures hard to understand. This one is short and simple.

Prerequisites

Tested with Plone 3 and 3.2, but it can work with older versions.

Step by step

  1. Go to ZMI at $your_plone_url/manage
  2. Go to portal_skins/plone_templates/rss_template
  3. Click "Customize"
  4. Search for
    <description tal:content="obj_item/Description">
    Description
    </description>
    This piece of code places the description of each item into a <description> tag.
    In the original template it's into a very long line. You may want add some line feeds before and after this block to edit it easily.
    Be aware that after this item description tag there's the feed description tag. The feed description is not what we are looking for.
  5. Replace the description with:
    <description>
     &lt;b&gt;
      <span tal:replace="obj_item/Description">
       Description
      </span>
     &lt;/b&gt;
     &lt;br&gt;&lt;/br&gt;
    <span tal:replace="obj_item/getText">Content</span>
    </description>

This shows the description in bold, then a line feed and then the content.

As you can guess &lt; and &gt; are entities representing the characters < and >. We write them this way because they should not be interpreted as XML tags, but as text content inside the RSS.

There are other ways to do this, like putting the content inside a <content: encoded> tag, but currently there are very few RSS readers that read this tag.