Types of fields

Ready for review -- AWAITING PEER REVIEW
Description: 
This lesson will cover the different fields provided by Drupal 7 and Drupal 8 core.
Overview: 

The field types provided in Drupal 7 are: boolean, decimal, file, float, image, integer, list (float), list (integer), list (text), long text, long text and summary, term reference, text.
In D8, there are more field types: boolean, comments, date, entity reference, file, image, list (float), list (integer), list (text), long text, long text and summary, number (decimal), number (float), number (integer), term reference, text

Drupal 7 and Drupal 8 field types

Steps: 

The following fields are provided by Drupal 7 and Drupal 8 core:

  • Boolean-D7 and D8: Allows users to choose one of two options, using either radio buttons or an on/off checkbox.
  • Comments-D8: Allows users to post comments. Who can post comments is configurable and the comments may be displayed in a threaded list.
  • Date-D8: Allows users to enter a date. The number of values can have a configurable limit and the field may include the time as well.
  • Decimal-D7, Number (decimal)-D8: Allows exact decimal values.
  • Entity Reference-D8: Allows the user to reference a specific type of entity. The allowed number of values is configurable.
  • File-D7 and D8: Allows users to upload a file (note that there's a separate field type for images). It's useful if you want to attach a document, such as a PDF.
  • Float-D7, Number (float)-D8: Allows floating-point values. Floating-point values represent approximate decimal values.
  • Image-D7 and D8: Allows users to upload images and attach them to the node. These images could be displayed in their raw form, hidden and then inserted into the body using the Insert module, or hidden and called using a node template. This field is extremely flexible and can be tailored to your needs.
  • Integer-D7, Number (integer)-D8: Allows users to enter whole numbers, such as years (e.g. 2012) or values (e.g. 1, 2, 5, 305). It does not allow decimals.
  • List (float)-D7 and D8: Allows floating-point values from a predefined list. Floating-point values represent approximate decimal values.
  • List (integer)-D7 and D8: Allows whole number values from a predefined list.
  • List (text)-D7 and D8: Allows text values from a predefined list.
  • Long text-D7 and D8: Allows users to enter chunks of text in a textarea field with multiple rows, with no summary option (see below).
  • Long text and summary-D7 and D8: Allows users to enter chunks of text in a textarea field with multiple rows, with an option to enter a summary, or brief excerpt that describes the text. This could be used if you were creating a blog with short excerpts on the index page - the post itself would be in the long text field, and the brief excerpt that displayed on the index page would be pulled from the summary field.
  • Term reference-D7 and D8: Links the node to a vocabulary. After this is added, tags from this vocabulary can be selected on each node that uses this content type.
  • Text-D7 and D8: Allows users to enter text in short, row-less fields. This is ideal for small phrases, since long sentences can't be seen in the small text field.