SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do you provision a file through a module (CAML) and choose its Content Type? Is it even possible? The normal behavior for a new item is to get the default content type.

share|improve this question
up vote 1 down vote accepted

If you look at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES\PublishingLayouts\ProvisionedFiles.xml it contains the PageLayouts for publishing which is provisioned like:

<Elements xmlns="">
    <Module Name="OSGPageLayouts" Url="_catalogs/masterpage" Path="PageLayouts" RootWebOnly="TRUE">
        <File Url="ArticleLeft.aspx" Type="GhostableInLibrary">
            <Property Name="ContentType" Value="$Resources:cmscore,contenttype_pagelayout_name;" />
share|improve this answer

I've also found an answer. Through saving a library as a site template and then importing it in Visual Studio. Also the content types fields are possible to set with the elements, which was a valuable lesson.

share|improve this answer

Your Answer


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.