ContentType

ContentType

The templates in this section shows examples on how to create content types for your SharePoint site.

Add template to content type
It is possible to add your own Word, PowerPoint or Excel template to a content type which contains your corporate identity for example. To do this via a Make template there are three steps required:

  1. Define your content type
  2. Upload your template to the “_cts” folder in SharePoint. 
  3. Connect the template to your content type

An example of a template can be found here.

Add contenttype to site collection

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
<Site Url="{url}" Title="{title}" Template="STS#3" LCID="1033" OwnerLogin="{owner}" UserCodeQuota="0" StorageQuota="0">
    <RootWeb Url="{url}" Title="{title}" Description="{description}" Template="STS#3" LCID="1033">

        <Fields>
			<Field Name="ProjectSiteUrl" DisplayName="Project Site Url" >
				<![CDATA[<Field ID="{0FF1B04D-C526-4803-8D19-35E3CA81F04F}" Name="ProjectSiteUrl" StaticName="ProjectSiteUrl" DisplayName="Project Site Url" Type="Text" Required="TRUE" Group="Project Center" EnforceUniqueValues="TRUE" Indexed="TRUE" Description="The last part of the URL for this Project Site" MaxLength="128"/>]]>
			</Field>
        </Fields>

        <ContentTypes>
            <ContentType Title="Project Site Aanvraag" Group="Project Center" ParentContentTypeId="0x01" Id="0x0100CB40E96508F44F2984C55EC78BEDAB72">
                <FieldRefs>
                    <FieldRef DisplayName="Project Site Url" Name="ProjectSiteUrl" Id="{0FF1B04D-C526-4803-8D19-35E3CA81F04F}"/>
                </FieldRefs>
            </ContentType>
        </ContentTypes>

    </RootWeb>
</Site>

Add contenttype to list

1
2
3
4
5
6
7
<Lists>
    <List Url="Bibliotheek" TemplateType="101" TemplateFeatureId="00bfea71-e717-4e80-aa17-d0c71b360101" ContentTypesEnabled="True" Title="Bibliotheek">
        <ContentTypes>
            <ContentType ParentContentTypeId="0x010100B8490113CE537749BB3E621DCFADEA77" Name="Basisdocument"/>
        </ContentTypes>
    </List>
</Lists>