This article presents possible use cases and corresponding sample flows that you can support. This can be a helpful starting point as you plan your implementation.
You can use the Data Collections API to set up a site's tutorials section by first creating collections for categories and authors to organize content, and then creating a tutorials collection that references those collections.
To set up the collections:
Call Create Data Collection to create a categories collection. Include the following properties in your request:
In the fields array, include fields with these recommended values for type:
title, slug, description, and videoUrl: TEXTicon: IMAGEsortOrder: NUMBER
Call Create Data Collection to create an authors collection. Include the following properties in your request:
In the fields array, include fields with these recommended values for type:
name, slug, bio, and email: TEXTphoto: IMAGEsocialLinks: OBJECT
Call Create Data Collection to create a tutorials collection. Include the following properties in your request:
In the fields array, include fields with these recommended values for type:
title, slug, and description: TEXTcontent: RICH_TEXTpublishDate: DATETIMEfeatured: BOOLEANestimatedTime: NUMBER for the reading time in minutes.
Also include the following fields to add cross references to your categories and authors collections created earlier.
category: with type set to MULTI_REFERENCE and typeMetadata.multireference.referencedCollectionId set to categories.author: with type set to MULTI_REFERENCE and typeMetadata.reference.referencedCollectionId set to authors.
Set permissions to control the collection's access as follows:
read: ANYONE so visitors can view tutorialsinsert, update, and remove: ADMIN so only site owners can manage content.
Call Get Data Collection with dataCollectionId set to tutorials to retrieve the full collection schema and confirm all fields are configured correctly.
You can enable draft and publish functionality for a site's content by adding a publish plugin to a collection. This allows content creators to save work in progress without making it visible to site visitors.
To add publish functionality:
plugin.type to PUBLISH and plugin.publishOptions.defaultStatus to DRAFT so new content is created as a draft by default.