In this article we will be seeing how to programmatically configure RSS settings for the SharePoint list.
Introduction:Really Simple Syndication (RSS) is used for transmitting information across the internet and intranets. We can also subscribe to RSS Feeds from SharePoint libraries, lists, and other elements. We can use an RSS Viewer Web Part to display an RSS Feed on a SharePoint site. An RSS Viewer Web Part provides a convenient way to view information from many sources on a single page.In this article we will be seeing how to programmatically configure RSS settings for the SharePoint list.Configure RSS settings for the list:
list.EnableSyndication = true;
list.Update();
// Truncate multi-line text fields to 256 characters
list.RootFolder.Properties["vti_rss_LimitDescriptionLength"] = 1;
// Title
list.RootFolder.Properties["vti_rss_ChannelTitle"] = "Contributor List RSS";
// Description
list.RootFolder.Properties["vti_rss_ChannelDescription"] = "RSS feed for Contributor List";
// Image URL
list.RootFolder.Properties["vti_rss_ChannelImageUrl"] = "/sites/Sample/_layouts/images/siteIcon.png";
// Maximum items to include
list.RootFolder.Properties["vti_rss_ItemLimit"] = 15;
// Maximum days to include
list.RootFolder.Properties["vti_rss_DayLimit"] = 3;
list.RootFolder.Update();
// For Document Library
// Include file enclosures for items in the feed?
list.RootFolder.Properties["vti_rss_DocumentAsEnclosure"] = 0;
// Link RSS items directly to their files?
list.RootFolder.Properties["vti_rss_DocumentAsLink"] = 0;
Interview Questions on SharePoint 2013