Skip to content

Commit 252f9ec

Browse files
authored
Merge pull request #280 from wunderio/NEX-188
NEX-188: Use local example images instead of downloading random images during the migrations of wunder_democontent
2 parents 289f372 + af1ecb9 commit 252f9ec

File tree

21 files changed

+83
-70
lines changed

21 files changed

+83
-70
lines changed

drupal/web/modules/custom/wunder_democontent/migrations/nodes_articles_images.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ source:
77
ids:
88
- id
99
constants:
10+
file_source_dir: modules/custom/wunder_democontent/sources/images
1011
file_dest_uri: 'public://images/articles'
1112
uid: 1
1213
status: 1
@@ -23,22 +24,26 @@ process:
2324
uid: constants/uid
2425
status: constants/status
2526

26-
# Get the filename from the url using the basename php function:
27-
file_filename:
28-
plugin: callback
29-
source: Image
30-
callable: basename
31-
# The destination uses the filename added to our constant:
27+
# Source path is constructed by combining the source directory with the filename
28+
file_source:
29+
plugin: concat
30+
delimiter: /
31+
source:
32+
- constants/file_source_dir
33+
- Image
34+
35+
# Destination path uses the same filename
3236
file_dest:
3337
plugin: concat
3438
delimiter: /
3539
source:
3640
- constants/file_dest_uri
37-
- '@file_filename'
41+
- Image
42+
3843
uri:
3944
plugin: file_copy
4045
source:
41-
- Image
46+
- '@file_source'
4247
- '@file_dest'
4348
file_exists: rename
4449
destination:

drupal/web/modules/custom/wunder_democontent/migrations/nodes_frontpage_images.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ source:
77
ids:
88
- id
99
constants:
10+
file_source_dir: modules/custom/wunder_democontent/sources/images
1011
file_dest_uri: 'public://images/frontpages'
1112
uid: 1
1213
status: 1
@@ -23,12 +24,15 @@ process:
2324
uid: constants/uid
2425
status: constants/status
2526

26-
# Get the filename from the url using the basename php function:
27-
file_filename:
28-
plugin: callback
29-
source: Paragraph_0_hero_image
30-
callable: basename
31-
# The destination uses the filename added to our constant:
27+
# Source path is constructed by combining the source directory with the filename
28+
file_source:
29+
plugin: concat
30+
delimiter: /
31+
source:
32+
- constants/file_source_dir
33+
- Paragraph_0_hero_image
34+
35+
# Destination path uses the same filename
3236
file_dest:
3337
plugin: concat
3438
delimiter: /
@@ -38,7 +42,7 @@ process:
3842
uri:
3943
plugin: file_copy
4044
source:
41-
- Paragraph_0_hero_image
45+
- '@file_source'
4246
- '@file_dest'
4347
file_exists: rename
4448
destination:

drupal/web/modules/custom/wunder_democontent/migrations/nodes_pages_images.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ source:
77
ids:
88
- id
99
constants:
10+
file_source_dir: modules/custom/wunder_democontent/sources/images
1011
file_dest_uri: 'public://images/pages'
1112
uid: 1
1213
status: 1
@@ -23,22 +24,25 @@ process:
2324
uid: constants/uid
2425
status: constants/status
2526

26-
# Get the filename from the url using the basename php function:
27-
file_filename:
28-
plugin: callback
29-
source: Paragraphs_0_image
30-
callable: basename
27+
# Source path is constructed by combining the source directory with the filename
28+
file_source:
29+
plugin: concat
30+
delimiter: /
31+
source:
32+
- constants/file_source_dir
33+
- Paragraphs_0_image
34+
3135
# The destination uses the filename added to our constant:
3236
file_dest:
3337
plugin: concat
3438
delimiter: /
3539
source:
3640
- constants/file_dest_uri
37-
- '@file_filename'
41+
- Paragraphs_0_image
3842
uri:
3943
plugin: file_copy
4044
source:
41-
- Paragraphs_0_image
45+
- '@file_source'
4246
- '@file_dest'
4347
file_exists: rename
4448
destination:

drupal/web/modules/custom/wunder_democontent/sources/articles.csv

