Made ways to get involved a single-document schema

This commit is contained in:
Michael Fatemi 2020-11-29 00:29:23 -05:00
parent d654e46587
commit e4b79e44a3
2 changed files with 39 additions and 16 deletions

View File

@ -2,7 +2,8 @@ import S from '@sanity/desk-tool/structure-builder';
const notSingletonPage = listItem => ![
"mission",
"footer"
"footer",
"get_involved",
].includes(listItem.getId())
export default () =>
@ -17,7 +18,7 @@ export default () =>
.schemaType("mission")
.documentId("mission")
),
S.listItem()
S.listItem()
.title("Footer")
.child(
S.editor()
@ -25,5 +26,13 @@ export default () =>
.schemaType("footer")
.documentId("footer")
),
S.listItem()
.title("Get Involved")
.child(
S.editor()
.id("get_involved")
.schemaType("get_involved")
.documentId("get_involved")
),
...S.documentTypeListItems().filter(notSingletonPage)
]);

View File

@ -1,22 +1,36 @@
export default {
name: "get_involved",
title: "Way to get involved",
title: "Get involved",
type: "document",
__experimental_actions: [ 'update', 'publish', 'create' ], // removing 'delete'
fields: [
{
name: "title",
title: "Title",
type: "string"
},
{
name: "text",
title: "Text",
type: "text"
},
{
name: "priority",
title: "Priority",
type: "number"
name: "ways",
title: "Ways To Get Involved",
type: "array",
of: [{
name: "way",
title: "Way To Get Involved",
type: "document",
fields: [
{
name: "title",
title: "Title",
type: "string"
},
{
name: "text",
title: "Text",
type: "text"
},
{
name: "priority",
title: "Priority",
type: "number"
}
]
}]
}
]
}