You are here

csv_example_paragraph_with_paragraph_reference.yml in Commerce Migrate 8.2

modules/csv_example/migrations/csv_example_paragraph_with_paragraph_reference.yml

File

modules/csv_example/migrations/csv_example_paragraph_with_paragraph_reference.yml
View source
  1. # Import a paragraph type that references a different paragraph type
  2. #
  3. # Import two paragraph entities. The paragraph entity has 3 fields, two single
  4. # valued text fields and a multi-valued paragraph field.
  5. #
  6. # Destination site configuration:
  7. # - Install the Paragraph Module.
  8. # - Create a paragraph type with three fields, two single values text fields
  9. # and a multi-value paragraph field for referencing the Call To Action
  10. # paragraph type.
  11. #
  12. id: csv_example_paragraph_with_paragraph_reference
  13. label: Paragraph with reference to Call To Action paragraph
  14. migration_group: commerce_migrate_csv_example
  15. migration_tags:
  16. - Commerce CSV
  17. - Content
  18. source:
  19. plugin: csv_example_product_tab
  20. path: 'public://import/example-products.csv'
  21. enclosure: "\""
  22. header_offset: 0
  23. ids: [tab_title]
  24. fields:
  25. - name: title
  26. label: Title
  27. - name: sku
  28. label: SKU
  29. - name: status
  30. label: Status
  31. - name: product_type
  32. label: Product type
  33. - name: description
  34. label: Description
  35. - name: product_variation_type
  36. label: Product variation type
  37. - name: sell_price
  38. label: Sell price
  39. - name: vocabulary_name1
  40. label: Vocabulary1
  41. - name: term1
  42. label: Vocabulary value1
  43. - name: vocabulary_name2
  44. label: Vocabulary2
  45. - name: term2
  46. label: Vocabulary value2
  47. - name: vocabulary_name3
  48. label: Vocabulary3
  49. - name: term3
  50. label: Vocabulary value3
  51. - name: attribute_name1
  52. label: Attribute name1
  53. - name: attribute_value1
  54. label: Attribute value1
  55. - name: attribute_name2
  56. label: Attribute name2
  57. - name: attribute_value2
  58. label: Attribute value2
  59. - name: attribute_name3
  60. label: Attribute name3
  61. - name: attribute_value3
  62. label: Attribute value3
  63. - name: attribute_name4
  64. label: Attribute name4
  65. - name: attribute_value4
  66. label: Attribute value4
  67. - name: related1
  68. label: SKU of Related item 1
  69. - name: related2
  70. label: SKU of Related item 2
  71. - name: related3
  72. label: SKU of Related item 3
  73. - name: image1
  74. label: Image 1
  75. - name: image2
  76. label: Image 2
  77. - name: image3
  78. label: Image 3
  79. - name: video1
  80. label: Video 1
  81. - name: thumbnail1
  82. label: Thumbnail 1
  83. - name: video2
  84. label: Video 2
  85. - name: thumbnail2
  86. label: Thumbnail 2
  87. - name: video3
  88. label: Video 3
  89. - name: thumbnail3
  90. label: Thumbnail 3
  91. - name: tab_title1
  92. label: Tab title 1
  93. - name: tab_content1
  94. label: Tab content 1
  95. - name: tab_cta1
  96. label: Associated tab CTA 1
  97. - name: tab_title2
  98. label: Tab title 2
  99. - name: tab_content2
  100. label: Tab content 2
  101. - name: tab_cta2
  102. label: Associated tab CTA 2
  103. process:
  104. # Text (plain), single value.
  105. field_tab_title: tab_title
  106. # Text (formatted, long), single value.
  107. field_tab_content: tab_content
  108. # Entity reference revisions, Unlimited.
  109. field_tab_cta/target_id:
  110. -
  111. plugin: migration_lookup
  112. migration: csv_example_paragraph_cta
  113. no_stub: true
  114. source:
  115. - tab_cta
  116. -
  117. plugin: skip_on_empty
  118. method: process
  119. -
  120. plugin: extract
  121. index:
  122. - '0'
  123. field_tab_cta/target_revision_id:
  124. -
  125. plugin: migration_lookup
  126. migration: csv_example_paragraph_cta
  127. no_stub: true
  128. source:
  129. - tab_cta
  130. -
  131. plugin: skip_on_empty
  132. method: process
  133. -
  134. plugin: extract
  135. index:
  136. - '1'
  137. destination:
  138. plugin: 'entity_reference_revisions:paragraph'
  139. default_bundle: tabs
  140. migration_dependencies:
  141. required:
  142. - csv_example_paragraph_cta