migrate_plus.migration.menu_links.yml in Migrate Google Sheets 2.x
Same filename and directory in other branches
migrate_google_sheets_example/config/install/migrate_plus.migration.menu_links.yml
File
migrate_google_sheets_example/config/install/migrate_plus.migration.menu_links.ymlView source
- # This migration demonstrates importing from a Google Spreadsheet XML feed.
- id: menu_links
- label: Games Site menu links with Google Spreadsheet
- migration_group: games_example
- source:
- plugin: url
- data_fetcher_plugin: http
- data_parser_plugin: google_sheets
- # The feed file for the spreadsheet. The Google Spreadsheet should be either “Public” or set to “Anyone with link can
- # view” in order for the feed to work. Note that the <SHEET> param is the order of the tabs and WILL change if the
- # tabs are re-ordered.
- # Template: 'https://spreadsheets.google.com/feeds/list/<KEY>/<SHEET>/public/values?alt=json'
- urls: 'http://spreadsheets.google.com/feeds/list/1spS1BeUIzxR1KrGK2kKzAoiFZii6vBHyLx_SA0Sb89M/1/public/values?alt=json'
- # Under 'fields', we list the data items to be imported. The first level keys
- # are the source field names we want to populate (the names to be used as
- # sources in the process configuration below). For each field we're importing,
- # we provide a label (optional - this is for display in migration tools) and
- # an selector (xpath) for retrieving that value. It's important to note that this xpath
- # is relative to the elements retrieved by item_selector.
- # For Google Spreadsheet XML feeds the actual columns are named with gsx: followed by the cleaned column name (lower,
- # limited punctuation, etc).
- fields:
- -
- name: id
- label: 'Unique identifier'
- selector: 'id'
- -
- name: title
- label: 'Title'
- selector: 'title'
- -
- name: path
- label: 'Path'
- selector: 'path'
- -
- name: menu_name
- label: 'Menu Name'
- selector: 'menuname'
- -
- name: external
- label: 'Is external?'
- selector: 'external'
- -
- name: weight
- label: 'Weight'
- selector: 'weight'
- -
- name: expanded
- label: 'Expanded'
- selector: 'expanded'
- -
- name: parentid
- label: "Parent Id"
- selector: 'parentid'
- # Under 'ids', we identify source fields populated above which will uniquely
- # identify each imported item. The 'type' makes sure the migration map table
- # uses the proper schema type for stored the IDs.
- ids:
- id:
- type: integer
- # This is the mapping of the source values to the destination.
- process:
- id: id
- title: title
- description: title
- menu_name: menu_name
- link/uri:
- plugin: link_uri
- source:
- - path
- link/options:
- plugin: default_value
- default_value: { }
- link/title: title
- route:
- plugin: route
- source:
- - path
- - '@link/options'
- route_name: '@route/route_name'
- route_parameters: '@route/route_parameters'
- url: '@route/url'
- options: '@route/options'
- external: external
- weight: weight
- expanded: expanded
- parent:
- plugin: menu_link_parent
- source:
- - parentid
- - '@menu_name'
- - parent_link_path
- destination:
- plugin: 'entity:menu_link_content'
- default_bundle: menu_link_content
- no_stub: true
- migration_dependencies:
- required:
- - upgrade_menu
- optional: { }