diff --git a/examples/cms-prismic/README.md b/examples/cms-prismic/README.md index df5c6c168a454..ed2d863afbd9e 100644 --- a/examples/cms-prismic/README.md +++ b/examples/cms-prismic/README.md @@ -53,6 +53,8 @@ Next, add these fields (you don't have to modify the settings): - `name` - **Key Text** field - `picture` - **Image** field +Alternatively, you can copy the JSON in [`types/author.json`](types/author.json), then click on **JSON editor** and paste it there. + Save the type and continue. ### Step 3. Create a `post` type @@ -71,6 +73,8 @@ Next, add these fields (you don't have to modify the settings unless specified): - `author` - **Content relationship** field, you may also add `author` to the **Constraint to custom type** option to only accept documents from the `author` type. - `slug` - **UID** field. +Alternatively, you can copy the JSON in [`types/post.json`](types/post.json), then click on **JSON editor** and paste it there. + Save the type and continue. ### Step 4. Populate Content diff --git a/examples/cms-prismic/types/author.json b/examples/cms-prismic/types/author.json new file mode 100644 index 0000000000000..c9659d4b3aa33 --- /dev/null +++ b/examples/cms-prismic/types/author.json @@ -0,0 +1,18 @@ +{ + "Main": { + "name": { + "type": "Text", + "config": { + "label": "name" + } + }, + "picture": { + "type": "Image", + "config": { + "constraint": {}, + "thumbnails": [], + "label": "picture" + } + } + } +} diff --git a/examples/cms-prismic/types/post.json b/examples/cms-prismic/types/post.json new file mode 100644 index 0000000000000..303fe0eeafc22 --- /dev/null +++ b/examples/cms-prismic/types/post.json @@ -0,0 +1,52 @@ +{ + "Main": { + "title": { + "type": "StructuredText", + "config": { + "single": "heading1, heading2, heading3, heading4, heading5, heading6", + "label": "title" + } + }, + "content": { + "type": "StructuredText", + "config": { + "multi": "paragraph, preformatted, heading1, heading2, heading3, heading4, heading5, heading6, strong, em, hyperlink, image, embed, list-item, o-list-item, o-list-item", + "label": "content" + } + }, + "excerpt": { + "type": "Text", + "config": { + "label": "excerpt" + } + }, + "coverimage": { + "type": "Image", + "config": { + "constraint": {}, + "thumbnails": [], + "label": "coverimage" + } + }, + "date": { + "type": "Date", + "config": { + "label": "date" + } + }, + "author": { + "type": "Link", + "config": { + "select": "document", + "customtypes": ["author"], + "label": "author" + } + }, + "uid": { + "type": "UID", + "config": { + "label": "slug" + } + } + } +}