In this unit
- we provide an overview of the core field types you can choose from when adding fields to an entity type.
General
Lets you store a boolean value (1 or 0), typically represented with a yes/no checkbox.
Enables commenting functionality.
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.
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.
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.
Lets you add an internal or external hyperlink. Can display the value as a link or as a plain text URL.
Number
Lets you offer a list of predefined floating point numbers (such as 3.14 and 99.99).
Lets you offer a list of predefined integer numbers (such as 3 and 99).
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).
Lets users enter a floating point value.
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.
Lets users reference other nodes. Often used to build lists of related/similar content items.
Lets users reference taxonomy terms.
Lets users reference user accounts.
Lets users reference (and upload) files. Oftent used for letting editors attach office documents and PDFs to nodes.
Lets users reference (and upload) images.
Text
Lets you offer a list of predefined text values.
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.
Lets users input a long, formatted text value.
The input widget is a textarea with a rich text editor and text format selection.
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.
Lets users input a short, unformatted text value.
The input widget is a basic input field without rich text editor.
Lets users input a long, unformatted text value.
The input widget is a basic textarea without rich text editor.