# Migration configuration for section content.
#title,body,field_image,field_code,field_parent_section_id,field_edu_id,field_section_type_id,field_founding_date,field_defunct_date,field_history,field_head_title,field_ahead_title,field_head,field_ahead,path

#    - field.field.node.pe_section.field_email
#    - field.field.node.pe_section.field_fax_number
#    - field.field.node.pe_section.field_section_secretary
#    - field.field.node.pe_section.field_telephone_number
#    - field.field.node.pe_section.field_url
#    - field.field.node.pe_section.field_address

id: demo_uni_section
label: Sections or departments
migration_group: demo_uni
source:
  plugin: demo_uni_section
destination:
  plugin: entity:node
process:
  # Hardcode the destination node type (bundle) as 'pe_section'.
  type:
    plugin: default_value
    default_value: pe_section
  title: title
  'body/value': body
  'body/format':
    plugin: default_value
    default_value: basic_html
  uid:
    plugin: default_value
    default_value: 1
  path: path
  promote:
    plugin: default_value
    default_value: 0
  sticky:
    plugin: default_value
    default_value: 0
  field_image_section:
    plugin: image
    entity_type: node
    bundle: pe_section
    source: field_image_sec
  field_code: field_code
#  migration of parent section doesn't work :-(
  field_parent_section: field_parent_section_id
  field_educational_institution:
    plugin: migration
    migration: demo_uni_edu
    source: field_edu_id
  field_section_type: field_section_type_id
  field_founding_date:
    plugin: date_custom
    source: field_founding_date
    format: 'Y-m-d\TH:i:s'
  field_defunct_date:
    plugin: date_custom
    source: field_defunct_date
    format: 'Y-m-d\TH:i:s'
  'field_history/value': field_history
  'field_history/format':
      plugin: default_value
      default_value: basic_html
  field_section_head_title: field_head_title
  field_section_head_deputy_title: field_ahead_title
  field_section_head:
    plugin: migration
    migration: demo_uni_user
    source: field_head
  field_section_head_deputy:
    plugin: migration
    migration: demo_uni_user
    source: field_ahead
migration_dependencies:
  required:
    - demo_uni_term
    - demo_uni_user
    - demo_uni_edu
