Last updated July 20, 2009. Created on July 26, 2007.
Edited by add1sun, Senpai, KarenS. Log in to edit this page.

Go to Administer > Content Management > Content Types (admin/content/types) where you will see a list of content types that are available.. There are a couple included as a part of a standard Drupal installation, and you can use one of them or add a new content type of your own. For our example, let's add some fields to the 'story' content type.

Choose the option to 'edit' the 'story' type. Once you get to the screen where you can edit the content type, you will see additional tabs that say 'Manage fields', 'Display fields', and 'Add new field'. If you choose 'Manage fields' or 'Display fields' you will see nothing, since you have not yet created any fields, so start by selecting the option 'Add new field'.

On the 'Add new field' screen you will be asked for a name for the field. You can type anything here, including spaces, but whatever you type here will be used to create the actual field name that is used in the database. If you type 'My Text', the actual field name will become field_my_text. You'll use that field name later if you want to do any custom themeing. Note that the machine name of the field cannot be changed later!

Below the field name you will see a list of the fields that are available. The core fields are 'Text', 'Integer', 'Decimal', 'Nodereference', and 'Userreference'. Those are the types of content you can create with those fields. The 'Text' field will create content that is stored in the database as text. The 'Integer' and 'Decimal' fields create content that is stored in the database as numbers. Nodereference and Userreference store either the node or user ids in the database to allow you to link to those node or user records.

Under each type of field are several options for the way the data will be input for this field (CCK calls these 'widgets'). They control the way the input form will look for this field. The available options are different for each field, but include things like a text field, which is a blank box where a user can type text, auto-complete fields where a user can type text and the system will try to complete the text for them from values available in the database, select lists, checkboxes, and radios.

The screen will look like:

Start with something easy, a 'Text' field with a text field widget, by selecting 'Text' >> 'Text Field'.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.

Comments

candelas’s picture

since i show many issues asking for this and i found a solution, i think it is a good idea to put it as a part of the documentation :)

For making cck check box field with label and default value,tricky way is there.You must pass ‘Allowed values list:’ as a key value pair separated with ‘|’.

eg:1|label

2|label

Then it shows proper label when editing the story.

the first has the value selected/on and the second unselected/off.

//trying to answer one question for each one that i make.
//this way, drupal will be more friendly and strong

jhodgdon’s picture

Someone reported some problems with this page here:
http://drupal.org/node/1563598