Lab 2 — Model the plan page content
Purpose: Design and hand-build the content tree for the PHI gold-tier hospital cover plan page in CRXDE, before any code exists.
Who this page is for
| Audience | Why it matters to you |
|---|---|
| All engineers | Pairs with Session 2 |
Goal
Build the content structure for the plan page by hand, so you experience content as data. No Java, no HTL yet.
Steps
- In CRXDE, under your Lab 1 page's
jcr:content/root, create nodehero(nt:unstructured) with properties:
title = "Gold Hospital Cover", subtitle = "Top-tier cover for private hospital treatment".
- Create node
planfactswith typed properties:monthlyPremium(Double) = 289.50,excessAmount(Long) = 500,
waitingPeriodMonths (Long) = 2, isGoldTier (Boolean) = true.
- Create node
benefits, and under it one child per benefit row:
benefit-1 → label = "Private room", covered = true; benefit-2 → label = "Ambulance", covered = true; benefit-3 → label = "Cosmetic surgery", covered = false.
- Save All, then view the tree as JSON in your browser:
/content/<your-site>/plans/gold-hospital/jcr:content.infinity.json
Reflect
| Question | Point being made |
|---|---|
| Why typed properties instead of all strings? | Models and queries get real types; authors get proper dialog fields later |
| Why one node per benefit instead of a JSON string property? | Authors can add/remove/reorder rows; queries can target rows; models can iterate children |
| What renders this content right now? | Nothing — content exists independently of any component. That decoupling is the point |
Stretch
Add a second plan page silver-hospital with the same structure and different values — notice how the structure is the reusable contract, exactly like a TypeScript interface for props.