4

Does anyone know of a fast way to tell through code if a ContentType is one that's a pre-installed one?

Conversely, I want to know if a given ContentType was provisioned by a custom feature / generated by the user through the WebUI.

Sure, there are short ContentTypeIds (like 0x0102) and long ones (0x0100<flattened guid>), but is there any other way?

I'm asking for any version, 2007 or 2010.

2

http://www.pvle.be/2011/01/is-a-given-field-one-of-sharepoints-built-in-field/

1

Try this:

SPContentType ct;
//set your content type
bool builtIn = SPBuiltInContentTypeId.Contains(ct.Id);
  • Yup, pretty much inferred from the link posted by @gandjustas, but that's the approach I'll try. – James Love Apr 14 '11 at 17:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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