Share via


BaseType Element

Every list in a Web site based on SharePoint Team Services from Microsoft inherits its schema from a base type. The BaseType element defines the default schema (for example, the fields) that all lists derived from the base type must contain.

Syntax

<BaseType
  Image = "URL"
  Title = "Text"
  Type = "Number">
</BaseType>

Attributes

Name Description
Image Sets the image used by a list base type in the Lists page (_layouts/viewlsts.htm). However, all team Web site server templates (such as for announcements, events, etc.) provide their own images, so that in practice this attribute is never used.
Title The name of the base type.
Type Unique ID for the base type. The following values are possible for built-in base types:

0 Custom List
1 Document Library
2 not used
3 Discussion Forum
4 Surveys

Parent Elements Child Elements
BaseTypes MetaData

Remarks

The fields defined in a base type may not be deleted from a derived list without breaking the list (for example, a document library won't function without the file name column), although fields may be added to the list.

Example

This example, a section taken from the file ONET.XML in the web server extensions folder, defines the discussion forum base type, in other words, the fields that all discussion forums must have. You can create other discussion forums with additional fields; however, all discussion forums must include the fields defined in the following base type.

<BaseType Title="Discussion Forum" Image="_layouts/images/itdisc.gif" Type="3">
  <MetaData>
    <Fields>
      <Field ColName="tp_ID" Type="Counter" Name="ID" ReadOnly="TRUE" PrimaryKey="TRUE" DisplayName="ID"></Field>
      <Field ColName="tp_Title" Type="Text" Name="Title" DisplayName="Subject" Required="TRUE"></Field>
      <Field ColName="tp_Modified" ReadOnly="TRUE" Type="DateTime" Name="Modified" DisplayName="Modified" StorageTZ="TRUE"></Field>
      <Field ColName="tp_Created" ReadOnly="TRUE" Type="DateTime" Name="Created" DisplayName="Created" StorageTZ="TRUE"></Field>
      <Field ColName="tp_Author" ReadOnly="TRUE" Type="Lookup" List="UserInfo" Name="Author" DisplayName="Created By"></Field>
      <Field ColName="tp_Editor" ReadOnly="TRUE" Type="Lookup" List="UserInfo" Name="Editor" DisplayName="Modified By"></Field>
      <Field ColName="tp_Version" Hidden="TRUE" ReadOnly="TRUE" SetAs="owshiddenversion" Type="Integer" Name="owshiddenversion" DisplayName="owshiddenversion"></Field>
      <Field ColName="tp_Ordering" ReadOnly="TRUE" Name="Ordering" Type="Threading" DisplayName="Ordering"></Field>
      <Field ColName="tp_ThreadID" ReadOnly="TRUE" Name="ThreadID" Type="Guid" DisplayName="Thread ID"></Field>
      <Field ReadOnly="TRUE" Type="Computed" Name="Threading" DisplayName="Subject" DisplayNameSrcField="Title" AuthoringInfo="(threaded)">
        <FieldRefs>
          <FieldRef Name="Title"/>
          <FieldRef Name="ID"/>
          <FieldRef Name="Ordering"/>
          <FieldRef Name="ThreadID"/>
        </FieldRefs>
        <DisplayPattern>
          <HTML><![CDATA[
                    <table border=0 cellpadding=0 cellspacing=0><tr><td class="ms-vb">
                    <img border="0" height="1" width="]]>
          </HTML>
          <Length Sub='14'>
            <Column Name="Ordering"/>
          </Length>
          <HTML>" SRC="</HTML>
          <ImagesPath/>
          <HTML>
            <![CDATA[blank.gif"></td><td class="ms-vb"></td><td class="ms-vb"><img border="0" src="]]>
          </HTML>
          <ImagesPath/>
          <HTML><![CDATA[discbul.gif">&nbsp;</td><td class="ms-vb">]]></HTML>
          <IfEqual>
            <Expr1>
              <GetVar Name="SelectedID"/>
            </Expr1>
            <Expr2>
              <Field Name="ID"/>
            </Expr2>
            <Then>
              <HTML><![CDATA[<b>]]></HTML>
              <Column HTMLEncode="TRUE" Name="Title"/>
              <HTML><![CDATA[</b>]]></HTML>
            </Then>
            <Else>
         <HTML><![CDATA[<a href="]]></HTML>
         <URL/>
         <HTML><![CDATA[" ONCLICK="javascript:DisplayItem(']]></HTML>
         <URL/>
         <HTML><![CDATA[');javascript:return false;" target="_self">]]></HTML>
         <Column HTMLEncode='TRUE' Name='Title' Default='(no title)'/>
         <HTML><![CDATA[</a>]]></HTML>
            </Else>
          </IfEqual>
          <IfNew>
            <HTML><![CDATA[<IMG SRC="]]></HTML>
            <ImagesPath/>
            <HTML><![CDATA[newlink.gif" alt="]]></HTML>
            <HTML>New</HTML>
            <HTML><![CDATA[">]]></HTML>
          </IfNew>
          <HTML><![CDATA[</td></tr></table>]]></HTML>
        </DisplayPattern>
      </Field>
      <Field ColName="tp_Body" Name="Body" Type="Note" DisplayName="Text" Sortable="FALSE" NumLines="10"></Field>
      <Field ReadOnly="TRUE" Type="Computed" Name="Edit" Sortable="FALSE" DisplayName="Edit" AuthoringInfo="(link to edit item)">
        <FieldRefs/>
        <DisplayPattern>
          <HTML><![CDATA[<a href="]]></HTML>
          <URL Cmd="Edit"/>
          <HTML><![CDATA[" ONCLICK="javascript:DisplayItem(']]></HTML>
          <URL Cmd="Edit"/>
          <HTML><![CDATA[', false);javascript:return false;" target="_self">]]></HTML>
          <HTML><![CDATA[<img border="0" alt="]]></HTML>
          <HTML>Edit</HTML><HTML><![CDATA[" src="]]></HTML>
          <ImagesPath/>
          <HTML><![CDATA[edititem.gif">]]></HTML>
          <HTML><![CDATA[</a>]]></HTML>
        </DisplayPattern>
      </Field>
    </Fields>
    <Default>
      <View BaseViewID="1">discuss\AllItems.htm</View>
      <Forms>
        <Form Type="DisplayForm" Url="discuss\DispForm.htm"/>
        <Form Type="EditForm" Url="discuss\EditForm.htm"/>
        <Form Type="NewForm" Url="discuss\NewForm.htm"/>
      </Forms>
    </Default>
  </MetaData>
</BaseType>