recipe.yml 1.71 KB
name: Images
type: Drupal CMS
description: Sets up base image configuration including responsive image styles, view modes, focal point-based cropping and SVG images.
recipes:
  - core/recipes/image_media_type
install:
  # Responsive image styles are pinned to Olivero breakpoints so we require it here.
  # We would like for people to be able to switch and disable themes without affecting image styles.
  # See https://www.drupal.org/project/drupal_cms/issues/3491177
  - olivero
  - focal_point
  - responsive_image
  - svg_image
config:
  # Treat field storages strictly since they influence the database layout.
  strict:
    - field.storage.media.field_media_svg_image
  import:
    focal_point: '*'
  actions:
    core.entity_form_display.media.image.*:
      setComponents:
       -
        name: field_media_image
        options:
          type: image_focal_point
          weight: 1
          region: content
          settings:
            progress_indicator: throbber
            preview_image_style: media_library
            preview_link: true
            offsets: '50,50'
       -
        # Enable the name field in the entity form so it can be modified.
        name: name
        options:
          type: string_textfield
          weight: -1
          region: content
      hideComponents:
        - uid
        - langcode
        - path
        - created
    core.entity_view_display.media.image.media_library:
      setComponent:
        name: thumbnail
        options:
          settings:
            image_style: media_library_square_thumbnail
    # Disable the `files` view because it is not clear to most users what the
    # difference is between "Files" and "Media". We favor media.
    views.view.files:
      disable: {}