Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm adding some content types to every standard-document library which is created over the "List Added"-EventReceiver. When a web is created the are some new doclibs for example in a team site there is are "shared documents" and "Site Assets".

My problem is that I only want to add the content types to the standard doclibs like "shared documents" in my example above but not in "Site Assets". How can I determine if a doclib is a standard doclib and not a sharepoint-specific doclib?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

You can check the TemplateFeatureId property of the SPList object, to see which feature the list template belongs to. The AssetLibrary feature has ID={4BCCCD62-DCAF-46dc-A7D4-E38277EF33F4} .

In a Team Site on the other hand the "Site Assets" is created as a document library in code, using the same template feature as "Shared Documents" (ID={00bfea71-e717-4e80-aa17-d0c71b360101}). One thing that distinguishes the Site Assets lib though is that it has the IsAssetsLibrary property set to true. But that can only be used to identify if it is a Site Assets library or not.

Some clever combination of these should help you out.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.