Skip to content

Expose an overridable page sections renderer with CMS page context #3603

Open

Description

@lokinmodar

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:

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 contentType without 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-section skipLazyLoadingSection, 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

  1. 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.
  2. Per-Section positioning metadata. Individual siblings cannot coordinate a grid without a shared parent renderer, and this leaks CSS concerns into every Section schema.
  3. Targeting ViewportObserver wrappers with global CSS. The wrapper is an implementation detail and is absent when skipLazyLoadingSection is enabled, so this is not a stable layout contract.
  4. A store-local patch or permanent fork. This works technically but creates avoidable upgrade and security maintenance for every FastStore release.
  5. Multiple page templates only. Templates select content documents and section order, but do not create page regions or column relationships.
  6. 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

  1. changed the title [-]Expose an overridable PDP sections renderer with CMS page settings[/-] [+]Expose an overridable page sections renderer with CMS page context[/+] on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions