Contentful
The destination Contentful connector allows content to be transformed from Motation and synced to Contentful.
Specifics
The destination Contentful connector is able to sync both content and files (as references).
Entry Ids
Contentful uses a unique id for each entry. When creating and updating entries, Impulse will use the id from the source system. If the id exists, it will update the content, if not it will create it. According to the documentation, the id has to match this regex /^[a-zA-Z0-9-_.]{1,64}$/
. If the id does not match this regex, it will be cleaned and removed all characters that do not match the regex.
Content Status
Contentful has support for 4 status:
Draft: A draft entity is not published
Changed: An updated entity is published but has pending changes
Published: A published entity is published and has not been modified since
Archived: An archived entity is not published and can not be edited
Note: File Assets only support Draft and Published status.
Matrix of Entry status after Sync
Matrix | Destination - Draft | Destination Changed | Destination - Published | Destination Archived |
---|---|---|---|---|
Source - Draft | Draft | Changed | Changed | Draft |
Source - Changed | Draft | Changed | Changed | Draft |
Source - Published | Published | Published | Published | Published |
Source - Archived | Archived | Archived | Archived | Archived |
For example: If an entry is Changed in the source, and Published in the destination, after the sync, the entry will be updated in the destination and the status will be Changed.
Endpoint Config
When saving an endpoint for a Contentful repository via REST instead of the UI you must use the following key:value pairs in the payload.
contentRepo:contentful
contentRepoVersion:latest
Token
Contentful API requires a token for authentication. This token must be provided in the adapter write config. The easiest option is to create a new "Content management token" for a Contentful user and pass that to Impulse.
Content types
Content types are not synced by Impulse. A content type must already exist to sync content to. Use the content mapper to align the incoming content to the existing content type.
Spaces
Spaces are treated as equivalent to Motation's Domains. New synced domains will become new spaces in Contentful. It's required to specify the Space you want to sync to. For this there is a job option that can be set to determine the specific spaces that content should be synced to.
Environments
Motation does not support environments so new environments will not be synced. By default content will ignore environments.
Locales
Locales are roughly equivalent to Motation's Languages. However, they are not supported yet. It wil use the default locale of the space.
Pickup Date time
Setting a time zone is not supported. You must provide the time for the time zone the system uses.
Number (Integer)
The Number (Integer) field type is supported however the value sent to the destination connector must be an integer. Otherwise it will default to 0. I.e.,if the value 7.000
is sent to the destination connector, the value saved to the system will be 0
not 7
. This can be solved using manipulators such as a Liquid manipulator to round the value to an integer.
Supported Fields
Text (Short)
Text (Long): Besides its standard use, this field will, also, be used to store any WYSIWYG content from other systems.
Number (Integer)
Number (Decimal)
Date and time
Boolean
Media
Reference
JSON Object
Array: Handled as an array of only strings.
Rich text: This field is handled internally by Contentful using a custom hierarchy. What makes this a System Field. What it means is that it will be synced only to Contentful and not other systems.
Unsupported Fields
Location
Unsupported Operations
Syncing Locales.
Creating "folders" in Contentful.
Adapter Properties
Property | Purpose |
---|---|
token | The content management token to use Contentful's API. |
space | The space that should be searched for content and content should be synced to. |
environment | The environment that should be searched for content and content should be synced to. |
rateLimitPerSecond | It is used to control the rate at which certain operations can be executed to prevent excessive usage or abuse of resources (default: 7). |
Job Options
Name | Description | Data Type | Required | Default Value |
---|---|---|---|---|
space | The space that should be searched for content and content should be synced to. | Text | Yes | No Default Value |
environment | The environment that should be searched for content and content should be synced to. | Text | Yes | No Default Value |
contentType | The content type to search for. | Text | Yes | No Default Value |
entry | Entry id will be searched and synced, sync job will only sync this specific entry | Text | No | No Default Value |
dependenciesDepth | The max depth to look for dependencies. Files assets are dependencies. | Integer | No | 1 |
contentDependencies | If dependencies should be picked up. Files assets are dependencies. | Boolean | No | false |
query | Query params to add to the request to find contents to pickup. Follows the standard query params from the contentful doc. | Text | No |
space Job Option
The value of the each space
option should be the ID of the space Impulse should check and sync content to.
environment Job Option
The value of the each environment
option should be the ID of the space Impulse should check and sync content to.
contentType Job Option
The value of the contentType
job option should match the Content Type ID from Contentful for the content type being checked/synced to.
Syncing all media files / assets
Use the following value for the contentType
job option to sync all media files / assets.
Troubleshooting
When syncing file assets from a Source to this destination with no content type attached you will need to set up a "dummy" content type with a media field in order to sync it over correctly with the content mapper.
Last updated