An article in The wss sdk describes how to use modules to add files to website definitions (you can search for using modules to add files to a site difinition in the http://msdn.microsoft.com ), however, a lot of things are just a little bit mentioned, but the specific operation is not mentioned.
In general, we can use the following method to use the module,
- Modify the default Module
The ONet. xml file in the STS website definition has a default module:<Modules>
<Module name = "default"/>
</Modules>The <File> sub-element is contained in <modules/Module name = "default">. We can add a new file element according to its format. For example:
<File Url="mslst.aspx">
<AllUsersWebPart WebPartOrder="1" WebPartZoneID="Body">
<![CDATA[
<WebPart xmlns="http://schemas.microsoft.com/WebPart/v2">
<Assembly>AssemblyName, Version=Version, Culture=neutral, PublicKeyToken=PublicKeyToken</Assembly>
<TypeName>TypeName</TypeName>
<Description></Description>
<FrameType>None</FrameType>
</WebPart>
]]>
</AllUsersWebPart>
</File>
<Alluserswebpart> is used to specify the Web Part in webpartzone on the page. Of course, if you do not need to specify a Web part, you do not need to use <alluserswebpart>.
Note that the URL attribute value of the <File> element in the preceding Sample Code specifies the path of this file in the website definition, it is also the path custom module for accessing this file on the website. Because the value of the path attribute of <Module name = "default"> is null, this file (mslst. aspx) path should also be under the root path defined by the website, and default. aspx is in the same directory.
- The default module cannot be used to add sub-directories (at least I have not tried it out. I don't know which expert has this experience). This is inconvenient. To add sub-directories, follow these steps:
The method described above can help us define our own website definitions.