Add support for image attributes on remote images

Created on 30 January 2024, about 1 year ago
Updated 1 February 2024, about 1 year ago

When importing files using file_remote_url I would like to be able to also import alt and title attributes.

When using migrate's image_import plugin, it supports both title and alt tag. e.g.

process:
  nid: id
  title: title
  field_image:
    plugin: image_import
    source: file
    destination: 'constants/file_destination'
    title: file_title
    alt: !title

How do we do the same with field_media_image?

e.g.

 *     plugin: file_remote_image
 *     source: https://www.drupal.org/files/drupal_logo-blue.png
 *     title: title
 *     alt: alt
 *     width: width
 *     height: height

https://www.drupal.org/docs/drupal-apis/migrate-api/migrate-destination-...

One benefit of this is that the title and alt tag can be output in the theme layer after importing and also editing when remote_stream_wrapper_widget is installed.

Feature request
Status

Active

Version

2.1

Component

Code

Created by

🇬🇧United Kingdom 2dareis2do

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024