![]() The syntax to migrate into subfields is the machine name of the field and the subfield name separated by a slash ( /). The next code snippets shows how to do it: process:įield_text_with_summary/value: source_valueįield_text_with_summary/summary: source_summaryįield_text_with_summary/format: source_format The Migrate API allows you to write to each component separately defining subfields targets. This type of field has three components: the full text ( value) to present, a summary text, and a text format. The `Body` field is of type `Text (formatted, long, with summary)`. In addition to having a unique identifier, each record includes a name, a short profile, and details about the image. Only one record is presented to keep snippet short, but more exist. Photo_description: 'Photo of Michele Metts' Let’s see part of the source definition: source: Valid plugin IDs for Drupal\migrate\Plugin\MigratePluginManager are:…”. Otherwise, you will get an error like: “In DiscoveryTrait.php line 53: The “file_import” plugin does not exist. This example uses the Migrate Files module (explained later). Refer to this article for instructions on how to enable the module and run the migration. The `id` of the example migration is `udm_subfields`. The full code is available at The module name is `UD Migration Subfields` and its machine name is `ud_migrations_subfields`. The code snippets will be compact to focus on particular elements of the migration. As in previous examples, we will create a new module and write a migration definition file to perform the migration. This assumes that Drupal was installed using the `standard` installation profile. Today’s example will consist of migrating data into the `Body` and `Image` fields of the `Article` content type that are available out of the box. Today we will learn how to migrate into them and know which subfields are available. The migrate API refers to a field’s component as subfield. Image fields store a reference to the file, alternative and title text, width, and height. For example, formatted text fields store the text to display and the text format to apply. Some Drupal fields have multiple components. ![]() In the previous entry, we learned how to use process plugins to transform data between source and destination.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |