Custome Site Columns and Content Query Web Part

(Notes taken from Sahil Malik’s book, Chapter 6)

To create a new content type, open your site, Site Actions Site Actions Gallary Site Content Types.

Click Create (top) to create a new content type. Enter “Animal zoo” as name, and select List Content Types and Item. Also create a new group called Zoo.

A new content type is created:

Now we want to create a site column. Go to Site Actions Site Settings Gallery Site Columns. Click Create to create a new site column. (one site column can be used acroos multiple content types). Fill out the form : Is meat Eatsre, checkbox, in a new site column group “Zoo”. (Site column group “Zoo” is different from content type group “Zoo”)

Go back to content type “Zoo Animal”, and click Add From Existing Site Columns

And add the Is Meat Eater site column to this Zoo Animal content type.

Now Zoo Animal has two columns:

Now create a new list based on Custome List, and call it Sharepoint Zoo.

Now we want to update the content type of this list, so go to the Sharepoint Zoo lost, click List Settings Button (ribbon)
Advanced Settings, and select Yes to Allow management of content types?.

Now go to List settings page, and click Add from existing site content types and add Zoo Animal content type. In the end there are two content types assiciated with the Sharepoint Zoo list.

Two content type means when usr adds a new item, there are two kinds of new items that can be created:

If you don’t need the default “Item” content type, you can delete it, or simply hide it —


***** On a side Note: To use the Content Query Web Part, (in Content Roolup category), you need to (1) activate the SharePoint Server Publishing Infrastructure at the site collection level and (2) activate the SharePoint Server Publishing at the site level.

Go to the home page, and add a Content Query Web Part. Edit the web part to let it display ******

After that this displays on the home page:

Field type: When you create a custom site column, you select from a radio button list of “field types”, such as “single line of text”, “date and time”… etc.

You can create your own field type, which is called custom field type.

Writing a custom field type requires you to deploy a file at SharePointRoot\Template\XML

 

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: