migrate_google_sheets-8.x-1.0/migrate_google_sheets_example/config/install/migrate_plus.migration.node_landing_page.yml

migrate_google_sheets_example/config/install/migrate_plus.migration.node_landing_page.yml
# This migration demonstrates importing from a Google Spreadsheet XML feed.
id: node_landing_page
label: Games Site node pages 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.
  # Template: 'https://sheets.googleapis.com/v4/spreadsheets/<SHEET>/values/<TAB>?key=<KEY>'
  urls: 'https://sheets.googleapis.com/v4/spreadsheets/1spS1BeUIzxR1KrGK2kKzAoiFZii6vBHyLx_SA0Sb89M/values/Page?key=<KEY>'
  # 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: status
      label: 'Status'
      selector: 'status'
    -
      name: path
      label: 'Path'
      selector: 'path'
    -
      name: redirect
      label: 'Redirect'
      selector: 'redirect'
    -
      name: subhead
      label: 'Subhead'
      selector: 'subhead'
    -
      name: summary
      label: 'Summary'
      selector: 'summary'
    -
      name: body
      label: 'Body'
      selector: 'body'
    -
      name: relatedgames
      label: 'Related Games'
      selector: 'relatedgames'
  # 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:
  type:
    plugin: default_value
    default_value: landing_page
  # Note that the source field names here (id and title) were
  # defined by the 'fields' configuration for the source plugin above.
  title: title
  status: status
  path/pathauto:
    plugin: default_value
    default_value: 0 # Disable pathauto.
  path/alias: path
  field_subhead: subhead
  body/value: body
  body/summary: summary
  body/format:
    plugin: default_value
    default_value: full_html
  field_related_articles:
    -
      plugin: explode
      source: relatedgames
      delimiter: ;
    -
      plugin: entity_lookup
destination:
  plugin: entity:node
migration_dependencies:
  required:
    - node_game

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc