Strapi v3

The source Strapi v3 connector allows content to be picked up from Strapi versions 3.4.0 to 3.5.2 to be picked up and transformed into motation.

Configuration walkthrough

Specifics

The source Strapi v3 connector is able to sync both content and media files.

UID Field

Impulse expects users to use the UID field provided in strapi as a UUID for contents. Rather than rely on the auto incrementing ID of contents use the UID field and provide every content a UUID so that it can be queried and searched for. This is not only the best way to work with Impulse, but also the best way to build your Strapi deployment.

User Permissions

To pickup content from the Strapi system, you will need to pass a user's login credentials into the endpoint config. The user requires the appropriate permissions to be able to pickup the content. The permissions required are the same as the admin UI permissions. If the user is able to use the admin UI, it will work in Impulse.

Because the adapters communicate with Strapi through Strapi’s REST API, the JWT timeout for that adapter user should be long enough to complete a sync.

The easiest option is to create a super user and use those credential for Impulse.

Same System Only

Strapi v3 has a few field types that are synced only to another Strapi system.

Those fields are:

  • Component

  • Dynamic Zone

Private fields

Any field in a collection type that has the "private" attribute set will not be synced.

This includes the password field type as they are always private.

Endpoint Config

When saving an endpoint for a Strapi v3 repository via REST instead of the UI you must use the following key:value pairs in the payload.

  • contentRepo:strapi

  • contentRepoVersion:3.4.0

Unsupported

Users, roles, and permissions are unable to be synced.

Multiple collection types per job. You can only sync one collection type per job. Setting multiple collection types will result in only one of them being synced.

Strapi v3 adapter does not support running as a remote adapter apart from Impulse.

Adapter Properties

PropertyPurpose

strapiURL

The URL to access the Strapi system.

user

The user with appropriate permissions.

password

The password for the user with appropriate permission.

Job Options

NameDescriptionData TypeRequiredDefault Value

contentNameField

Name of the field to be used as the content.properties.name of the motation object

Text

Yes

No Default Value

path

The path to pickup media files.

Array

No

No Default Value

contentType

The content type to pickup.

Array

No

No Default Value

dependenciesDepth

The max depth to look for dependencies.

Integer

No

1

contentDependencies

If dependencies should be picked up.

Boolean

No

false

Sending specific contents of collection/single types.

To get the content of a collection type (or a single type) you will need to provide the API ID of the content type in the details of the endpoint like this:application::<api-id>.<api-id>

Example:

Syncing media files from the media library

Media files in the media library are treated as files that live under a path. As such the details to get files would be as follows: /uploads/files/<file-id>

Example 1: all media files

Example 2: specific media file with Id 1

Example 3: media files in a range

This example will get all media files within the query range. I.e. 2 files starting at the second in the list.

Example 4: multiple media files by id

Note: This list may change order. It is based on modification date of the files. You may want to verify the query before using it.

Getting dependencies

Dependencies in Strapi are:

  • Relation field

  • Media field

To sync the data of these fields you will need to set contentDependencies flag to true and set the dependency depth to the appropriate level.

Example: get dependencies 1 level deep

This will get any media files and related contents for a content of a collection type that is directly on the content. Any content that has a relationship to the related content will not be picked up.

I.e. Collection type, demo, has a media field and a one-to-one relationship field with related-type. related-type has its own media field. A depth of 1 will sync demo, demo’s media, and related-type. It will not sync related-type’s media field.

Motation Object Support

ObjectSupported

Category

No

Definition

Yes

Domain

No

Folder

Yes

Language

No

Relationship

Yes

Tag

No

Content Mapper

Below are details on how to find the appropriate values to use in the content mapper.

  • origin.uniqueId

    • Collection type's api id

  • fields.origin.uniqueId

    • Field name (case sensitive)

Troubleshooting

  • Dotcms Source Config:

    • If you find the content mapper set up correctly and the job configuration looks correct but the content still is not syncing over despite the job finishing make sure to check if the job option "deliver content types" is set to false this will ensure your content can be synced over correctly

Last updated