You are here

migrate_plus.migration.blocks.yml in Migrate Google Sheets 2.x

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

File

migrate_google_sheets_example/config/install/migrate_plus.migration.blocks.yml
View source
  1. # This migration demonstrates importing from a Google Spreadsheet XML feed.
  2. id: blocks
  3. label: Example block migration 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/4/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: blocktype
  29. label: "Block type"
  30. selector: 'blocktype'
  31. -
  32. name: blockdescription
  33. label: "Block description"
  34. selector: 'blockdescription'
  35. -
  36. name: blocktext
  37. label: "Block text"
  38. selector: blocktext
  39. -
  40. name: visibleblocktitle
  41. label: "Visible Block Title"
  42. selector: 'visibleblocktitle'
  43. -
  44. name: universalidentifier
  45. label: 'Universal identifier'
  46. selector: 'universalidentifier'
  47. # Under 'ids', we identify source fields populated above which will uniquely
  48. # identify each imported item. The 'type' makes sure the migration map table
  49. # uses the proper schema type for stored the IDs.
  50. ids:
  51. id:
  52. type: integer
  53. # This is the mapping of the source values to the destination.
  54. process:
  55. type: blocktype
  56. #
  57. # The block title
  58. #
  59. info: blockdescription
  60. #
  61. # The main title presented to the user
  62. #
  63. field_visible_block_title: visibleblocktitle
  64. #
  65. # The body field (additional text, smaller print)
  66. #
  67. body/value: blocktext
  68. body/format:
  69. plugin: default_value
  70. default_value: full_html
  71. #
  72. # The UUID of the block. Used to show the correct block on the block layout page.
  73. uuid:
  74. plugin: skip_on_empty
  75. method: process
  76. source: universalidentifier
  77. destination:
  78. plugin: entity:block_content
  79. migration_dependencies:
  80. required: { }
  81. optional: { }