Enable RSS feed in SharePoint 2013
SharePoint 2013 have out of the box support for publishing RSS feed for lists and libraries. For publishing portals it is important to expose the site contents as RSS feeds. In this walkthrough I am going to explain how you can configure RSS feed for lists, libraries etc. in the SharePoint portal with your own display.
For the purpose of this walkthrough, I have created a picture Library named “MyPictures” and added five pictures to this library. The thumbnail view of the picture library is as follows.
Now go to the library tab of your list page.
You can see the RSS feed icon is disabled, this is because I didn’t enable the RSS feed for my site. Now let us see how we can enable the RSS feed settings.
Enable RSS feed for Sites/Site Collection
Initially you need to enable the RSS feed for the site collection and the site where you need to expose your contents as RSS feeds.
Go to your top level site settings page, if you are in a sub site, make sure you click on “Go to top level site settings”
Now In the Top level site settings page, you can find RSS link under site administration.
In the RSS settings page, you can enable the RSS for the site or entire site collection. Also you can define certain properties such as Copy right, managing editor, web master etc. Click OK once you are done.
If you want to disable the RSS feed for any site, go the site settings page and click RSS link and just uncheck the “Enable RSS” checkbox and click OK.
Now let us see the effect of the changes we have made. Go to the “MyPictures” page and under library tab, see the RSS icon, you should see the icon is enabled now.
Click on the RSS feed icon, you will see the RSS feed in the browser.
Customize the RSS feed
In SharePoint 2013, the RSS feed is exposed using listfeed.aspx, you can find the listfeed.aspx under the layouts folder.
By default the RSS feed is using RSSXslt.aspx file, which renders XSL to the browser.
You can find these files under layouts folder the 15 hive. The following is the path to layouts folder when SharePoint is installed in the C: drive.
C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS
Though it is possible to customize RssXslt.aspx to apply your own design, it is not recommended as this is a SharePoint system file and there is a chance that this file can be replaced by patches, service packs etc.
Though RSS feeds meant for machines, you may need to present the RSS feed in your site and provide subscription instructions. So you need to perform two things here, first you need to select the data for the RSS feed to expose and secondly you need to display the RSS feed in your site in a formatted way. Let us see how we can achieve the same.
Choose the data for RSS Feed
Navigate to your list page, under the library tab, click on Library settings icon.
Once you enabled RSS for the site, you will see a column “Communications”, locate “RSS Settings” under Communications.
Click on the RSS settings, you will see the below settings page
First you can define whether you need to enable RSS for this list, in case if you don’t want a particular list to expose as RSS feed, you can say no for this.
Under the RSS channel information; you can define a title, description and an Icon for the feed. Under document options, include file enclosures allows you to link the content of the file as encloses so that the feed reader can optionally download the file. Link RSS items directly to their files, since this is a picture library, I need the item to link directly to the image. You can select these options depending on your needs.
In the columns section, you can select the columns that you need to include in the RSS feed, also you can specify the order of the columns in the feed.
Under Item Limit, you can specify the maximum number of items and the maximum age for the item, by default items in the past 7 days will include, you can configure this based on your needs. Click OK once you are done.
See the output XML generated by listfeed.aspx
Display RSS feed in your page
Now you may need to include this RSS feed in your page. In order to do that you can use the XML viewer web part available in SharePoint 2013 and specify a XSLT for transforming the feed to formatted output.
First create a page and insert a web part, under the web part selection menu, select Content rollup as the category and then select the XML Viewer web part and click on the Add button.
In the Web part settings you can define XML url and XSL url.
I just created a simple XSL file, you can download the text version of the file from here.
The following is the output generated in the browser once I applied the attached xsl.
SharePoint 2013 supports exposing and consuming RSS feeds without writing a single line of code. You have complete control over on what content can be exposed as RSS feeds.