ContentType Element (ContentType)
Defines a single content type.
<ContentType BaseType="Text" ID="Text" Name="Text" Group="Text" DocumentTemplate="Text" ResourceFolder="Text" ReadOnly="TRUE" | "FALSE" Hidden="TRUE" | "FALSE" Description="Text" Sealed="TRUE" | "FALSE" V2ListTemplateName="Text" Version="Integer" FeatureId="Text"> </ContentTypes>
| Attribute | Description |
|---|---|
|
BaseType |
Reserved for internal use. |
|
ID |
Required Text. Specifies the content type ID of the content type. |
|
Name |
Required Text. Specifies the content type name. |
|
Group |
Optional Text. Specifies the content type group to which the content type is assigned. Content type groups are user-defined groups that help you organize your columns into logical categories. |
|
DocumentTemplate |
Obsolete. |
|
ResourceFolder |
Obsolete. |
|
ReadOnly |
Optional Boolean. TRUE to define the content type as read-only. If you do not include this attribute, Windows SharePoint Services treats the content type as if this attributes was set to FALSE. |
|
Hidden |
Optional Boolean. TRUE to define the content type as hidden. If you define a content type as hidden, Windows SharePoint Services does not display that content type on the New button in list views. If you do not include this attribute, Windows SharePoint Services treats the content type as if this attributes was set to FALSE. |
|
Description |
Optional Text. Provides a description for the content type, to display in the Windows SharePoint Services user interface. |
|
Sealed |
Optional Boolean. TRUE to define the content type as sealed. You must have site collection administrator rights to unseal and edit a content type defined as sealed. If you do not include this attribute, Windows SharePoint Services treats the content type as if this attributes was set to FALSE. |
|
V2ListTemplateName |
Optional Text. Specifies the Windows SharePoint Services 2.0 list template type to which this content type maps. For example, the Document content type maps to the Document Library list template. |
|
Version |
Reserved for future use. |
|
FeatureId |
Optional Text. Provides the ID of the feature in which the content type is packaged. |
For more information about content types, see Content Types.
For more information about assigning content type IDs, see Content Type IDs.
For more information about read-only and sealed content types, see Content Type Change Control.
For more information about hidden content types, see Content Type Access Control.
The following example is the content type definition of the Document content type. The example has been edited for clarity.
<ContentType ID="0x0101" Name="$Resources:Document" Group="$Resources:Document_Content_Types" Description="$Resources:DocumentCTDesc" V2ListTemplateName="doclib" Version="0"> <FieldRefs> <RemoveFieldRef ID=FID_Attachments Name="Attachments" /> <!-- Attachments --> <RemoveFieldRef ID=FID_WorkflowVersion Name="WorkflowVersion" /> <!-- WorkflowVersion --> … <FieldRef ID=FID_SelectFilename Name="SelectFilename" /> <!-- SelectFilename --> <FieldRef ID=FID_FileLeafRef Name="FileLeafRef" Required="TRUE"/> <!-- FileLeafRef --> <FieldRef ID=FID_Created Name="Created" Hidden="TRUE" /> <!-- Created --> <FieldRef ID=FID_Title Name="Title" Required="FALSE" ShowInNewForm="FALSE" ShowInEditForm="TRUE"/> <!-- Title --> … </FieldRefs> <XmlDocuments> <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms"> <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms"> <Display>DocumentLibraryForm</Display> <Edit>DocumentLibraryForm</Edit> <New>DocumentLibraryForm</New> </FormTemplates> </XmlDocument> </XmlDocuments> </ContentType>
Error occurred in deployment step 'Activate Features': The content type with Id 0x0100175EA9FE91CD4A4A87CD52FB1168E793 defined in feature {1d2a1c17-4c13-43f3-910f-a15a007c1313} was found in the current site collection or in a subsite.
I try to search the content type into the web site gallery but it isn't..
so what can i do?
- 4/23/2010
- jent
- 2/4/2009
- Paul Turner
- 2/4/2009
- Paul Turner
The Name attribute's value cannot contain any colons (":") or commas (","). There may be other special characters that it doesn't like either.
If you put one of these characters in the value of the Name attribute (for example, "My workflow: Task 1 Content type"), the content type will not be deployed during feature activation. If you have verbose logging turned on for the "Feature Infrastructure" logging group, you will get an error message in the ULS log, but STSADM WILL NOT REPORT THE ERROR. The error (Windows SharePoint Services, General, Unexpected) in the ULS log is:
SPContentTypeElement.ElementActivated() Skipped activation because of InvalidName: '<your content type name here>'
If you find other special characters that cause this, please add that information to this post!
I've posted some background to this issue on my blog: http://blumenthalit.net/blog/Lists/Posts/Post.aspx?ID=49
- 5/19/2008
- M. Blumenthal
- 5/19/2008
- M. Blumenthal
- 12/21/2007
- Joakim Atterhall
- 11/15/2007
- Doc WattsMan