Dynamic type references

As you can see from the previous examples, simple and complex data types are essential references to other data types. Sometimes, a type isn't fixed but depends on the data of the configuration object itself. Think of Drupal image styles. They can contain several different image effects, with each of the effects requiring a different structure. Let's look at the default configuration object of the image style thumbnail located in image.style.thumbnail.yml:

name: thumbnail
label: 'Thumbnail (100x100)'
effects:
  1cfec298-8620-4749-b100-ccb6c4500779:
    id: image_scale
    data:
      width: 100
      height: 100
      upscale: true
    weight: 0
    uuid: 1cfec298-8620-4749-b100-ccb6c4500779
langcode: en

Depending on the selected effect, the key data can contain ...

Get Drupal 8 Configuration Management now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.