Skip to content

Instantly share code, notes, and snippets.

@dinarcon
Last active October 29, 2020 17:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dinarcon/6c4b5bdc5dae5455bd9641a05e3701a4 to your computer and use it in GitHub Desktop.
Save dinarcon/6c4b5bdc5dae5455bd9641a05e3701a4 to your computer and use it in GitHub Desktop.
source:
defaults:
MY_VALUE: 'http://understanddrupal.com'
plugin: source_plugin_name
source_plugin_config: source_config_value
process:
process_destination: defaults/MY_VALUE
source:
constants:
MY_STRING: 'http://understanddrupal.com'
MY_INTEGER: 31
MY_DECIMAL: 3.1415927
MY_ARRAY:
- 'dinarcon'
- 'dinartecc'
plugin: source_plugin_name
source_plugin_config_1: source_config_value_1
source_plugin_config_2: source_config_value_2
process:
process_destination_1: constants/MY_INTEGER
process_destination_2:
plugin: concat
source: constants/MY_ARRAY
delimiter: ' '
source:
constants:
MY_BASE_URL: 'http://understanddrupal.com'
plugin: source_plugin_name
source_plugin_config_1: source_config_value_1
source_plugin_config_2: source_config_value_2
process:
title: source_column_title
my_pseudofield_1:
plugin: concat
source:
- constants/MY_BASE_URL
- source_column_relative_url
delimiter: '/'
my_pseudofield_2:
plugin: urlencode
source: '@my_pseudofield_1'
field_link/uri: '@my_pseudofield_2'
field_link/title: '@title'
process:
title: name
pseudo_image_url:
plugin: concat
source:
- constants/BASE_URL
- photo_url
delimiter: '/'
pseudo_image_description:
plugin: concat
source:
- constants/PHOTO_DESCRIPTION_PREFIX
- name
delimiter: ' '
field_image:
plugin: image_import
source: '@pseudo_image_url'
reuse: TRUE
alt: '@pseudo_image_description'
title: '@title'
width: photo_width
height: photo_height
source:
constants:
BASE_URL: 'https://agaric.coop'
PHOTO_DESCRIPTION_PREFIX: 'Photo of'
plugin: embedded_data
data_rows:
-
unique_id: 1
name: 'Michele Metts'
photo_url: 'sites/default/files/2018-12/micky-cropped.jpg'
photo_width: '587'
photo_height: '657'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment