Skip to Content

How to create a new content type with CCK

[Note this only applies to Drupal 5. CCK, the Drupal contrib module which allows you to create new content types, is also available for Drupal 4.7 but the location of menu items, where to click, etc. is slightly different.]

FAQ stands for frequently answered questions. In this How To, we will create a content type for an individual FAQ. There are many approaches to this. For this example, the FAQ content type that we will create has a Title field (which which will double as a Question field) and a Answer field.

How to create a FAQ content type with CCK

  1. Enable the content module: administer » modules (under "Site Building" in the middle) » check "Content" module » scroll down and click on "Save configuration"
  2. Create your FAQ type:
    1. administer » "Content types" in the middle » "Add content type" tab
    2. For Type, enter "faq", for Name enter "Frequently asked question ", for Title field label, enter "Short Question Title", uncheck "Promoted to front page", check "disabled" under "Default comment setting" and "Attachments", remove the text from "Body field label" since we don't need the body field for the question and then click "Save content type"
    3. Add the "Answer" Field:
      1. Click "edit" in the "Frequently Asked Question" row and then the "Add field" tab
      2. enter "Answer" under Label » for "Field Type", select "Text Field" under Text » click "Create field"
      3. Under "Label" enter "Answer". Under "Text" check "Text Field" and then click "Create field"
    4. To give 15 lines of text for your answer: Under Rows" change "1" to "15" and check "Required" and then click "Save field settings".
    5. Make the Answer field go on the bottom by making its weight "heavier" (so that the answer is below the question!): Select a weight of "1" in the "Answer" row and click "Update"

Screencast

This is better explained with the following screencast (original 800x600 11.1MB MPEG-4 file, lower quality flash video):

What's next?

Now you have a custom content type that you can use to create your own FAQs. What's next? Well, for this example (and many other situations where you create custom content types) you would want to display your content. In our example, we would want a list of questions and answers. This is typically done through a View. Check out our follow-up screencast of how to create a View for this FAQ content type.

Comments

Hello Sir

Hello Sir, I need your assistance in create a custo Content type CCK for my site whick is directory.
Can you send me your im details to deva.indra [at] gmail.com Please help me out sir.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.