Core Field Types

In this unit

  • we provide an overview of the core field types you can choose from when adding fields to an entity type.

General

Boolean

Lets you store a boolean value (1 or 0), typically represented with a yes/no checkbox.

Comments

Enables commenting functionality.

Date

Lets you specify a date with an optional time component, and an optional end date. You can choose between a calendar pop-up or select lists for date/time selection. Lets you configure relative dates (such as "current date + 1 day") as default value.

Timestamp

Similar to date fields, but stores the value in UNIX time format instead of as a date. Lets you specify a specific date as default value. Used much less frequently than Date fields.

Email

Lets you add an email address in a text box. Makes sure the entered value is a valid email address. Can display the value as a mailto: link.

Link

Lets you add an internal or external hyperlink. Can display the value as a link or as a plain text URL.

Number

List (float)

Lets you offer a list of predefined floating point numbers (such as 3.14 and 99.99).

List (integer)

Lets you offer a list of predefined integer numbers (such as 3 and 99).

Number (decimal)

Lets users enter a decimal number (such as 3.1415927 and 99.999997).

This field is similar to fields that represent floating point numbers, but decimal fields let you specify the Precision (total number of digits to store in the database, including those to the right of the decimal) and Scale (the number of digits to the right of the decimal).

Number (float)

Lets users enter a floating point value.

Number (integer)

Lets users enter an integer number.

Reference

Reference fields let you reference (point to) Drupal entities such as content (nodes), custom blocks, categories (taxonomy terms), users, images, etc.

You can decide for each field whether users can only reference existing entities, or create the target entities on the fly.

The selection widget offered is usually an autocomplete field where users start typing the label / title of the target entity to get a list of matches to choose from.

Content

Lets users reference other nodes. Often used to build lists of related/similar content items.

Taxonomy

Lets users reference taxonomy terms.

User

Lets users reference user accounts.

File

Lets users reference (and upload) files. Oftent used for letting editors attach office documents and PDFs to nodes.

Image

Lets users reference (and upload) images.

Text

List (text)

Lets you offer a list of predefined text values.

Text (formatted)

Lets users input a short text value and use any available text format.
The input widget is a basic input field with text format selection.

Text (formatted, long)

Lets users input a long, formatted text value.
The input widget is a textarea with a rich text editor and text format selection.

Text (formatted, long, with summary)

Lets users input a long, formatted text value and, if they want to, a summary.
The input widget is a textarea with a rich text editor and text format selection.

Text (plain)

Lets users input a short, unformatted text value.
The input widget is a basic input field without rich text editor.

Text (plain, long)

Lets users input a long, unformatted text value.
The input widget is a basic textarea without rich text editor.