Friday, October 2, 2015

Creating RSS feeds of your Sitecore content

Sitecore allows you to create an RSS feed for any content item that you have on your web site. Common sections that are good candidates for RSS feeds are news/update items or blog posts, however creating feeds for other items is a simple way to expose the data to third party systems (company portal for example).

For example, if you had news content (that was based on a custom news template) you could create an RSS feed of the content using the following instructions:
  1. Create a folder in your content tree called "Feeds"
  2. On the feeds folder click "Insert from template" and select "RSS Feed" (available under /sitecore/templates/System/Feeds/)
    1. Under Items, select the parent item (where all of your news items are descendants)
    2. Under the Description field, enter a description of the RSS feed
  3. Under templates navigate to the template of your news item (the template which the descendants of the item selected above are of). Select the standard values and from the top ribbon select Presentation and then Design (feeds).
    1. From here you map a title, body and date field from the item template and save and close.
  4. Publish the web site, and navigate to the location of the RSS feed from step 2. You will now see an RSS feed. Please note that this will format correctly in Firefox and Internet Explorer, but will appear as XML in Chrome.

* If you have multiple templates under the item selected for the RSS feed, you will need to set presentation details for each template type. If you don't the item will not appear in the feed, this is also a good way of keeping any containers organizing the content (categories for example) from being displayed in the feed.

No comments:

Post a Comment