List and content type in SharePoint

Source: Internet
Author: User

Create custom list elements


Use the user interface to create a list. You can use the site Action menu to navigate to create-> customer lists. the form on the new page uses the custom list type to start the creation of an empty list. In the custom list type, there is no columns (fields) that can be edited except the title ). after creating the list, you can select create column under the settings menu to add a new standard WSS field type. A field type is a data type that can be used to store data in WSS. it is similar to the data type of SQL (in fact it is defined by SQL data type). Of course, you can also create your own field type. the following table shows the default WSS field type on the create column page.


Field Type


Single line of text

Single line text. The maximum number of characters allowed can be customized.

Multiple lines of text

Plain text, Rich Text (bold, italic, text alignment), or text boxes that enhance Rich Text (images, tables, links. the rich text box displays a Rich Text toolbar in editing mode.


Option bar for multiple items you define


Value. Options include minimum, maximum, and decimal places.


Monetary value in a specific currency format

Date and Time

Date information, or date and time information


Reference Field for the value of another website list Field


A real or false Boolean field. It is displayed as a check box on the user interface.

Person or group

A user or member of the current site. This domain can also display online or offline information. Here, online refers to Windows Live Messenger or office Live Communications Server.

Hyperlink or picture

String in URL format


Value calculated from other domains


Use caml to define custom list elements


Now we need to step through the process of defining site column, content type, and list schema. if you want to follow our sample code, you can open the project named litwaretypes in. this project contains several examples of custom provisioning components. if you open and build this project, install. the bat file copies all required files to the templates directory and installs a feature called litwaretypes. then you can interact with litwaretypes feature within the scope of any site set.

WSS provision components uses caml and HTML to define data schema. the structure of most caml elements used in WSS is defined in the XML schema file under the template \ XML directory. you can copy these XSD files to % ProgramFiles % \ Microsoft Visual Studio 8 \ XML \ schemas, and then you can use intelliisense in vs2005. note that caml requires a little skill in programming and a little support for debugging. Therefore, testing is critical.

Debug caml through diagnostic Logging

The definition of caml content is not supported by debugging in Visual Studio. this makes development of custom content type, lists, and other provisioning components very frustrating. however, you can enable verbose logging on the central administration site.

Although the web interface may be the only place where a fuzzy error message is displayed, similar to "exception from hresult: 0x81070201, "But the diagnostic log will tell you the details you need to fix the XML file, like this:" failed to retrieve the List Schema for feature FBDECD96-62DC-48c88F0A-7B827A042FD9, list template 10001; expected to find it at: C: \ Program Files \ common files \ microsoft shared \ Web Server Extensions \ 12 \ template \ Features \ litwaretypes \ vendorlist."


Tip: Visual Studio 2005 extensions for Windows SharePoint Services 3.0 is a powerful tool for generating lightweight provisioning components. you can use it as the starting point for manual provisioning component. however, some feature introduced by wss3.0 are not supported.


Define site column Definition


List stores their data in columns (also known as filelds). columns can be defined in the context of list. WSS 3.0 also introduced site columns, which allows us to define a field in a reusable way. in order not to define a field called first name for many times. WSS can define site column once in a feature called fields. the following code demonstrates how firstname site column is defined in a field element using caml.

<Field ID="{}"    Name="FirstName"    SourceID=""    StaticName="FirstName"    Group="$Resources:Person_Event_Columns"    DisplayName="$Resources:core,First_Name;"    Type="Text"></Field>

TIPS: the built-in columns are defined in feature: "fields". When you create your own column definition, this fields feature can be a good reference.

In the code above, you can see that the text-based part of firstname site column is defined using a special syntax with the "$" character, such as: $ resources: core, first_name. the syntax is in ASP. NET 2.0, which is a way to help us get the localized string from a resource file. this localization capability for site column definition enables WSS 3.0 to Support the provision component of different language versions in multiple different languages.Inside Microsoft Windows SharePoint Services 3.0This topic is detailed in chapter 9.

As a simple example, we will create a vendor list with the following columns: Company, contact, phone, industry, company size, and activity notes. we will use the pre-defined columns of WSS to configure company, contact, and phone. then, we will create two new site column definition for the industry and activity notes.

The litwaretypes project contains a custom feature called litwaretypes. you can use it in feature. XML. the following code is. the scope defined by this feature is site, which means it is designed to be activated at the site set level.

Custom column Definitions

<?xml version="1.0" encoding="utf-8"?><!-- Litware Column Types --><Elements xmlns="">  <Field      ID="{}"      Name="Industry"      DisplayName="Industry"      Type="Choice"      Format="RadioButtons"      Group="Litware Columns">    <CHOICES>      <CHOICE>High Tech</CHOICE>      <CHOICE>Legal</CHOICE>      <CHOICE>Medical</CHOICE>    </CHOICES>    <Default>High Tech</Default>  </Field>  <Field      ID="{}"      Type="Note"      RichText="TRUE"      AppendOnly="TRUE"      Name="ActivityNotes"      DisplayName="Activity Notes"      Sortable="FALSE"      SourceID=""      Group="Litware Columns">  </Field></Elements>


The industry site column definition is based on choice field type and provides three different options for value assignment. the industry site column deninition is also specified to use the radiobuttons Method for rendering, which is specified in the format attribute.

Activitynotes site column definition is based on the notes field type, which allows users to belong to a large amount of text information and can span multiple lines. note that this site column definition is also defined as support for Rich Text and append-only behavior introduced by wss3.0.Note: versioning must be enabled for any list containing append-only site column to make the append-only behavior work properly.

Now you have seen how to create site column definition. Let's see how to make them appear on the WSS site. Each site hasSite Column Gallery. After litwaretypes feature is activated in a site collection, our custom site column definitions will appear in the site columns Gallery of the top-level site. you can use the built-in mngfield. the application page of aspx is used to view what is included in the site columns gallery. You can click the link on the site settings page to enter. shows an example of the added site columns.


Note: after the site column is added to the site Column Gallery, you can use it in the current site and all its subsites. therefore, adding the site column to the site Column Gallery of the top-level site will allow the entire site set to use this column. this provides a strong motivation to add site column definition through the feature of the site set scope instead of the feature of the site scope,

After the site column definitions is added to the site, you can immediately use them when adding columns to the list. An example of adding a new column is provided:


If you create a custom list and add the columns "industry" and "activitynotes", you can test their behaviors. The example is as follows:



Translated from:

Inside Microsoft Windows SharePoint Services 3.0 Chapter 6

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