Session 2 β JCR & content modelling basics
Purpose: Understand the repository as a tree of nodes and properties, and learn the principles for modelling page content well.
Who this page is for
| Audience | Why it matters to you |
|---|
| All engineers | Content modelling decisions outlive code decisions |
The repository is a tree
The JCR is one big tree β think a persistent Redux store with paths instead of selectors. Every node has a type, properties, and children. Every piece of the PHI plan page is a node you can inspect in CRXDE.
/content/phi/plans/gold-hospital β cq:Page (the route)
βββ jcr:content β the page's state
βββ root/ β layout container
β βββ hero/ β component node (resourceType: .../herobanner)
β β βββ title = "Gold Hospital Cover"
β β βββ image = /content/dam/phi/gold-hero.jpg
β βββ benefits/ β benefits table component
β βββ cta/ β call-to-action component
βββ (page props: jcr:title, template, β¦)
Well-known top-level paths
| Path | Holds | Rule of thumb |
|---|
| /content | Pages and site content | Authors own it |
| /content/dam | Assets (images, PDFs) | Authors own it |
| /apps | Your code: components, templates' code side | Developers own it; immutable in prod |
| /conf | Editable templates, policies, CF models | Governed collaboration |
| /etc | Legacy shared config | Avoid adding new things here |
| /var | Runtime data (workflows, audit) | Machines own it |
Modelling principles
| Principle | Meaning | PHI example |
|---|
| Model content, not layout | Store facts; let components present them | Store excessAmount: 500, not "$500 excess" markup |
| One source of truth | Shared data lives once, referenced everywhere | Disclaimers as a Content Fragment, referenced by all plan pages |
| Structure for authors | The tree should match how authors think | Benefits as child nodes, one per row β not a JSON blob property |
| Respect the hierarchy | Inheritance and permissions follow paths | All plans under /content/phi/plans/ inherit that subtree's ACLs |
Node types you will meet constantly
| Type | Meaning |
|---|
cq:Page / cq:PageContent | A page and its content payload |
nt:unstructured | Free-form node β most component content |
dam:Asset | An asset with renditions under it |
sling:Folder / sling:OrderedFolder | Organisational folders |