diff --git a/studioShared/lib/queries/customerCases.ts b/studioShared/lib/queries/customerCases.ts index 1e967e00e..192bc47d1 100644 --- a/studioShared/lib/queries/customerCases.ts +++ b/studioShared/lib/queries/customerCases.ts @@ -17,9 +17,17 @@ export const CUSTOMER_CASES_QUERY = groq` } `; +const INTERNATIONALIZED_IMAGE_FRAGMENT = groq` + "alt": ${translatedFieldFragment("alt")}, + "url": asset -> url +`; + export const CUSTOMER_CASE_QUERY = groq` *[_type == "customerCase" && ${translatedFieldFragment("slug")} == $slug][0] { ${CUSTOMER_CASE_BASE_FRAGMENT}, + "image": image { + ${INTERNATIONALIZED_IMAGE_FRAGMENT} + }, "richText": ${translatedFieldFragment("richText")}, "projectInfo": projectInfo { customer, @@ -36,8 +44,7 @@ export const CUSTOMER_CASE_QUERY = groq` }, _type == "imageBlock" => { "images": images[] { - "alt": ${translatedFieldFragment("alt")}, - "url": asset -> url + ${INTERNATIONALIZED_IMAGE_FRAGMENT} } } } diff --git a/studioShared/schemas/documents/customerCase.ts b/studioShared/schemas/documents/customerCase.ts index 6cf08f1e7..4e2c84c5f 100644 --- a/studioShared/schemas/documents/customerCase.ts +++ b/studioShared/schemas/documents/customerCase.ts @@ -1,6 +1,7 @@ import { defineField, defineType } from "sanity"; import { isInternationalizedString } from "studio/lib/interfaces/global"; +import { internationalizedImage } from "studio/schemas/fields/media"; import { richTextID, titleID } from "studio/schemas/fields/text"; import { titleSlug } from "studio/schemas/schemaTypes/slug"; import { firstTranslation } from "studio/utils/i18n"; @@ -31,6 +32,11 @@ const customerCase = defineType({ description: "Short paragraph displayed at the top of the customer case page", }), + defineField({ + ...internationalizedImage, + title: "Main Image", + description: "Large image displayed at the top of the customer case page", + }), defineField({ ...customerCaseProjectInfo, options: {