Skip to content

Instantly share code, notes, and snippets.

@mohit-rocks
Last active Feb 14, 2018
Embed
What would you like to do?
Migration template : Specify custom ID Map Plugin (Drupal 8)
id: node_page
label: "Page Content"
migration_tags:
- content_import
# Notice ID Map plugin here.
idMap:
plugin: content_update
# ID Map plguin declaration ends.
source:
plugin: csv
path: 'public://example.csv'
header_row_count: 1
keys:
- 'Item-ID'
fields:
Item-ID: Unique identifier for each page.
Page name: Name of the page.
Page category: Page category.
process:
type:
plugin: default_value
default_value: page
title: Page name
langcode:
plugin: default_value
default_value: "en"
field_page_category:
-
plugin: skip_on_empty
method: row
source: Page category
message: "Row skipped due to empty Page category"
field_page_unique_id:
-
plugin: skip_on_empty
method: row
source: Item-ID
message: "Row skipped due to empty Item-ID value"
destination:
plugin: entity:node
translations: true
migration_dependencies:
required: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment