Fields

Drupal 8 - Custom field formatter

Submitted by superadmin on Sun, 01/03/2016 - 14:23

Thanks to the Object Oriented approach adopted in Drupal 8,  working with field extension in terms of widgets and formatters have become much easier. Gone are the days where you had to copy huge junks of code to use in your custom formatter. Now you just extend an exisiting formatter and change the bit you want to override.

Creating a new custom formatter is a really straightforward process. I am going to assume you already have a module that you want to place the field formatter in.