Blog

Fresh off the Blog

Compound fields - Part 2

Tutorial

the Field Type Item definition

In the previous section we learned what a compound/bundled field is, and defined the module files that will wrap our field type plugin. In this section, we will create the file that defines the field type and which sub-fields compose it.

NameItem.php

The field file defines the structure of the field type. The name of the file (less the .php extension) will also be the name of the class defined within the file. The file should be placed in the path <my module>/src/Plugin/Field/FieldType.

Macports and No Composer?

Tutorial
I received the following response in my Mac terminal window: composer: command not found. What to do?

Compound fields - Part 4

Tutorial

the Field Type Widget Formatter definition

In the previous section created the field type widget definition that will be used to format the field on the node form. In this section, we will create the file that defines the widget formatter used to pre-format the data before passing it on to a twig file.

Adding a settings form to a custom module

Tutorial
Often a custom module will have configuration settings that can be provided by an administrator. Let's go step-by-step through the creation of a custom module, example, and its settings page.