O'Reilly logo

Drupal 8 Development Beginner's Guide - Second Edition by Kurt Madel, Malabya Tewari, Rakesh James, Krishna Kanth, Edward Crompton, Samuel Keen, Tassos Koutlas, Neeraj Kumar

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

Time for action – developing a custom module for a compound NutritionInformation field

Rather than adding the code to create this compound field to our existing module, we are going to create a new module, as it is possible that it is something that could be useful to the Drupal community as a whole, and we may want to eventually contribute it to Drupal (https://www.drupal.org/). We need to create a compound field that consists of several different form elements (a select number and several text fields). We can now have a basic compound field in three basic steps: first is defining the field (info and schema), second is defining the field form (widget), and then comes defining the output (formatter). All of these steps are explained here:

  1. In Phpstorm, ...

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