You are here

migrate_plus.migration.node_landing_page.yml in Migrate Google Sheets 8

migrate_google_sheets_example/config/install/migrate_plus.migration.node_landing_page.yml

File

migrate_google_sheets_example/config/install/migrate_plus.migration.node_landing_page.yml
View source
  1. # This migration demonstrates importing from a Google Spreadsheet XML feed.
  2. id: node_landing_page
  3. label: Games Site node pages with Google Spreadsheet
  4. migration_group: games_example
  5. source:
  6. plugin: url
  7. data_fetcher_plugin: http
  8. data_parser_plugin: google_sheets
  9. # The feed file for the spreadsheet. The Google Spreadsheet should be either “Public” or set to “Anyone with link can
  10. # view” in order for the feed to work. Note that the <SHEET> param is the order of the tabs and WILL change if the
  11. # tabs are re-ordered.
  12. # Template: 'https://spreadsheets.google.com/feeds/list/<KEY>/<SHEET>/public/values?alt=json'
  13. urls: 'http://spreadsheets.google.com/feeds/list/1spS1BeUIzxR1KrGK2kKzAoiFZii6vBHyLx_SA0Sb89M/2/public/values?alt=json'
  14. # Under 'fields', we list the data items to be imported. The first level keys
  15. # are the source field names we want to populate (the names to be used as
  16. # sources in the process configuration below). For each field we're importing,
  17. # we provide a label (optional - this is for display in migration tools) and
  18. # an selector (xpath) for retrieving that value. It's important to note that this xpath
  19. # is relative to the elements retrieved by item_selector.
  20. # For Google Spreadsheet XML feeds the actual columns are named with gsx: followed by the cleaned column name (lower,
  21. # limited punctuation, etc).
  22. fields:
  23. -
  24. name: id
  25. label: 'Unique identifier'
  26. selector: 'id'
  27. -
  28. name: title
  29. label: 'Title'
  30. selector: 'title'
  31. -
  32. name: status
  33. label: 'Status'
  34. selector: 'status'
  35. -
  36. name: path
  37. label: 'Path'
  38. selector: 'path'
  39. -
  40. name: redirect
  41. label: 'Redirect'
  42. selector: 'redirect'
  43. -
  44. name: subhead
  45. label: 'Subhead'
  46. selector: 'subhead'
  47. -
  48. name: summary
  49. label: 'Summary'
  50. selector: 'summary'
  51. -
  52. name: body
  53. label: 'Body'
  54. selector: 'body'
  55. -
  56. name: relatedgames
  57. label: 'Related Games'
  58. selector: 'relatedgames'
  59. # Under 'ids', we identify source fields populated above which will uniquely
  60. # identify each imported item. The 'type' makes sure the migration map table
  61. # uses the proper schema type for stored the IDs.
  62. ids:
  63. id:
  64. type: integer
  65. # This is the mapping of the source values to the destination.
  66. process:
  67. type:
  68. plugin: default_value
  69. default_value: landing_page
  70. # Note that the source field names here (id and title) were
  71. # defined by the 'fields' configuration for the source plugin above.
  72. title: title
  73. status: status
  74. path/pathauto:
  75. plugin: default_value
  76. default_value: 0 # Disable pathauto.
  77. path/alias: path
  78. field_subhead: subhead
  79. body/value: body
  80. body/summary: summary
  81. body/format:
  82. plugin: default_value
  83. default_value: full_html
  84. field_related_articles:
  85. -
  86. plugin: explode
  87. source: relatedgames
  88. delimiter: ;
  89. -
  90. plugin: entity_lookup
  91. destination:
  92. plugin: entity:node
  93. migration_dependencies:
  94. required:
  95. - node_game