Skip to content

Instantly share code, notes, and snippets.

@xurizaemon
Created August 27, 2019 06:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xurizaemon/dd209733d112c7c40e76571a0c6bc03f to your computer and use it in GitHub Desktop.
Save xurizaemon/dd209733d112c7c40e76571a0c6bc03f to your computer and use it in GitHub Desktop.
langcode: en
status: true
dependencies: { }
id: json_page
migration_tags:
- Example
migration_group: mymodule
label: 'JSON Pages'
source:
plugin: url
data_fetcher_plugin: file
data_parser_plugin: json
urls:
- 'modules/custom/mymodule/data/pages.json'
item_selector: pages
fields:
-
name: title
label: 'Title'
selector: title
-
name: body
label: 'Body'
selector: body
-
name: uid
label: 'Author'
selector: uid
-
name: path
label: 'Path'
selector: path
# -
# name: uuid
# label: 'UUID'
# selector: uuid
ids:
path:
type: string
constants:
pathauto_skip: 0
process:
title: title
uuid: uuid
path/alias: path
path/pathauto: constants/pathauto_skip
langcode:
plugin: default_value
source: language
default_value: und
uid: uid
status: 1
body/format:
plugin: default_value
source: format
default_value: full_html
body/value: body
destination:
plugin: 'entity:node'
default_bundle: page
migration_dependencies:
required: { }
optional: { }
{
"pages": [
{
"title": "Some Title",
"path": "/path/here",
"uid": 3,
"body": "Some HTML."
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment