Overview
The Contentful List Field is an app that provides a custom entry field for JSON objects. It allows users to display a key-value list and provides options for creating Select options in the entry editor. This project is built with Create Contentful App.
Features
- Custom Entry Field: The app provides a custom entry field for JSON objects.
- Key-Value List: It displays a key-value list for the JSON objects.
- Select Options: Users can pass options when creating a Content Model, which will be used as Select options in the entry editor.
Installation
To install the Contentful List Field, you can use the following scripts:
- npm start: This command creates or updates your app definition in Contentful and runs the app in development mode. It opens your app in the browser and reloads the page if you make edits.
- npm run build: This command builds the app for production and optimizes it for performance. The build is minified and ready to be deployed.
- npm run upload: This command uploads the build folder to Contentful and creates a bundle that is automatically activated. It guides you through the deployment process and asks for all required arguments.
- npm run upload-ci: Similar to
npm run upload, this command uploads your app to Contentful and activates it. The only difference is that it reads all required arguments from the environment variables, making it suitable for CI pipelines.
To use Contentful List Field and make it look and feel like Contentful, you can use the following libraries:
- Forma 36: Contentful’s design system.
- Contentful Field Editors: React components for Contentful’s field editor.
- contentful-management SDK: Use the SDK and the contentful-management package to create an instance of the contentful-management client using the cmaAdapter without passing the access token.
For detailed usage and more information, please refer to the contentful-management documentation.
Summary
The Contentful List Field app is a useful tool for displaying key-value lists for JSON objects in Contentful. It provides custom entry fields and options for creating select options in the entry editor. With easy installation and integration with Contentful’s design system and field editors, the app enhances the functionality and user experience of Contentful.