Adding Columns
Adding columns to the content type defines the
metadata that will be available for SharePoint
lists and the document information panel. Creating
a column is similar to creating a content
type and can be done at either the site level or
the list level.
For our letter content type, we’ll add an
existing column and create a few new columns.
To add the existing column, simply click Add
from existing site columns on the Site Content
Types page. You’ll then see a list of all available
columns that you can add to the content type.
To create a new site column, click Add from
new site column. This selection will bring up
the New Site Column creation form, which Web
Figure 2 shows. On this form, you can enter the
Column name (e.g., Letter Date) and the type of
information (e.g., Date and Time). The data type
you select determines the other options that
will be presented. After you’ve customized the
content type, you’re ready to associate it with a
document library.
Associating a Content Type with a
SharePoint Document Library
Because we created the content type on the
site level, we have to associate
it with a list. Thinking back to
the Sales Document Library we
looked at earlier, the sales team
has decided to start storing sales
letters in the same library. This
decision will help keep things
organized: Sales team members
can easily sort the library to
group letters and other contract
information without having to
create multiple folders.
When you go to the document
library settings, because content
types have already been enabled for this document library (you’ll
see how to enable content types
for a document library in the
Reusing a Content Type section
later in this article), you’ll
see a section called Content
Types, which shows the content
types currently available in the
document library, as well as
the option to add a new content
type. When you choose to select
a new content type, you’ll see a
form that lets you select from
available content types, as Web
Figure 3 shows. Select the desired content type
(e.g., Letter) and click Add. The new content
type will now be available as a selection in the
document library.
Now, when you open a new document based
on the content type, it will open with the designated
template and document information
panel, as Figure 5 shows. Notice that the document
contains the company letterhead and a
basic letter format with content controls (e.g.,
the Client content control that Figure 5 shows).
These content controls are linked to the document
information panel. So, if you were to add the
client’s name in the document, it would update in
the document information panel. If you were
to change the date in the information panel, it
would update in the document. Additionally, this
data will be available in the SharePoint list.
When you save the document back to the
library, the custom metadata columns for this
content type appear in the document library, as
Figure 6 shows. (I had to adjust the default view
to get the columns to appear. The columns are
available to the document library as soon as you
add the content type, but they must be selected
in the settings page for the view.) Note that in
this example, we chose to add the Letter site
content type directly to this list. You also could have created a child content type based on the
Letter content type, which would be useful if
you want to use the same template throughout
the organization but want different workflow
settings for different departments.
Reusing a Content Type
Reusing a content type is as simple as associating
it with another document library. For
example, you could create a new site for your
human resources department, with a document
library called HR Documents. Because this is a
new library, you must first enable management
of content types for the library, which you do
by opening the Document Library Advanced
Settings, and selecting Allow management of
content types, as Figure 7 shows.
After content types are enabled, you can
add the Letter content type using the procedure
described earlier. Again, you might choose to
create a child content type called HR Letter
at the list level. The advantage of using child
content types like this is that if the parent is
updated, all the children can be updated as
well. For example, if HR Letter and Sales Letter
are both children of Letter, and you want to
change the letterhead, you only need to update
the template for the Letter content type; the
template for HR Letter and Sales Letter will be
inherited from the parent.
Reaping the Benefits
Content types define schema for objects stored
in WSS 3.0, allowing you to both store the same
type of content in more than one list and to store
more than one type of content in the same list.
By using content types, you save yourself from
having to create multiple document libraries to
store data that might be better off stored in the
same place. With the ease of sorting information
in SharePoint, you’re much better off with a
library full of many types of documents than with
a whole bunch of libraries. Additionally, content
types save you from having to create settings
several times if you want to use the same type of
document in multiple locations.
End of Article
nmansour January 18, 2008 (Article Rating: