Last updated May 30, 2014. Created on April 18, 2010.
Edited by er.pushpinderrana, adellefrank, LeeHunter, Kristi Wachter. Log in to edit this page.

  1. Navigate to the Content types page (Administer > Structure > Content types).
  2. In the table, locate the row that contains your content type and click the MANAGE FIELDS link. If you can't find the MANAGE FIELDS link, be sure to enable the Field UI module.
  3. Adding a new field

  4. In the Add new field section, enter a label for the field.
  5. In the Field name field, enter the machine name for the field. You can only use numbers, lower-case letters and the underscore character (_).
  6. In the field type list, select one of the following types:
    short text such as a name (limited to 255 characters)
    Long text
    long, multi-line alphanumeric text such as a biography
    has one of two values (for example: "yes/no" or "true/false" or "small/large")
    List (text)
    select from a list of text options (which can be formatted as either a drop-down list or checkboxes)
    reference to a file (such as a PDF) on the Drupal file system
    reference to an image file such as GIF, JPG, PNG on the Drupal file system
    Term reference
    reference id to an existing Taxonomy Term (or tag)
    a whole number, such as a year (e.g. 2012) or value (e.g. 1, 2, 5, 305); it does not allow decimals.
    a number that can use decimals, such as 0.0123456789
    a number that allows exact decimal values; often used for price or cost (such as $199.99)
    List (float)
    select from a drop-down list of floats
    List (integer)
    select from a drop-down list of integers
    Long text and summary
    same as long text, but with an additional summary text
  7. Select Field

  8. In the Widget field, select a widget. The options vary depending on the field type.
  9. Select Widget type

  10. Click Save.

Note: Not all field types are provided by Drupal core. Things like References, Dates, Links, and various other types can be found by filtering on "field" in the module list on (or "Content Construction Kit" for Drupal 6). Users of the CCK module in Drupal 6 should note that the node reference and user reference fields are not supported in Drupal 7 core; however, there is a separate References module that provides support for these fields in Drupal 7. In Drupal 7 Entity reference is a good option to use for references because in Drupal 7 most of things in core are managed through entity.

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


Deg’s picture

If you can't find the "manage fields" link, be sure to enable the Field UI module.

wayne57’s picture

I want to add an integer field, but the only option is List(integer), which is not what I need.
This present two wigets, list/checboxes, but I just want an input field for numbers.
Any help?

afinnarn’s picture

As of 7.36, there are both "Integer" and "List (Integer)" fields in core. Choose the first "Integer" field to have a text box appear where you can input an integer.

philsward’s picture

Where can a person find the explanation of the different field types:

List (numeric)
List (text)
Long text
Long text and summary
Term reference

joachim’s picture

Good question!

I for one have no idea what the difference is between 'decimal' and 'float'.

spovlot’s picture

  • Boolean - Values: yes/no or true/false
  • Decimal - Values: numeric value with specific precision and scale (numbers after the decimal point) such as precision 10 and scale 2 for 9,999,999,999.99. Often used for price or cost ($199.99)
  • File - Value: A reference to a file on the Drupal File System
  • Float - Value: An approximate floating point representation of a real number such as 0.0123456789
  • Image - Value: A reference to an image file such as GIF, JPG, PNG on the Drupal File System
  • Integer - Value: A whole number such as 0, 1, 2, 3, 4, 5
  • List (float) - Select from a list of floats
  • List (integer) - Select from a list of integers
  • List (text) - Select from a list of text
  • Long text - Value: Long multi-line alphanumeric text such as long description or biography
  • Long text and summary - Value: Same as long text with an additional summary text
  • Term reference - Value: Reference id to an existing Taxonomy Term
  • Text - Value: Short text such as name or street address
waynemichel’s picture

I have a checkbox field and in Manage Display, I have format options of default or key. What is "key"?

philsward’s picture

With checkboxes, you can setup a "key|checkbox name". (the | is the "pipe" symbol usually found on the same key as the "\") It might be seen as a pain, but opens up other doors if you know how to use them right. But let's say you have the following checkbox list:


When you create a field with checkboxes, you have to create a "key|value" for each list item. The cool thing is though, the key can be anything (from what I can tell) so for example, you could use a number sequence for the key:


Using a number sequence is fine for a handful of items, but when you start getting a big list and have to re-order them, it can be a butt. Instead, you could use the value as the key like so:


So, to answer your question, when it asks if you want to display the "Key" or the "Default", the default would be the actual value itself, and the key is... well, the key. Like I said before, there might be times when you want the key to show up instead of the value. For example you want to apply an image to 3 radio buttons, but you don't want the image to show up on the teaser, only on the full node page itself. You would set the teaser to show the "key" and the full node to show the "default". Here's an example that might help:

In Stock|This is in stock <img src="instock.jpg" />
Out Of Stock|This is out of stock <img src="outofstock.jpg" />
On Order|We are ordering more <img src="onorder.jpg" />

When you view the teaser it will show: In Stock
When you view the full node it will show: This is in stock (and the image)

Hope that helps!

kalki2013’s picture

How to add a field collection to a content type programmatically?

afinnarn’s picture

Here's a post to explain....

abart83’s picture

i want to create a list of images , where user can select an image option, how can i achieve this?
and i don't want to show text along with image in final post after publishing, i just need image.. please advise

afinnarn’s picture

With the Views module you could add the list of images, control display of text, and allow the user to select images. You will probably have to do some custom work, but I would start your search with views in mind.

markbannister’s picture

It can be very important to give unique machine names to custom fields (custom content of any type actually).
Always use some sort of prefix on the name such as field_myPrefix_fieldname. While using a generic field machine name might not give you an issue today, it can very well cause problems when you add or update modules. There is no easy fix for this once there is a conflict.