Session 6 β Templates, policies & pages
Purpose: Understand editable templates: how page structure, initial content and component policies govern what authors can build.
Who this page is for
| Audience | Why it matters to you |
|---|---|
| All engineers | Templates are where component work meets site governance |
What an editable template is
A React layout component decides structure in code. An editable template does it as governed content in /conf: structure (fixed regions), initial content (starting state of new pages), and policies (what authors may do where).
/conf/phi-academy/settings/wcm/
βββ templates/plan-page/
β βββ structure/ β locked page skeleton (header, main container, footer)
β βββ initial/ β pre-seeded content for NEW pages (empty plan-card, disclaimers)
β βββ policies/ β which policies apply where
βββ policies/ β the policy definitions themselves
| Template part | React analogy | Editable by |
|---|---|---|
| Structure | The layout JSX around {children} | Template authors only |
| Initial content | Default props/state for new pages | Copied into each new page, then diverges |
| Policies | PropTypes + allowed-children constraints | Template authors |
Policies in practice
A policy on the main container answers: which component groups are offered here? A policy on a component answers: which of its options are enabled? (e.g. allowed styles from the Style System, permitted embed types).
For the PHI plan page template:
| Region | Policy decision |
|---|---|
| Header/footer | Locked in structure β authors cannot touch |
| Main container | Allows "PHI Academy" group (plan-card, benefits table, CTA) + text/image |
| Plan-card | Style policy offers "featured" and "compact" variants |
Pages from templates
Every page stores a pointer to its template (cq:template). Structure changes propagate to existing pages; initial content affects only new pages. That asymmetry is the number-one template surprise β remember it.
Design notes
- Fewer templates, more policies: one flexible "content page" template with well-designed policies beats ten rigid templates.
- Lock what must be consistent (branding regions); free what must vary (main content).
- Template changes are content-ops changes: they ship via /conf packages and need the same review discipline as code.