Integration Fields with Slice Machine has been a highly requested feature request. The field isn't yet available in the Slice Machine Interface, but that doesn't mean you can't use it already.
Here's the temporary solution to add Integration fields to your documents:
- First, ensure Integration Fields are enabled in your repository. If you don't have it, reach out to us so that we can activate it for you. Then add your catalog.
- Open your project in your favorite code editor. Run Slice Machine
- Find the
index.json
of the Custom Type or themodel.json
of your Slice and add the integration Field:
"api_id": {
"type": "IntegrationFields",
"config": {
"catalog": "my-repository--your_store",
"label": "Here goes the field name",
"placeholder": "This is the field placeholder..."
}
}
- Add a new name for the
api_id
of the field and modify thecatalog
value to match repository settings. For example, if your repository is called lorem and your Integration catalog is called my store, the value will be:"catalog": "lorem--my_store"
. - Save your JSON file, Push your changes to Prismic, and you're done. Now you can visualize and use your integration field in the documents!