Creating List Definitions

Site definitions include definitions of the lists they contain. Creating a new list definition is more complex than creating a custom list template, so it is easiest if you start by copying an existing list definition, renaming, and modifying it. List definitions are found on the SharePoint server in the C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\1033\sitedef\LISTS folder, where sitedef is the folder containing the site definition.

To create a new list definition in a site definition:

  1. Copy and rename the folder containing an existing list definition.

  2. Modify the list definition. The key file to edit is Schema.xml.

  3. Edit the site definition file (ONet.xml) to include the new list definition.

  4. Restart SharePoint by running iisreset.exe.

  5. View a site based on the site definition and create a list based on the new list definition to make sure it works.

For example, to create a new list definition for the DotSites site definition:

  1. Copy the .\DotSites\LISTS\ANNOUNCEMENT folder and rename the new folder NewAnnouncements.

  2. Change the list definition Schema.xml file as summarized here:

        <?xml version="1.0" encoding="utf-8" ?>
        <List xmlns:ows="Microsoft SharePoint" Name="NewAnnouncements" Title="New Announcements" Direction="0" Url="Lists/NewAnnouncements" BaseType="0" > <MetaData> <Fields> <Field Type="Note" RichText="FALSE" Name="Author" DisplayName="Author" Sortable="TRUE" > </Field> <Field Type="Note" RichText="TRUE" Name="Body" DisplayName="Body" ...

Get Essential SharePoint now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.