# Doctor Individual Page — Drupal Mapping

**Page route:** `/doctor/<slug>` — driven by `node--doctor` content type with full view mode.

This document maps each section of `html/doctor-individual.html` to the Drupal Twig template, content type field, and Views block (where applicable) that should render it.

## Content type & taxonomy

### `node--doctor` (new content type)

Recommended fields (machine names per existing CFS naming):

| Field | Type | Required | Notes |
|---|---|---|---|
| `name` (node title) | string | yes | "Prof. Dr. Mahipal S Sachdev" |
| `field_qualifications_summary` | text (long, plain) | yes | One-line lead, e.g. "Padma Shri Awardee, Cataract & Refractive Surgeon" |
| `field_doctor_photo` | image | yes | Cropped to ~497×326, top-anchored object-cover |
| `field_years_of_experience` | integer | yes | 42 → renders "{N}+ Years of Experience" |
| `field_primary_location` | term reference (`taxonomy_term--location`) or string | yes | "Delhi" — renders next to map-pin icon |
| `field_specializations` | term reference (multivalue, `taxonomy_term--speciality`) | yes | Drives the Specializations grid |
| `field_qualifications` | text (long, multivalue) or list (text) | yes | Each item → one `<li>` in Qualification card |
| `field_experience` | text (long, multivalue) or list (text) | yes | Each item → one `<li>` in Experience card |
| `field_research_designation` | text (long, multivalue) or list (text) | yes | Each item → bullet in Research and Designation list |
| `field_awards` | text (long, multivalue) — paragraphs preferred | yes | Each item → one award card |
| `field_practising_centres` | term reference (multivalue, `taxonomy_term--centre`) | optional | Pre-filters Centre dropdown in booking form |

### `taxonomy_term--speciality` (existing or new)

Per-term fields used by the Specializations grid:

| Field | Type | Notes |
|---|---|---|
| `name` | string | "Cataract", "SMILE", etc. |
| `field_speciality_icon` | image | Circular icon, ~86×86 |
| `field_speciality_link` | URL | `/speciality/<slug>` (target speciality cluster page) |

### `taxonomy_term--centre` (existing)

Used to populate the booking sidebar's Centre `<select>`. No new fields needed.

## Twig templates introduced

| Template | Replaces partial | Renders |
|---|---|---|
| `node--doctor--full.html.twig` | `02-hero-banner.html` (and orchestrates the rest) | Whole-page render: composes the 2-col wrapper + section blocks |
| `views-view-row--doctor-specializations.html.twig` | `04-specialization-card.html` | One specialization card per term in `field_specializations` |
| `views-view-row--doctor-qualifications.html.twig` | `05-qualification-card.html` (Qualification instance) | One `<li>` per item in `field_qualifications` |
| `views-view-row--doctor-experience.html.twig` | `05-qualification-card.html` (Experience instance) | One `<li>` per item in `field_experience` |
| `views-view-row--doctor-research.html.twig` | inline `<li>`s in `07-research-designation.html` | One bullet per item in `field_research_designation` |
| `views-view-row--doctor-awards.html.twig` | `09-award-card.html` | One award card per item in `field_awards` |
| `webform--doctor-appointment.html.twig` | `06-booking-sidebar.html` | Webform `doctor-appointment` |

The breadcrumb (`01-breadcrumb.html`) uses Drupal's `easy_breadcrumb` block; doctor name auto-populates from node title. The callback form (`10-callback-form.html`) reuses the existing `webform--homepage-callback.html.twig` from prior pages.

## Field-by-section mapping

### Section 4 — Hero banner

| HTML element | Field |
|---|---|
| `<p>` subtitle ("Padma Shri Awardee, …") | `node.field_qualifications_summary` |
| `<h1>` doctor name | `node.title` |
| Years span ("42+ Years of Experience") | `node.field_years_of_experience` rendered with `{{ value }}+ Years of Experience` template |
| Location span ("Delhi") | `node.field_primary_location` → term name |
| Right card `<img src>` | `node.field_doctor_photo` rendered with image style `doctor_hero` (~497×326, top-anchored crop) |
| Jumplink pills | Static markup — not field-driven; same on every doctor profile |

