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

At low level, SharePoint manages lists based on their BaseType (0 for Generic List, 1 for Document Library etc.), which defines the list's field set (for example, all built-in Base Types define such columns as ID, Author, Editor etc). Base Types are encapsulated in the SPBaseType enumeration, but it's possible to create custom BaseTypes inside a Site Definition.

Furthermore, there are ListTemplates (such built-in list templates as 100 for CustomList, 101 for DocumentLibrary etc). List Templates are based on BaseTypes. As far as I understand, they add more fields to that defined in the BaseType. It's also possible to create custom ListTemplate, and custom ListDefinitions. What are differences between them?

Finally, there are ContentTypes, which define a set of Site Columns. There is an option EnableContentTypes in any list or library, but simultaneously, every list has at least one content type, even if this options is set to false.

And also it is possible to add a field to a list without interacting somehow with it's template, definition or content type.

So, how SharePoint builds the final field set for a list or library? Does it merge fields defined in all there sources?

Could anybody please explain how all these components relate to each other, this all is a bit mixed up in my head. Thx in advance.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

BaseTypes
The different BaseTypes are build into the SharePoint code and implemented with some differences. You can't make your own BaseTypes.

List Definitions
List definitions are build in Features by Microsoft or others (MS has reserved Type<10000 for their use). These are blueprints of fields, views, ContentTypes... To use when creating a list.

ContentTypes
ContentTypes are definitions for items in a list of which fields, forms, template, workflows... To use. Which can be different from item to item in a list

Lists
When a list is crwated it takes a copy of the list definition and any content type added so the user can change these copies. In the case of the content types the "copies" inherit from the original

List Templates
Is a way for the enduser to take a snapshot of a changed list a save it to be able to create new lists like that

EnableContentTypes
Turns on/off the UI showing the users the options about multiple content types in the list

share|improve this answer
    
Could you explain then what the BaseTypes element means? msdn.microsoft.com/en-us/library/ms467993.aspx –  Paul Apr 14 '12 at 17:29
1  
Currently you should regard <BaseTypes> and the contained <BaseType> elements as configuration options for MS to configure the fields in the BaseTypes in th global ONET.XML, but there is a lot of differences between basetypes implemented in code. It may be that MS at some point open up for us to implement our own basetypes (but I doubt it) –  Per Jakobsen Apr 15 '12 at 11:32
    
Thanks, it became a bit more clear:) But I'm still not understanding how SharePoint handles BaseTypes. All the fields in a list build it's own Content Type, explicitly or implicitly. But at the same time, every list has a Base Type. In the BaseType element in the global onet.xml file there's a schema that defines some Fields. So, does SharePoint copy these fields to every list's internal ContentType when creating a list? –  Paul Apr 25 '12 at 22:14
    
Well it doesn't copy the fields into the ContentTypes only into the list. A list is what really has the fields. It has the fields for all it's content types and possible more. The content type only has references to fields and that may be a subset of the fields in the list, but any listitem has all of the fields in the list. –  Per Jakobsen Apr 26 '12 at 6:08
    
Does it mean, for example that if I have 2 content types in a list, each item will contain all the fields from both content types, leaving columns from the other content type empty? Will check it with some code.. –  Paul Apr 27 '12 at 20:54
show 2 more comments

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.