Skip to content

Commit

Permalink
use costumer cases and add language field
Browse files Browse the repository at this point in the history
  • Loading branch information
christinaroise committed Sep 3, 2024
1 parent 637dd41 commit 6cec3f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 43 deletions.
49 changes: 6 additions & 43 deletions studioShared/deskStructure.ts
Original file line number Diff line number Diff line change
@@ -1,54 +1,17 @@
import { i18n } from "languages";
import {
StructureResolver,
DefaultDocumentNodeResolver,
} from "sanity/structure";
import { blogPostsID } from "studioShared/schemas/documents/blogPosts";
import { StructureResolver } from "sanity/structure";
import { customerCasesID } from "./schemas/documents/customerCases";

export const deskStructure: StructureResolver = (S) =>
S.list()
.title("Content")
.items([
S.listItem()
.title("Blogposts sorted by base language")
.title("Costumer cases")
.child(
S.documentTypeList(blogPostsID)
.title("List of Blogposts")
S.documentTypeList(customerCasesID)
.title("Costumer cases")
.filter("_type == $type && language == $lang")
.params({ type: blogPostsID, lang: i18n.base })
.params({ type: customerCasesID, lang: i18n.base })
),
S.listItem()
.title("Blogposts sorted into language folders")
.child(
S.list()
.title("Blogposts")
.items([
S.listItem()
.title("Blogposts (EN)")
.child(
S.documentTypeList(blogPostsID)
.title("List of Blogposts (EN)")
.filter("_type == $type && language == $lang")
.params({ type: blogPostsID, lang: "en" })
),
S.listItem()
.title("Blogposts (NO)")
.child(
S.documentTypeList(blogPostsID)
.title("List of Blogposts (NO)")
.filter("_type == $type && language == $lang")
.params({ type: blogPostsID, lang: "no" })
),
S.listItem()
.title("Blogposts (SE)")
.child(
S.documentTypeList(blogPostsID)
.title("List of Blogposts (SE)")
.filter("_type == $type && language == $lang")
.params({ type: blogPostsID, lang: "se" })
),
// Add more languages as needed
])
),
// Other items can be added here if needed
]);
5 changes: 5 additions & 0 deletions studioShared/schemas/documents/customerCases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const customerCases = defineType({
type: "document",
title: "Costumer Cases",
fields: [
defineField({
name: "language",
type: "string",
readOnly: true,
}),
title,
titleSlug,
defineField({
Expand Down

0 comments on commit 6cec3f5

Please sign in to comment.