SharePoint [site definition series]-01. Create site columns

Source: Internet
Author: User

Site columns is an important underlying structure of a Sharepoint website. It is a reusable column definition or template that can be assigned to one or more lists of one or more SharePoint websites.

A site column is defined by several attributes, including names and field types. For example, the name of the column "title" is "title" and the field type is "text.

In Sharepoint, we can view the system's site columns through the management interface. We can enter the management interface through the site setting of the corresponding site collection, and enter the corresponding management interface through sitecolumns in galleries.

When adding site columns to the list or content type, you can set its function definition, such as whether it is required, whether it is read-only or hidden.

The advantage of using site column is to reduce repetitive work and maintain the consistency of metadata (metadata) on the entire site collection.

We can perform silly operations on the ingress poin website interface, through site actions> site Settings> modify all site settings. Then in galleries> site columns, click Create button. However, this method is not professional enough. If you want to deploy it from the development machine to the server, you need to perform this step again on the server. Therefore, it is smart to develop feature through vs2010 to create site columns.

Here we use vs2010 to create a simple site column: cameral used. This site column will be applied to the creation of content type next to us.

Open vs2010 and create a new SharePoint project named mysitecolumproject. For example

In the following prompt box, select this solution as farm mode.

The newly created empty project is as follows:

Add a new empty element to this empty project and name it sitecolumns.

There is an elements element in elements. xml of sitecolumns. Under this element, we can add many elements. Here, the element is the site column we refer. In this example, add the following code:

In the above Code:

IDWe need to specify that we can use the guid tool to obtain:

Note that braces cannot be ignored on the field guid. Otherwise, the deployment will fail.

NameThe name we specified for this site column.

TypeIs the field type used by this site column. we specify it as text here. It can also be of the following type:

• Single line of text
• Multiple lines of text
• Choice (menu to choose from)
• Number (1, 1.0, 100)
• Currency ($, ¥ ,)
• Date and Time
• Lookup (looks up values from a list already on the site)
• Yes/No (check box)
• Person or group
• Hyperlink or picture
• Calculated (calculation based on other columns)

GroupAttribute refers to the site column group to which the user adds the new site column. In this example, we set this attribute to extended column.

DisplaynameWe can see the name displayed in this site column on the SharePoint UI.

Next we build and deploy this solution, and then go to the SharePoint site to view it. We can see that this site column has already appeared in the expected position.

 

Reprinted: http://www.cnblogs.com/wsdj-ITtech/archive/2012/08/12/2470219.html

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.