Book Image

Drupal 8 Configuration Management

Book Image

Drupal 8 Configuration Management

Overview of this book

Table of Contents (16 chapters)
Drupal 8 Configuration Management
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

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 a completely different structure. For example, the structure of the effect image_crop uses the property anchor instead of upscale. Here is an excerpt merely showing the image effect:

    id: image_crop
    data...