RSS

Description

Programming RSS feeds on Plone sites

Introduction

Plone can generate RSS feeds from folderish content types (folder / collection). If you want to aggregate content from all the site to RSS feed, you first create a collection conten item and then enable RSS feed on this collection content item.

Creating a global, language neutral, Plone site content aggregator

These instructions tell you how to create a RSS feed collection for your Plone site. You can choose what content types ends up to the RSS stream. Also, the aggregator is language aware so that it works correctly on multilingual sites.

Creating the collection

First we create a collection which will aggregate all the site content for the RSS feed.

  • Go to site root
  • Add new collection
  • Title "Your site name - RSS feed"
  • On Category tab, set Language to neutral
  • On Settings tab, choose Exclude from navigation
  • Save
  • Go to site root / Contents tab
  • Check your RSS content collection
  • Choose Rename button
  • Change item id to site-feed

Collecting content for the RSS feed

  • Go to your collection content item
  • Go to criteria tab
  • Set content types criteria
  • Set sort by publishing date, reverse
  • Save
  • Now, choose content items you want to appear in the feed and Save again

You can now preview the content of RSS feed on View tab.

Publish and test

Publish collection after the content seems to be right, using the workflow menu on the collection content item.

Test RSS feed by copy-pasting RSS URL from the site action to your RSS Reader, like Google Reader.

portal_syndication

portal_syndication is a persistent utility managing RSS settings. It provides settings to for formatting RSS feeds (update frequence, number of items).

Publishing content through RSS in Plone 4

Access /content/synPropertiesForm and publish.

RSS feed content

RSS feed content is the content of the folder or special stream provided by the content type.

portal_syndication uses the following logic to pull the content:

if hasattr(obj, 'synContentValues'):
    values = obj.synContentValues()
else:
    values = obj.getFolderContents()
return values

Changing RSS feed template

RSS feed is stored in template CMFPlone/skins/plone_templates/rss_template.




Edit this document

The source code of this file is hosted on GitHub. Everyone can update and fix errors in this document with few clicks - no downloads needed.

  1. Go to RSS on GitHub.
  2. Press Fork and edit this file button.
  3. Edit file contents using GitHub's text editor in your web browserm
  4. Fill in the Commit message text box at the end of the page telling why you did the changes. Press Propose file change button next to it when done.
  5. On Send a pull request page you don't need to fill in text anymore. Just press Send pull request button.
  6. Your changes are now queued for review under project's Pull requests tab on Github.

For basic information about updating this manual and Sphinx format please see Writing and updating the manual guide.