Quick tip: Add new property in SP2010 site collection property bag

The property bag of a site collection is a hashtable keeping key-value pairs. You can add as many as you want and access them programmatically at a later stage by a simple SiteCollection.OpenWeb().AllProperties[“PropertyName”].

But, what is a quick way to review all the existing properties or to add a new one without going through the trouble to fire up visual studio and create a project for it? Well, there’s no GUI for the property bag so, is it only accessible through code?

Not really. Here come the Designer to the rescue.

Fire up SharePoint Designer 2010 (SPD2010), open your site collection, click on the Site Options on the top right hand corner and the first tab that will open up will be the site collection’s property bag. The tab is actually called “Parameters” but this is where your list of properties live. Apart from listing them for you, the tab will also allow you to actually add, modify or altogether delete properties.

So, if you just want to have a quick way to add a custom property to use in your code, you can go ahead and create one there.

Remember that these are pairs. You create a parameter and provide a single value for it.

Notice that you can also use the web.config to introduce new properties. Also, you can introduce new properties in other levels, such as SPFarm, SPWebApplication, SPSite, SPWeb and SPList.

More information for the property bag can be found here: http://www.fivenumber.com/understanding-sharepoint-property-bag-settings/

MGR: the Intelogist

About MGR: the Intelogist

SharePoint Server developer, turned Sitefinity developer, turned Angular developer, turned SharePoint Online consultant, turned Unily consultant, turned O365 consultant... Never a dull moment!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

This site uses Akismet to reduce spam. Learn how your comment data is processed.