Repository navigation
Description
Describe the feature you'd like
Expose an opt-in, overridable renderer for a CMS page's top-level sections. The renderer should receive the page contentType, page settings, and section descriptors while preserving the existing RenderSections behavior by default.
CMS (Content Platform) content types can declare page-level settings in addition to sections. FastStore pages already receive that data, but RenderSections only receives sections, globalSections, and components. Consequently, a store can model a page-level layout choice, but cannot use it to arrange independently authored top-level sections without patching a generated page or creating a monolithic "layout section".
Current behavior in dev:
RenderSectionsBaserenders a flatsections.map(...): packages/core/src/components/cms/RenderSections.tsx.- The Home page has both
sectionsandsettings, but passes only sections to the renderer: packages/core/src/pages/index.tsx, render call. - Landing Page and Product Listing templates follow the same pattern: LandingPage.tsx, ProductListing.tsx.
- The PDP destructures
settings, but only consumes known SEO fields before invoking the same flat renderer: packages/core/src/pages/[slug]/p.tsx, render call. - Native CMS content type schemas allow page properties and top-level sections but do not prescribe a storefront layout implementation: CMS page schemas.
A minimal public capability could let store code provide a page sections renderer with a contract equivalent to:
type PageSectionsRendererProps = {
contentType: string
sections: Section[]
settings?: Record<string, unknown>
renderSections: (sections: Section[]) => ReactNode
}The exact API name and customization mechanism are open for maintainer guidance. The important behavior is that store code can partition or group top-level sections and delegate each subset back to the native renderer instead of duplicating section resolution, error boundaries, lazy loading, preview behavior, or global sections.
Acceptance criteria:
- The default output and DOM remain unchanged when no store customization is provided.
- The extension is content-type agnostic; native and custom content types can provide their identifier and settings.
- A store customization can select behavior by
contentTypewithout defining separate core hooks for PDP, PLP, Home, Search, or future page types. - A custom renderer can arrange subsets of top-level sections while delegating the actual section rendering to the existing FastStore pipeline.
SectionBoundary,ViewportObserver, per-sectionskipLazyLoadingSection, preview behavior, global sections, Toast, SSG/ISR, SEO, and JSON-LD behavior remain owned by FastStore.- The feature is opt-in and does not add store-specific layouts, section names, CSS, or CMS enums to
@faststore/core. - Browser tests cover the unchanged default path, page context forwarding, and a custom renderer path.
- The store customization contract and a minimal example are documented.
Describe alternatives you've considered
- A layout Section containing nested components/slots. This makes the page composition one CMS Section, so child blocks are no longer independently placeable top-level Sections and the parent must reproduce rendering behavior.
- Per-Section positioning metadata. Individual siblings cannot coordinate a grid without a shared parent renderer, and this leaks CSS concerns into every Section schema.
- Targeting
ViewportObserverwrappers with global CSS. The wrapper is an implementation detail and is absent whenskipLazyLoadingSectionis enabled, so this is not a stable layout contract. - A store-local patch or permanent fork. This works technically but creates avoidable upgrade and security maintenance for every FastStore release.
- Multiple page templates only. Templates select content documents and section order, but do not create page regions or column relationships.
- One extension per native content type. This duplicates the same contract and excludes future custom content types.
Additional context
The initial use case is a Content Platform PDP composed of independent product sections with a page-level layout variant. That use case exposed a general gap: page settings and top-level section rendering cannot currently meet at a supported store customization boundary.
Layout recipes remain store-owned. FastStore only exposes the safe rendering boundary. This proposal intentionally does not request arbitrary CSS grid values in CMS, a layout DSL, store-specific variants, or changes to Headless CMS (legacy).
References
Activity
[-]Expose an overridable PDP sections renderer with CMS page settings[/-][+]Expose an overridable page sections renderer with CMS page context[/+]