Overview

In the following article, I investigated search methods for nested fields using Strapi.

This time, as a preparation for doing the same thing in Drupal, this is a note on how to perform bulk registration and updates of content. To set up a structure similar to the above article, we will work with two content types: Book and Author.

Creating Content Types

Create the Book and Author content types.

Author

Below is an example of Author.

Create fields for id, name, and hobby. Please ignore the feeds field as it will be added later.

Book

For Book, create an authors field and select Content as the field type.

Select Author as the Reference type content type.

Feeds Configuration

Configure the settings for bulk registration.

Author

Access the following path:

/admin/structure/feeds

Since we will upload and register via CSV, configure as follows.

Set the fields NAME and HOBBY as shown below. The title is set because it was a required field. Also, id is set as the Unique field.

Book

An important note for Book: the authors field specifies the id of another content type. Specifically, as shown in the figure below, “node.field_id” is specified for Reference by.

Bulk Registration with Feeds

/admin/content/feed

Author

By uploading the previously created CSV file, the registration is completed as shown below.

Book

Content of content type Author is correctly associated with the authors field.

(Reference) Updating with Feeds

To configure the Author feeds settings, access the following:

/admin/structure/feeds/manage/author?destination=/admin/structure/feeds

As shown below, by setting “Update existing content items” to “Update existing content items,” updates can be performed. Since “field_id” was set as Unique, new or update operations are determined based on this value.

!

I have not fully understood the behavioral differences between “Replace existing content items” and “Update existing content items,” so please verify before using.

Summary

I performed bulk registration and updates using Feeds, as well as associations with different content types. I hope this serves as a useful reference.