Content types

Last modified: July 1, 2009 - 13:58

A single web site could contain many types of content, such as informational pages, news items, polls, blog posts, real estate listings, etc. In Drupal, each item of content is called a node, and each node belongs to a single content type, which defines various default settings for nodes of that type, such as whether the node is published automatically and whether comments are permitted. (Note that in previous versions of Drupal, content types were known as node types.)

When you first install Drupal with the default installation profile, you will have two content types defined: "Page" and "Story". When you enable other core and contributed modules (by visiting Administer >> Site Building >> Modules), you will find that you have other content types available; you can also create your own content types (see below). Here is a list of the content types associated with core Drupal modules:

Blog Entry
A Blog (short for weblog) is an online journal or diary, and the core Blog module allows registered users on your site to create their own blogs. Each entry in a user blog has content type Blog Entry.
Book Page
Book pages are designed to be part of a collaborative book, enabled by the core Book module. An example of a collaborative book is the Drupal developer documentation. In older versions of Drupal, only nodes of content type Book Page could be added to a book, but now nodes of any content type can be part of a book.
Comment
Comments actually aren't nodes, so Comment is technically not a "content type". Enabling the Comment module allows site visitors to add comments (typically short notes and replies to other comments) to nodes on the site.
Forum
A Forum node defines a topic for a forum discussion; people can reply to the topic by using comments. Forum nodes are organized into subject areas via a Taxonomy (list of categories).
Page
The Page content type is enabled in Drupal in the default installation profile. Typically Pages are used for static content that can (but are not required to) be linked into the main navigation bar.
Poll
A poll is where a multiple choice question is asked, and users can answer and see other people's answers to questions.
Story
The Story content type is enabled in Drupal in the default installation profile. Stories are generally used for information whose relevance decreases as time passes (such as news items), so that newer Stories will typically be placed higher on the page than older Stories.

In addition to these basic types, custom content types can also be created by going to Administer > Content > Content types > Add content type. You might do this as a way to organize your content -- for instance, you might have "Article" and "News flash" as two simple content types on your site, rather than just using "Story" for both.

If you want to add fields to your custom content types, install the Content Construction Kit (CCK) contributed module. Custom fields are used to store additional information beyond the Drupal defaults (title, body, authoring information, time created/updated, and publishing status); for instance, on a real estate site, a real estate listing content type might have fields for the type of property, land area, etc. Additional information on the CCK module is available from the Content Construction Kit Handbook.

Finally, some contributed modules define their own content types. Check the Contributed Modules page of the Drupal handbook for more information on locating an appropriate module for your needs.

 
 

Drupal is a registered trademark of Dries Buytaert.