Custom Fields

Sometimes you need to create your own custom fields or group of fields to your models. This is a guide on how to do that. Although there is an example at the Examples for developersarrow-up-right module, i found it lacking in some areas. So i decided to create my own example.

We will be leveraging the Field APIarrow-up-right to create our custom fields. which means we will need to create a FieldType, FieldWidget and FieldFormatter. we will create these files in the src/Plugin/Field/FieldType, src/Plugin/Field/FieldWidget and src/Plugin/Field/FieldFormatter directories.

Entity Reference and integerchevron-rightTwo Text Fieldschevron-rightTextfields, formatted text and numberschevron-rightLinks and media elementschevron-right

Last updated