Use module to customize website Definitions)

Source: Internet
Author: User
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,

  1. 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.

  2. 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:
    • Create a module
      To add a module, you can create a module sub-element under project/deployments/configuration/modules in ONet. XML, for example:
      <Modules>
        <Module Name="Default" />
        <Module Name="NewMd" />
      </Modules>
    • To change the attributes of this module, create a module element under the project/modules element. The path attribute specifies the relative path of the folder corresponding to this module (relative to this ONet. the URL attribute specifies the path to access the website on the webpage. In addition, the rootwebonly attribute specifies whether the module is available only on the Root website. For example:
      <Module Name="NewWd" Url="_New" Path="New/">
      <Module />
    • Add a file and add the file element under the module element, as shown in the preceding figure.

The method described above can help us define our own website definitions.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.