Creating Custom Compound Fields in Drupal 8

tobby

This session will give an overview of the Field API in Drupal 8, and show how to create custom compound fields. These fields can initially be used in content types, and then further extended to be used in Form API forms.

What's a Compound Field? Imagine a cake recipe. It consists of ingredients to bake this cake. Every single ingredient consists of multiple atomic values: amount, metric (tsp, tbsp, cup, gram, ml), a description, calories, etc. In a recipe, however, an ingredient is a single, cohesive field that consists of combined data values.

Alternatives to custom module development such as the Paragraphs module are frequently preferred, but in certain cases, a custom compound module may be in order. One aspect of this session will discuss when to use core or contrib options vs. creating a custom solution.

This session is for:

  • Developers tackling complex data models
  • Developers who just can't seem to find that perfect contrib module to help build a custom content type

It will cover:

  • An introduction to Field API in Drupal 8
  • How to approach different content models
  • Paragraphs module for building custom field bundles

Session Track

Coding and Development

Experience Level

Intermediate

Drupal Version