WSS3SDK Create a custom list definition by feature

Source: Internet
Author: User
Tags definition command line visual studio

This task will show you how to create a feature for a custom list template and add it to the available list templates that you can select in the Create page. Adding a custom list definition requires that you provide the following 3 files:

Feature.xml is used to register a list template.

Elements.xml Add a list template to the Create page.

Schema.xml defines the schema of the list, which content types are associated with, the definitions of fields and views, references to forms and toolbars, and so on.

Steps

Create a folder under Local_drive:\program Files\Common Files\Microsoft Shared\Web server Extensions\12\templates\features. Have a proper name, like Simplelistfeature.

Create a Ifeature.xml file in the new folder, specify the title, ID, and feature scope, as well as the location of the Elements.xml file, as follows:

<Feature Title="Simple List Feature" Id="GUID" Scope="Web" xmlns="http://schemas.microsoft.com/sharepoint/">
<ElementManifests>
<ElementManifest Location="Elements.xml" />
</ElementManifests>
</Feature>

Replaces the above GUID placeholder with the newly created GUID. You can get a new GUID by running Guidgen.exe, which is located under local_drive:\program Files\Microsoft Visual Studio 8\Common7\Tools.

Create a Elements.xml file in the new folder to identify the list template and specify the information it displays on the creation page. Give it a type value greater than 10000, and do not have the same values as other custom list definitions.

<Elements>
<ListTemplate Name="SimpleList" DisplayName="Simple List" Type="10001"
Description="This is my simple list." BaseType="0" OnQuickLaunch="FALSE" SecurityBits="11" />
</Elements>

Create a subfolder with the same name as the one previously assigned to the list template, such as SimpleList.

Create a new Schema.xml file in the subfolder to define the list.

On the command line, enter the following command to install and activate the feature on a specific subsite.

a. stsadm -o installfeature -filename SimpleListFeature\Feature.xml
b. stsadm -o activatefeature -name SimpleListFeature -url http://Server/Site/Subsite

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.