R – Add Custom Meta Data to a Team Site Programmatically

mosssharepointsharepoint-2007

I have been asked to write a custom webpage in a web application integrated into a MOSS 2007 solution to allow users to create a teamsite using a custom template. No problem.

However, the user must have the ability to assign custom meta tags to the created team site to allow for specific searches, i.e. to assign country ("USA") and department ("Accounting") tags. Can anyone suggest a way of adding custom properties to the newly created team site via the SharePoint API?

Thanks, MagicAndi

Best Answer

There are 2 options:

  • You can use the Propertybag (SPWeb.Properties) of the SPWeb object of the new team site
  • You can add a list (invisble to users except admins) called "site tags" and add some items in there with key value pair fields i.e. item Country with value "USA" etc.