O'Reilly logo

Drupal 8 Module Development by Daniel Sipos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Field configuration

We got our field working, but let's say we want to make it a bit more dynamic. It's called Product Importer, and we are showing the title of the Importer entity. But let's make it configurable so that we can choose which title to show--that of the entity or that of the actual Importer plugin--in the UI.

There's a few simple steps for making the field plugin configurable. These work similarly to other Views plugin types. They are also quite similar in concept to what we did in Chapter 9 , Custom Fields, when we made the entity fields configurable.

First, we need to define some default options by overriding a method:

/** * {@inheritdoc} */ protected function defineOptions() { $options = parent::defineOptions(); $options['importer'] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required