Partager via


Module Element

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.

Syntax

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

Attributes

Name Description
List Optional Integer. Specifies the type of list, which is defined within ONET.XML.
Name Required Text. Contains the name of the module.
Path Optional Text. Contains the URL for the module.
RootWebOnly Optional Boolean. TRUE if the files specified in the module are installed only in the top-level Web site of the site collection.
Url Optional Text. Specifies the URL of the folder in which to place the files when a site is instantiated.

Element Relationships

Parent Elements Child Elements
Modules File

Example

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="104" BaseViewID="0" WebPartZoneID="Left"/>
      <View List="106" BaseViewID="0" 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=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
               <TypeName>Microsoft.SharePoint.WebPartPages.ImageWebPart</TypeName>
               <FrameType>None</FrameType>
               <Title>Site Image</Title>
               <iwp:ImageLink>/_layouts/images/homepage.gif</iwp:ImageLink>
            </WebPart>
          ]]>
      </AllUsersWebPart>
      <View List="103" BaseViewID="0" WebPartZoneID="Right" WebPartOrder="2"/>
      <NavBarPage Name="Home" ID="1002" Position="Start">  </NavBarPage>
      <NavBarPage Name="Home" ID="0" Position="Start">  </NavBarPage>
   </File>
</Module>