Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
SDK Documentation
General Reference
Reference
Site Schema
M-Z
 Module Element

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
Module Element (Site)

Specifies files with which to provision SharePoint sites within an Onet.xml file.

<Module>
  IncludeFolders = "Text"
  List = "Integer"
  Name = "Text"
  Path = "Text"
  RootWebOnly = "TRUE" | "FALSE"
  SetupPath = "Text"
  Url = "Text"
</Module>
Attribute Description

IncludeFolders

Optional Text.

List

Optional Integer. Specifies the type of list, which is defined within Onet.xml.

Name

Required Text. Contains the name of the file set. Can only contain the following characters:

  • alphanumeric

  • hyphen (-)

  • underscore (_)

  • period (.)

  • space ( )

Path

Optional Text. Specifies the physical path to the file set relative to \\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\Site_Definition. Can only contain the following characters:

  • alphanumeric

  • hyphen (-)

  • underscore (_)

  • period (.)

  • space ( )

RootWebOnly

Optional Boolean. TRUE if the files specified in the module are installed only in the top-level Web site of the site collection.

SetupPath

Optional Text. Specifies the physical path to a folder in the Windows SharePoint Services setup directory (\\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE) that contains a file to include in the module. Can only contain the following characters:

  • alphanumeric

  • hyphen (-)

  • underscore (_)

  • period (.)

  • space ( )

Url

Optional Text. Specifies the virtual path of the folder in which to place the files when a site is instantiated. If Path is not specified, the value of Url is used for the physical path. Use the Url attribute to provision a folder through the site definition.

The Url attribute cannot contain the following characters:

  • \"

  • #

  • %

  • &

  • *

  • :

  • <

  • >

  • ?

  • \\

  • {

  • }

  • |

  • ~

  • \x7f

Minimum: 0

Maximum: Unbounded

The Module element specifies a file or collection of files and a location where the files are installed during site creation. If the file is a Web Part Page, the module definition can specify which Web Parts should be included on the page.

The following example from Onet.xml defines the views and files to include within a module.

Xml
<Module Name="Default" Url="" Path="">
  <File Url="default.aspx" NavBarHome="True">
    <View List="$Resources:core,lists_Folder;/$Resources:core,announce_Folder;" BaseViewID="0" WebPartZoneID="Left" />
    <View List="$Resources:core,lists_Folder;/$Resources:core,calendar_Folder;" BaseViewID="0" RecurrenceRowset="TRUE" WebPartZoneID="Left" WebPartOrder="2" />
    <AllUsersWebPart WebPartZoneID="Right" WebPartOrder="1"><![CDATA[
      <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" xmlns:iwp="http://schemas.microsoft.com/WebPart/v2/Image">
        <Assembly>Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
        <TypeName>Microsoft.SharePoint.WebPartPages.ImageWebPart
        </TypeName>
        <FrameType>None</FrameType>
        <Title>$Resources:wp_SiteImage;</Title>
                        <iwp:ImageLink>/_layouts/images/homepage.gif</iwp:ImageLink>
      </WebPart>
    ]]></AllUsersWebPart>
    <View List="$Resources:core,lists_Folder;/$Resources:core,links_Folder;" BaseViewID="0" WebPartZoneID="Right" WebPartOrder="2" />
    <NavBarPage Name="$Resources:core,nav_Home;" ID="1002" Position="Start" />
    <NavBarPage Name="$Resources:core,nav_Home;" ID="0" Position="Start" />
  </File>
</Module>

Other Resources

How to: Provision a File

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Re. SetupPath      Biilmann   |   Edit   |   Show History

There is an error here:

SetupPath can contain the backslash ("\") character as well. Useful if you want to point to a sub-directory in your SetupPath, e.g.

<Module Name="MyCustomMasterPage" Url="_catalogs/masterpage" SetupPath="FEATURES\MyMasterPageFeature">
  <File Url="CustomMaster.master" Type="GhostableInLibrary" />
</Module>
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker