Demo implementation of conditional fields in an Entry Editor custom app. Build with create-contentful-app
The Contentful Custom App: Entry Editor Conditional Fields Demo is a demo implementation for using conditional fields within an Entry Editor custom app. Contentful does not provide an out-of-the-box solution for implementing custom fields, so this app serves as a demonstration of how to achieve this functionality. It utilizes a combination of default Contentful fields (rendered with default-field-editors) and custom implementations of fields (rendered with Forma 36 components). The app code can be found in the /src/components/EntryEditor.tsx file, and the conditional fields and their conditions are defined in the conditionalFields.json file. To run this custom app, a Contentful account is required, along with an .env file in the local repository containing the necessary access tokens.
To install and run the Contentful Custom App: Entry Editor Conditional Fields Demo, the following steps need to be followed:
npm start
npm run build
npm run upload
The Contentful Custom App: Entry Editor Conditional Fields Demo is a useful demo implementation for implementing conditional fields within an Entry Editor custom app. It provides a workaround for the lack of out-of-the-box custom field functionality in Contentful. By utilizing a combination of default Contentful fields and custom field implementations, this app effectively manages the state of the fields and allows for the definition of conditional fields and their conditions. The installation process involves cloning the repository, adding the necessary access tokens to the .env file, and running a few npm commands to start, build, and upload the app. Overall, this demo is a valuable resource for developers looking to implement custom fields in Contentful.