Skip to content

Commit

Permalink
Improved steps for examples/cms-prismic (#11935)
Browse files Browse the repository at this point in the history
Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
Luis Alvarez D and ijjk authored Apr 16, 2020
1 parent 5d0932c commit 42a328f
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/cms-prismic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
18 changes: 18 additions & 0 deletions examples/cms-prismic/types/author.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"Main": {
"name": {
"type": "Text",
"config": {
"label": "name"
}
},
"picture": {
"type": "Image",
"config": {
"constraint": {},
"thumbnails": [],
"label": "picture"
}
}
}
}
52 changes: 52 additions & 0 deletions examples/cms-prismic/types/post.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}

0 comments on commit 42a328f

Please sign in to comment.