Pages & blocks
Overview
- Scope
- pages, page_sections, page_translations, PageViewAssembler and content editor modes
Key concepts
- Full Slug
- The unique URL path generated from the page section path and page slug.
- Editor Mode
- Page content mode; PageViewAssembler has explicit blocks and rich branches.
- Base Block
- A block in pages.data_json with a stable id, type, zone, and data payload.
- Translation Block Override
- Localized data matched to a base block by its id and merged into that block's data.
Structure
- Tables
- Page Sections
- parent_id
- name
- slug
- sort
- is_active
- Pages
- section_id
- slug
- full_slug
- status
- published_at
- editor_mode
- layout_key
- view_path
- allowed_roles
- data_json
- derived_meta
- Page Translations
- page_id
- locale
- title
- excerpt
- data_json
- content_overrides
- seo
- Page Sections
- Services
- Assemblyapp/Page/PageViewAssembler.php
- Layoutsapp/Page/Layouts/
- Blocksapp/Page/Blocks and app/Services/Cms/Engine/Blocks
- Rich Editorapp/Services/Cms/Engine/EditorJs
Facts
- page_sections supports an optional self-parent relation, unique sibling slugs, and parent/sort indexing. authoritative
- Page saving recomputes full_slug; pages.full_slug is unique and pages also enforce unique section_id/slug pairs. authoritative
- Pages persist draft status by default, publication timestamp, SEO index/follow booleans, allowed roles, global data, and derived metadata. authoritative
- Page translations are unique per page and locale and persist title, excerpt, localized data, content overrides, and SEO data. authoritative
- Page::visibleOnSite leaves pages with no site relations visible everywhere and includes linked pages only for the requested Site. authoritative
- BlockMerger normalizes base and localized block documents, matches blocks by id, and merges only the translated data into the base block. authoritative
- PageViewAssembler resolves a registered layout and its content view; blocks mode supplies merged blocks and rich mode normalizes and renders Editor.js data. authoritative
How-to guides
Create Localized Block Page
- create or select the section and page with layout_key and editor_mode
- persist base blocks with stable ids in page data
- create one page translation per locale with text/data overrides keyed by base block id
- resolve through PageViewAssembler and verify the selected locale
Change Page Layout
- verify the target layout is registered and its mode-specific view exists
- map existing page data to the target layout/block contract
- persist layout_key and render preview before publishing
Rules
Architectural rule
Keep base block ids stable across locales because localized block data resolves by id.
Architectural rule
A page layout key must resolve to a registered layout with a view for its editor mode; otherwise public rendering returns a service-unavailable error.