Introducing the 5 New Fields in Drupal 8

| Drupal
5 New Fields in Drupal 8

The Drupal 8 core has far more features than the Drupal 7 core. Many popular contributed modules have been included in the core, including five field types.

Here are the 5 new fields in Drupal 8:

  • Date
  • Email
  • Link
  • Telephone
  • Reference

This screenshot shows the new interface for adding fields.

Introducing the 5 New Fields in Drupal 8

You'll notice the new fields, but also some smaller changes too. For example:

  • The field options are grouped into "General", "Number", "Reference" and (off the screen) "Text".
  • The English used for field names is more straight-forward. For example, "Integer" is now simply "Number".
  • Comments is now available as a field, rather than a setting.

#1. The Date Field in Drupal 8

The Date field is a much simpler version of the Date module in Drupal 7.

As with almost all of the fields in Drupal 8, there are now far options.

You can choose to record the "Date and time" or "Date only":

And you can set a "Default date":

That's it. Those are all the options available for the core Date field. By default, the date input is a pop-up calendar:

#2. The Email Field in Drupal 8

If the Date module is simple, then the Email field is even simpler. There are no settings at all for the Email field.

One odd thing is that the default display is set to "Plain text". To make email addresses show as active links, you'll need to click "Manage Display" and choose the "Email" option:

#3. The Link Field in Drupal 8

The Link field is one that has several possible uses. It allows both internal and external links:

The image below shows how the Link field will appear to content creators. If you choose to allow internal links, this URL field will autocomplete for your site's page.

#4. The Telephone Number Field in Drupal 8

There are at least two telephone modules available for Drupal 7. The one chosen for Drupal 8 was clearly the most basic.

The Telephone field is disabled by default in Drupal 8, so you'll need to enable the module to use it.

Then, once enabled, it has no settings. It really is just a text field that adds <a href="tel: to turn the text into a telephone link.

I suspect most people will want formatting for their phone numbers and will end up replacing this field with contributed modules.

#5. The Reference Field in Drupal 8

If the Telephone module is the simplest new field, the Reference module is by far the most powerful.

You can link to anything that's an entity, which means you can link to comments, content, blocks, files, terms, users and much more.

Notice the "Configuration" options above. There are more listed in the image below. These allow you to link to any area of Drupal's configuration. For example, if you choose "View", you'll go to the editing screen, rather than the actual display.

These "Configuration" options were trickier to set up - several options produced errors for me. I can imagine most sites won't use this feature, but some will find it useful to be able to add links to admin options.

Also available by default is the option to use a view. This would require some planning ahead to create the view before you get here, but it does add some power to the Reference field.

Finally, you can set a default sorting method if you allow references to multiple items:

One final usability improvement: unlike the Entity Reference module in Drupal 7, most of these reference fields will display as a link automatically:

About the author

Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.