Lines changed: 36 additions & 36 deletions
Large diffs are not rendered by default.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
id,Tnid,Is source,Langcode,Title,Excerpt,Paragraph_0_text_title,Paragraph_0_text_body,Paragraph_0_hero_title,Paragraph_0_hero_body,Paragraph_0_hero_image,Paragraph_0_hero_primary_link_uri,Paragraph_0_hero_primary_link_title,Paragraph_0_hero_secondary_link_uri,Paragraph_0_hero_secondary_link_title,Paragraph_0_listing_articles_title,Paragraph_0_listing_articles_limit,Paragraph_0_liftups_articles_title,Paragraph_0_liftups_articles_articles_id_0,Paragraph_0_liftups_articles_articles_id_1,Paragraph_0_liftups_articles_articles_id_2
2-
1,1,1,en,Frontpage en,This site is meant as an example to show the setup of Drupal and Next.js using next-drupal,What is this?,This is the frontpage of the starterkit in English. Feel free to look around and navigate among our test content. 🙂,Starterkit for Next.js and Drupal by Wunder,"A multilingual and opinionated setup for ""Next.js for Drupal”",https://picsum.photos/1600/900.jpg,https://github.com/wunderio/next-drupal-starterkit/,GitHub project,https://next-drupal.org/,Next.js for Drupal,Latest articles,3,Hand-picked articles,4,19,25
3-
2,1,0,fi,Frontpage fi,Tämä sivusto on tarkoitettu esimerkkinä Drupalin ja Next.js:n asennuksesta next-drupalilla,Mitä tämä on?,Tämä on aloituspaketin etusivu suomeksi. Voit vapaasti katsoa ympärillesi ja selata testisisältöämme. 🙂,Starterkit for Next.js and Drupal by Wunder,Monikielinen ja mielikuvituksellinen kokoonpano “Next.js for Drupal”:lle,https://picsum.photos/1600/900.jpg,https://github.com/wunderio/next-drupal-starterkit/,GitHub-projekti,https://next-drupal.org/,Next.js for Drupal,Viimeisimmät artikkelit,3,Käsin poimittuja artikkeleita,4,19,25
4-
3,1,0,sv,Frontpage sv,Denna sida är avsedd som ett exempel för att visa installationen av Drupal och Next.js med hjälp av next-drupal,Vad är detta?,Detta är startsidan för startpaketet på svenska. Titta gärna runt och navigera bland vårt testinnehåll. 🙂,Starterkit for Next.js and Drupal by Wunder,En flerspråkig och egensinnig installation för “Next.js for Drupal”,https://picsum.photos/1600/900.jpg,https://github.com/wunderio/next-drupal-starterkit/,GitHub-projekt,https://next-drupal.org/,Next.js for Drupal,Senaste artiklarna,3,Handplockade artiklar,4,19,25
2+
1,1,1,en,Frontpage en,This site is meant as an example to show the setup of Drupal and Next.js using next-drupal,What is this?,This is the frontpage of the starterkit in English. Feel free to look around and navigate among our test content. 🙂,Starterkit for Next.js and Drupal by Wunder,"A multilingual and opinionated setup for ""Next.js for Drupal”",wunder_ecosystem.jpg,https://github.com/wunderio/next-drupal-starterkit/,GitHub project,https://next-drupal.org/,Next.js for Drupal,Latest articles,3,Hand-picked articles,4,19,25
3+
2,1,0,fi,Frontpage fi,Tämä sivusto on tarkoitettu esimerkkinä Drupalin ja Next.js:n asennuksesta next-drupalilla,Mitä tämä on?,Tämä on aloituspaketin etusivu suomeksi. Voit vapaasti katsoa ympärillesi ja selata testisisältöämme. 🙂,Starterkit for Next.js and Drupal by Wunder,Monikielinen ja mielikuvituksellinen kokoonpano “Next.js for Drupal”:lle,wunder_ecosystem.jpg,https://github.com/wunderio/next-drupal-starterkit/,GitHub-projekti,https://next-drupal.org/,Next.js for Drupal,Viimeisimmät artikkelit,3,Käsin poimittuja artikkeleita,4,19,25
4+
3,1,0,sv,Frontpage sv,Denna sida är avsedd som ett exempel för att visa installationen av Drupal och Next.js med hjälp av next-drupal,Vad är detta?,Detta är startsidan för startpaketet på svenska. Titta gärna runt och navigera bland vårt testinnehåll. 🙂,Starterkit for Next.js and Drupal by Wunder,En flerspråkig och egensinnig installation för “Next.js for Drupal”,wunder_ecosystem.jpg,https://github.com/wunderio/next-drupal-starterkit/,GitHub-projekt,https://next-drupal.org/,Next.js for Drupal,Senaste artiklarna,3,Handplockade artiklar,4,19,25
93.5 KB
Loading
128 KB
Loading
54 KB
Loading
81.9 KB
Loading
49.7 KB
Loading

0 commit comments

Comments
 (0)