Home > features, file, module, provision, SharePoint > Provision a File in SharePoint using Features

Provision a File in SharePoint using Features


Modules are defined in an element manifest similarly to how they are defined in an Onet.xml file to specify files with which to provision SharePoint sites. This type of feature element can be used to:

  • Add pages to a web site
  • Add web parts to a web site’s web part gallery
  • Add web parts to a web part page
  • Add documents to a document library
  • Add style sheets to the a web sites style library
Let us look at a sample feature.xml and elements.xml used to provision master page,document,web part and stylesheet
Feature.xml
<Feature Id="947F6C32-E898-45f5-A595-C46F07DA6BF7"
Title="Module Provisioning Files"
Scope="Web"
xmlns="http://schemas.microsoft.com/sharepoint/">




Elements.xml














<File Path="CustomWebPart\CustomWebPart.webpart"
Url="CustomWebPart.webpart"
Type="GhostableInLibrary" />








  1. No comments yet.
  1. No trackbacks yet.

Leave a comment