Looking for something?

Author: Tobias Zimmergren
URL: http://www.zimmergren | http://www.tozit.com

Introduction

Sometimes the only option you’ve got is to alter things using the object model of SharePoint. In this particular case I wanted to change the RSS-settings for a specific list.

So that’s what this little tip is about – customizing the RSS settings of any SPList object using the SharePoint API.

Problem

Today I wanted to change and/or customize the RSS settings for a specific list that exist on my site though the API. I found that this wasn’t as obvious as you’d like it to be, and hence I’m writing it down.

The SPList object has a .EnableSyndication property which you can use to turn on RSS for the list, but there’s no obvious property to access if you want to change the RSS settings itself.

Get it working

On your SPList objects, you’ve got the RootFolder property that contains a collection called "Properties" in which you’ll find all sorts of useful information for the list itself.

In my case I wanted to fetch all the settings related to RSS, and made a simple console application to iterate the items in the Properties collection and ended up with the following:

imagee

This is the code  to list the properties:

imagee

Alrighty, so we have the code to see the properties (or use the SharePoint Manager tool from CodePlex). Now we want to alter those properties. Simple:

imagee 

Conclusion

In order to accomplish the simple task of reading, changing or setting the properties in regards to RSS settings for your list (or any other property, for that matter) – all you need to do is utilize the RootFolder.Properties collection and access the vti_rss_ properties:

vti_rss_DayLimit
vti_rss_DisplayOnQuickLaunch
vti_rss_DisplayRssIcon
vti_rss_LimitDescriptionLength
vti_rss_ChannelTitle
vti_rss_ItemLimit
vti_rss_ChannelDescription

I’d like to shout out a thanks to Andrew Burns for being quick on twitter and pulling an answer out of his sleeve for this.

Enjoy.

0 Comments 08 July 2009
Tobias Zimmergren

Tobias Zimmergren

Hi, I'm Tobias. I am a Microsoft MVP for SharePoint and I use this site to share my thoughts on tech with you on topics like SharePoint, Office 365, Azure and general web development.

  Malmö, Sweden

Related Post

Comments powered by Disqus
res.