-
Notifications
You must be signed in to change notification settings - Fork 0
/
gstd_file_image_to_media.yml
88 lines (79 loc) · 1.95 KB
/
gstd_file_image_to_media.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
id: gstd_file_image_to_media
label: "GSTD links files to to Media Entities"
migration_tags:
- gstd migration
source:
# constants:
# MEDIA_NAME_PREFIX: 'Photo of'
plugin: url
data_fetcher_plugin: http
data_parser_plugin: google_sheets
urls: "https://spreadsheets.google.com/feeds/list/1GuKab6Ezi3GckSjMD5BmAQVa0qnOKJX9kadWz_mDxcU/2/public/values?alt=json"
fields:
- name: src_photo_id
label: "Photo ID"
selector: photoid
- name: src_title
label: "Photo Title"
selector: phototitle
- name: src_photo_url
label: "Photo URL"
selector: photourl
- name: src_alt
label: "Photo Alt"
selector: photoalt
- name: src_uid
label: "User ID"
selector: userid
ids:
src_photo_id:
type: string
process:
psuedo_destination_filename:
- plugin: callback
callable: basename
source: src_photo_url
- plugin: skip_on_empty
method: row
message: "empty image filename."
psuedo_destination_path:
- plugin: concat
source:
- "@psuedo_destination_filename"
# psuedo_title:
# - plugin: concat
# source:
# - src_business_location_name
# - "Photo"
# delimiter: " "
psuedo_title: src_title
# psuedo_alt:
# - plugin: concat
# source:
# - "Photo of"
# - src_business_location_name
# delimiter: " "
psuedo_alt: src_alt
name: "@psuedo_title"
field_media_image/alt: "@psuedo_alt"
field_media_image/target_id:
plugin: migration_lookup
migration: gstd_file_image
source: src_photo_id
uid:
- plugin: migration_lookup
migration: gstd_users
source: src_uid
# -
# plugin: skip_on_empty
# method: process
# message: "No user for this file"
- plugin: default_value
default_value: 1
destination:
plugin: "entity:media"
default_bundle: image
migration_dependencies:
required:
- gstd_file_image
- gstd_users