### Section 5 — Specializations

- Views block `view-doctor-specializations`:
  - Filter: current node's `field_specializations` reference
  - Row template: `views-view-row--doctor-specializations.html.twig`
  - Per row: term `name` → label, term `field_speciality_icon` → icon, term `field_speciality_link` → wrapping `<a href>`
  - 2-col grid layout (`grid-cols-1 lg:grid-cols-2`)

### Section 6 — Qualification + Experience

Two Views blocks:
- `view-doctor-qualifications` — filtered to current node, renders one `<li>` per item in `field_qualifications`
- `view-doctor-experience` — filtered to current node, renders one `<li>` per item in `field_experience`

The card surrounding each (purple header bar + gray body) is in the Twig template, not the row template. Header title ("Qualification" / "Experience") is hard-coded per block instance.

### Section 7 — Booking sidebar

Webform:
- Machine name: `doctor-appointment`
- Fields:
  - `full_name` (text, required)
  - `centre` (select, required) — options from `taxonomy_term--centre` (alphabetical), optionally pre-filtered to `node.field_practising_centres` if non-empty
  - `phone` (telephone, required, pattern `[0-9]{10}`)
  - `email` (email, required)
  - `consent` (checkbox, required)
- Hidden field: `doctor_id` (`node.id()`) — server-side context
- Submit handler: existing CFS lead-capture pipeline (same as `homepage-callback` and `cataract-appointment` webforms)
- Form `id="booking"` is preserved so any future "Book An Appointment" CTA elsewhere on the page can link via `href="#booking"`

### Section 8 — Research and Designation

Single Views block `view-doctor-research`:
- Filter: current node's `field_research_designation` (multivalue)
- Row template: one `<li>` per item

The static markup splits items into two `<ul>`s by hand for the visual layout. Drupal can either:
- Continue this split via `{% if loop.index <= total/2 %}` + `{% else %}` in a custom template
- Use a single `<ul>` with CSS `column-count: 2; column-gap: 60px;` and let the browser balance items

The dashed separator (`lg:border-l-[3px] lg:border-dashed`) belongs on whichever `<ul>` is the second/right one.

### Section 9 — Awards

Views block `view-doctor-awards`:
- Filter: current node's `field_awards`
- Row template: `views-view-row--doctor-awards.html.twig`
- Per row: text → card body; static SVG badge OR optional `field_award_icon` per row (choose at integration time — see integration notes)

Prev/next arrows are JS-only (handled by `js/main.js`'s generic `data-slider` infrastructure). They do not require any Twig involvement.

## Content type creation order

1. Create `taxonomy_term--speciality` (if not already present) with `field_speciality_icon` + `field_speciality_link`
2. Create `taxonomy_term--centre` (already present per existing pages)
3. Create `taxonomy_term--location` (or use plain string field)
4. Create `node--doctor` content type with all fields above
5. Create the 6 Twig templates above
6. Create the 5 Views blocks above
7. Create the `doctor-appointment` webform
8. Configure URL alias pattern: `/doctor/[node:title]` (or `[node:field_slug]` if a separate slug field is preferred)

## Existing pages that link to doctor profile

- `eye-specialists.html` — doctor cluster (cards). Each card's "Book An Appointment" link should go to `/doctor/<slug>`. See integration notes for the exact decision: whether the link should target `/doctor/<slug>` or `/doctor/<slug>#booking`.
- `index.html` — homepage Eye Care Experts section (doctor cards). Same treatment as above.
- `cataract.html` — speciality individual Eye Care Experts section. Same treatment.
- `centre-cluster.html` / `specialities.html` — currently no doctor links; could add per future design.
