Module Element

Module Element (Site)

Last modified: July 15, 2011

Applies to: SharePoint Foundation 2013 | SharePoint Server 2013

In this article
Child Elements
Parent Elements

Specifies files and "all user" Web Parts with which to provision a Web site.

  HyperlinkBaseUrl = "Text"
  IncludeFolders = "Text"
  List = "Integer"
  Name = "Text"
  Path = "Text"
  RootWebOnly = "TRUE" | "FALSE"
  SetupPath = "Text"
  Url = "Text"




Optional Text.


Optional Text.


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


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

  • alphanumeric

  • hyphen (-)

  • underscore (_)

  • period (.)

  • space ( )


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

  • alphanumeric

  • hyphen (-)

  • underscore (_)

  • period (.)

  • space ( )


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


Optional Text. Specifies the physical path to a folder in the SharePoint Foundation setup directory %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE) that contains a file to include in the module. Can only contain the following characters:

  • alphanumeric

  • hyphen (-)

  • underscore (_)

  • period (.)

  • space ( )


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

A detailed Module element appears in a Modules element directly under the Project element of an Onet.xml file. Each such module is referenced by at least one other Module element that is in a Configuration element of the same file.

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.

<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="" xmlns:iwp="">
        <Assembly>Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
    <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" />
© 2015 Microsoft