0

I am new to Drupal and Would really appreciate the help

I am importing html pages using migrate, migrate_tools, migrate_plus and migrate_source_html it is working but I would like to also populate the Menu settings with the following Menu link title, Description, Parent link, the parent is not the main it should be something like 'test' which I created Menus

I also would like to populate the Taxonomy in the Tags 'Entity reference Reference type: Taxonomy term Vocabulary: Tags' which is in the meta of the html page

This is my YML file note the url is not right here but I have the real URL in my code and the pages gets migrated to my content

label: migrate html
source:
  plugin: url
  vocabulary: internal
  urls:
    - https://url/modules/custom/cfa_migrate_html_content/pages/page.html
  data_fetcher_plugin: http
  data_parser_plugin: html5
  fields:
    - name: content_id
      label: 'Content ID'
      selector: '//head/meta[@property="post_id"]/@content'
    - name: title
      lable: 'Content Title'
      selector: '//title/text()'
    - name: content
      lable: 'Content'
      selector: '//body/*'
    - name: taxonomy
      lable: 'taxonomy'
      selector: '//head/meta[@property="taxonomy_id"]/@content'
    - name: parent_menu_id
      lable: 'parent_menu_id'
      selector: '//head/meta[@property="parent_menu_id"]/@content'
  ids:
    content_id:
      type: integer
process:
  title: title
  body/value: 
    -
        plugin: dom
        method: import
        source: 'content'
    -
        plugin: dom
        method: export
  'body/format':
    plugin: default_value
    default_value: full_html
  uid:
    plugin: default_value
    default_value: 1
  type:
    plugin: default_value
    default_value: article
  path/alias: default_value
  default_value: /content/html-5-
destination:
  plugin: 'entity:node'
  bundle: migrated_content
This is my html page 
```<!doctype html>
<html>
<html>
<head>
<meta charset="UTF-8">
<title>Resources</title>
<meta property="post_id" content="24012">
    <meta property="taxonomy_id" content="Organization">
    <meta property="parent_menu_id" content="1">
</head>
<body class="content">
<table>
  <tbody>
    <tr>
      <p>
      <ul>
        <li> <a href = "/internal/Employees.html"> Employees</a> </li>
        <li> <a href = "/opportunities/index.html" target = "blank"> opportunities</a> </li>
        <li> <a href = "science"> Sciene</a> </li>
      </ul>
    </tr>
  </tbody>
</table>
</body>
</html>

I tried the following in my YML for the taxonomy


  field_tags:
    plugin: entity_lookup
    source: taxonomy
    value_key: name
    bundle_key: vid
    bundle: content_categories
    entity_type: taxonomy_term
    ignore_case: true

and it does not work, nothing shows up in the tags and I am not sure what the code should be for the menu.

Any help would be great and thank you so much in advance.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.