Uniform's Mesh framework lets you configure your project to access multiple external data sources through the Canvas UI. Mesh separates the integration from data source connection details, allowing your project to have multiple connections of the same type if necessary (such as Contentful Spaces). Mesh also allows for multiple data types for each data source (such as single entry, multiple entries, query).
For this exercise you will configure your project to access JavaDrip articles from a headless CMS. During the lesson you will:
- Configure a data source that represents a headless CMS.
- Configure a data type for the Article content type.
- Use the data type to display content from the headless CMS.
Configure data source#
- In Uniform, navigate to Integrations.
- Add the Contentful integration to the project.
- Navigate to Experience > Data Types.
- Click Add data type.
- In the dropdown, select Contentful > Create new.
- In the section Contentful settings, enter the values that correspond to your Contentful space.
- Enter the following values:
Field Value Space
Content Delivery API (CDA) Access Token
Environment ID (Optional)
- Click Save.
- Since this is a new data source, Uniform opens the Create data type dialog.The opened dialog to create a new data type.
Now you'll select a data type to configure.
Configure data type#
- From the dropdown Archetype, select Single Entry.
- Select the following values:
Field Value Allowed Content Types Article Image thumbnail field name Thumbnail (Media) [Expand "more optional settings"] Search by field Title Name
- Click Save and Test.An example of what the editor will see when using the data type is displayed.
- Select one of the articles.
- Click Fetch Test Data.An example of the data that's available for the selected article is displayed.
- Click Done to continue.