ResponsiveImageStyle::$image_style_mappings

Same name in other branches
  1. 9 core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php \Drupal\responsive_image\Entity\ResponsiveImageStyle::image_style_mappings
  2. 8.9.x core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php \Drupal\responsive_image\Entity\ResponsiveImageStyle::image_style_mappings
  3. 10 core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php \Drupal\responsive_image\Entity\ResponsiveImageStyle::image_style_mappings

The image style mappings.

Each image style mapping array contains the following keys:

  • image_mapping_type: Either 'image_style' or 'sizes'.
  • image_mapping:
    • If image_mapping_type is 'image_style', the image style ID (a string).
    • If image_mapping_type is 'sizes', an array with following keys:
      • sizes: The value for the 'sizes' attribute.
      • sizes_image_styles: The image styles to use for the 'srcset' attribute.
  • breakpoint_id: The breakpoint ID for this image style mapping.
  • multiplier: The multiplier for this image style mapping.

Type: array

File

core/modules/responsive_image/src/Entity/ResponsiveImageStyle.php, line 85

Class

ResponsiveImageStyle
Defines the responsive image style entity.

Namespace

Drupal\responsive_image\Entity

Code

protected $image_style_mappings = [];

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.