8.2 KiB
8.2 KiB
Payload Schema — Product Collection (Final)
Purpose
Single source of truth for the Product collection in Payload. This is the version that will be implemented in code. All product detail pages (system-rendered layout and project-local HTML templates) depend on this schema.
Collection Slug
products
Localization
- Locales:
en,zh - Each locale can be edited and published independently.
- Fields marked localized below use Payload field-level localization.
- Fields marked shared are global and the same across locales.
Access Control
- Public read: only documents with
status = published. - Write: authenticated editors and above.
- Admin-only fields:
seo.noIndex,template,firmware.showOnProductPage,firmware.showInDownloadsCenter.
Status Workflow
draftreviewpublishedarchived
Fields
1. Identity
slug— localized — text, required, unique per locale, URL-safe.model— shared — text, required. The marketing model name, for exampleDMP-A10.status— shared — select, required, one ofdraft | review | published | archived.order— shared — number, default 0. Used for manual ordering inside category listings.category— shared — relationship toproductCategories, required.
2. Template Selection
template— shared — select, required, options dynamically enumerated from valid directories underwebroot/Products/. If no templates exist, the UI falls back to the default system-rendered layout.templateEnabled— shared — checkbox, default false. When true, the product detail route injects the HTML template into the middle content region. When false, the default system-rendered layout is used even if a template is selected.
3. Marketing Copy (localized)
name— localized — text, required. Display name shown in cards and headings.tagline— localized — text. One-line descriptor used in product cards and hero.summary— localized — rich text. Short paragraph used on overview pages.overview— localized — rich text. Longer intro used in the system-rendered layout.
4. Media
heroImage— shared — upload, required. Used in the top of default-rendered product pages and as card image.cardImage— shared — upload, optional. Optional override for the featured product card. Horizontal composition preferred to align with homepage visual spec.gallery— shared — array of uploads, optional. Ordered product imagery.lifestyleImage— shared — upload, optional. Used for lifestyle placement in listings or cross-links.heroVideo— shared — group, optional.src— upload or URL.poster— upload.
5. Key Features (localized content, shared structure)
keyFeatures — array, 0 to 8 items.
Per item:
icon— shared — upload, optional.image— shared — upload, optional.title— localized — text, required.description— localized — rich text.
6. Technology Highlights (localized)
technologyHighlights — localized — rich text with blocks.
Allowed blocks:
textBlockimageTextBlockquoteBlock
7. Specifications
specifications — array of spec groups.
Per group:
groupName— localized — text, required.order— shared — number, default 0.items— array.label— localized — text, required.value— localized — text, required.note— localized — text, optional.
8. Firmware (display is opt-in)
firmware — group.
showOnProductPage— shared — checkbox, default false. Controls whether firmware is displayed on the product detail page.showInDownloadsCenter— shared — checkbox, default false. Controls whether this product's firmware appears in the site-wide Downloads center.displayLabel— localized — text, optional. Overrides the default section title on the product page.items— relationship todownloads, filtered totype = firmware, multi-select, ordered.notes— localized — rich text, optional. Release notes or compatibility notes rendered above the list.
UI rules:
- The two visibility toggles are independent. Either can be on or off without affecting the other.
itemsandnotesare edited independently of the toggles; disabling both toggles hides firmware from public UI but preserves data.- Payload UI should clearly show current visibility status on each product record.
9. Downloads (non-firmware)
downloads — group.
manuals— relationship todownloads, filtered totype = manual, multi-select.software— relationship todownloads, filtered totype = software, multi-select.other— relationship todownloads, filtered totype = other, multi-select.
These are always available on the product page when entries exist. The firmware module is separated because its visibility is opt-in.
10. Relations
relatedProducts— relationship toproducts, multi-select, up to 4.accessories— relationship toproducts, multi-select, optional.featuredDealers— relationship todealers, multi-select, optional.
11. Awards and Reviews (optional on detail page)
awards — array, optional.
Per item:
logo— shared — upload.label— localized — text.year— shared — number.url— shared — URL, optional.
reviews — array, optional.
Per item:
sourceLogo— shared — upload, optional.sourceName— localized — text.quote— localized — text, required.url— shared — URL, optional.
12. SEO
seo — group, localized.
title— text, max 70 chars.description— textarea, max 160 chars.ogImage— upload.canonical— text, optional.noIndex— checkbox, admin-only, default false.
13. Timestamps (auto)
createdAtupdatedAtpublishedAt
Hooks
beforeValidate:- Normalize
slug(lowercase, trim, ASCII fallback, dashes).
- Normalize
beforeChange:- Auto-set
publishedAtwhenstatustransitions topublishedfor the first time. - If
templaterefers to a non-existent directory, reject with a validation error.
- Auto-set
afterChange:- Trigger on-demand revalidation for
/en/products,/zh/products,/en/products/<slug>,/zh/products/<slug>. - Trigger revalidation for Homepage if the product is part of
Homepage.featuredProducts.
- Trigger on-demand revalidation for
Admin UI Layout (recommended tabs)
Overview— identity, status, template, name, tagline, summary, category, order.Content— overview, keyFeatures, technologyHighlights, specifications.Media— heroImage, cardImage, gallery, lifestyleImage, heroVideo.Firmware— firmware group.Downloads— downloads group.Relations— relatedProducts, accessories, featuredDealers.Recognition— awards, reviews.SEO— seo group.
Rendering Rules (summary)
- If
templateEnabledis true andtemplateresolves to a valid directory, render:- Header (from main layout)
- Breadcrumb (from main layout)
- Optional hero block (from CMS)
- Middle content region populated by
webroot/Products/<template>/<locale>/index.html - Firmware module (only if
firmware.showOnProductPage) - Related downloads, related products, recognition (if present)
- Footer (from main layout)
- Otherwise, render the default system-rendered layout using the structured fields above.
- The site-wide Downloads center lists firmware entries only for products with
firmware.showInDownloadsCenter = true.
Validation Rules
slugmust be unique per locale.modelrequired.categoryrequired.heroImagerequired.templaterequired; must reference an existing directory.firmware.itemsmust all havetype = firmware.awards[].yearmust be between 1990 and current year + 1.- At least one locale must have
status = publishedbefore the product is publicly visible.
Open Items
- Whether
statusshould be a per-locale field to allow a product to go live in EN before ZH. - Whether
templateEnabledtoggle is visible to all editors or admin-only. - Whether recognition (awards, reviews) should also live at brand level, not just per product.