# Sections

## Sections

**Files:** `src/content/sections/english/` (and each other language folder), page content files · **Skill level:** Beginner to edit, light code to add or move

A **section** is one full-width block of a page: the hero, the practice area grid, the reviews, the contact form. A reusable section is two files that share a name:

```text
src/layouts/components/sections/hero/HeroPortraitNavy.astro   ← how it looks (component)
src/content/sections/english/hero-portrait-navy.md            ← what it says (content)
src/content/sections/french/hero-portrait-navy.md
src/content/sections/arabic/hero-portrait-navy.md
```

Components sit in a folder named after their kind (`hero/`, `practice/`, `team/`), and their name is the kind plus the layout: `HeroPortraitNavy` is the `portrait-navy` layout of the hero. [How Covena Works](/covena/getting-started/how-covena-works/) explains the idea. This page is the practical reference.

### Change A Section Everywhere
Edit its file in `src/content/sections/english/`, then the file with the same name in `french/` and `arabic/`. Each language is edited on its own, so changing the English file doesn't change the others.

The comments in each file say what each field does and where the content comes from. Some sections only hold headings and labels and pull the rest from a collection. For example, `practice-grid-navy.md` lists practice area slugs, and each card's title, icon and link come from that area's file in `src/content/practice-areas/`.

### Hide A Section
- **Everywhere:** set `enable: false` at the top of its section file.
- **On one page:** add the section's block to that page's content file with `enable: false`:

  ```yaml
  # src/content/homepage/english/-index.md
  testimonialSlider:
    enable: false
  ```

To take a section off a page for good, remove its tag from the page file in `src/pages/[...lang]/` instead. The order of the tags in that file is the order on the page.

### Change A Section On One Page
Add a **named block** to the page's content file with only the fields you want to change. Covena merges the block over the section file:

- **Objects merge key by key.** Changing a button's `label` keeps its `url`.
- **Lists replace the whole default list.** Copy every item you want to keep. `[]` clears the list.
- **An empty string (`""`) clears a value.**
- **`enable: false` hides the section on that page.**

```yaml
# src/content/homepage/english/-index.md
heroPortraitNavy:
  title: "Plain legal advice for <em>you</em>"
  button:
    label: "Book a call" # the url stays /consultation/
```

One word wrapped in `<em>` in a title is set in the accent serif (Instrument Serif italic).

Each homepage file lists its block names in a comment at the top. The block name is the component name with a lowercase first letter: `HeroPortraitNavy` reads `heroPortraitNavy`. A block with a wrong name is ignored without an error, so copy names from that comment.

<Aside type="caution" title="A block only works where the page reads it">
  A page uses a block only if its file in `src/pages/[...lang]/` passes that
  block to the section. Adding `ctaBandNavy:` to the About page file does
  nothing, because About has no such section. The comment at the top of each
  content file lists the blocks it accepts.
</Aside>

### Which Pages Accept Which Blocks
| Page                              | Content file                                         | Blocks                                                                                                                                                             |
| --------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `/` (Home 1)                      | `src/content/homepage/english/-index.md`             | `heroPortraitNavy`, `featuresTrio`, `aboutCollage`, `practiceGridNavy`, `whyUsAccordionPanel`, `processPhotoCards`, `testimonialSlider`, `insightsBronzePanel`, `contactSplitForm` |
| `/home-corporate/` (Home 2)       | `src/content/homepage/english/home-corporate.md`     | `heroFramedLight`, `logosRow`, `aboutStatement`, `practiceRows`, `industriesMarqueeCards`, `statsPortraitsBand`, `teamCarousel`, `resultsCards`, `insightsFeaturedList`, `ctaBandNavy` |
| `/home-family/` (Home 3)          | `src/content/homepage/english/home-family.md`        | `heroPhotoFull`, `recognitionAwardsBadges`, `practiceSituations`, `feesFixedFees`, `processStepsLine`, `testimonialQuoteCentred`, `teamGrid4`, `faqSplit`, `contactCallbackPanel` |
| `/about/`                         | `src/content/about/english/-index.md`                | `statsBandBronze`, `aboutVisionSplit`, `processPhotoCards`, `valuesRows`, `teamPanel`, `contactSplitForm`                                                           |
| `/practice-areas/`                | `src/content/practice-areas/english/-index.md`       | `practiceGridNavy`, `whyUsAccordionPanel`, `testimonialSlider`, `contactSplitForm` (also used on every practice area page)                                         |
| `/industries/`                    | `src/content/industries/english/-index.md`           | `contactSplitForm` (also used on every industry page)                                                                                                              |
| `/attorneys/`                     | `src/content/attorneys/english/-index.md`            | `contactSplitForm` (also used on every profile)                                                                                                                    |
| `/offices/`                       | `src/content/offices/english/-index.md`              | `contactSplitForm` (also used on every office page)                                                                                                                |
| `/results/`                       | `src/content/results/english/-index.md`              | `ctaPanelCentered`, `contactSplitForm` (on every result page)                                                                                                       |
| `/reviews/`                       | `src/content/reviews/english/-index.md`              | `contactSplitForm`                                                                                                                                                 |
| `/careers/`                       | `src/content/careers/english/-index.md`              | `valuesRows`, `ctaPanelCentered`                                                                                                                                   |
| `/recognition/`, `/fees/`         | `recognition/english/-index.md`, `fees/english/-index.md` | `ctaPanelCentered` (Fees also `corporateFaq`)                                                                                                                  |
| `/insights/`                      | `src/content/blog/english/-index.md`                 | `newsletterSection`                                                                                                                                                |

The History page reads its content from `src/content/sections/english/company-page.md`: the `timeline`, the `community` block (shown with the `vision-split` about layout) and `ctaPanelCentered`.

### Every Section File
| File in `src/content/sections/<language>/` | Used on                                    |
| ------------------------------------------ | ------------------------------------------ |
| `hero-portrait-navy.md`                    | Home 1                                     |
| `hero-framed-light.md`                     | Home 2                                     |
| `hero-photo-full.md`                       | Home 3                                     |
| `features-trio.md`                         | Home 1                                     |
| `about-collage.md`                         | Home 1                                     |
| `about-statement.md`                       | Home 2                                     |
| `about-vision-split.md`                    | About                                      |
| `company-page.md`                          | History (timeline, community, call to action) |
| `practice-grid-navy.md`                    | Home 1, Practice areas                     |
| `practice-rows.md`                         | Home 2                                     |
| `practice-situations.md`                   | Home 3                                     |
| `industries-marquee-cards.md`              | Home 2                                     |
| `why-us-accordion-panel.md`                | Home 1, Practice areas                     |
| `process-photo-cards.md`                   | Home 1, About                              |
| `process-steps-line.md`                    | Home 3                                     |
| `stats-band-bronze.md`                     | About                                      |
| `stats-portraits-band.md`                  | Home 2                                     |
| `testimonial-slider.md`                    | Home 1, Practice areas                     |
| `testimonial-quote-centred.md`             | Home 3                                     |
| `team-carousel.md`                         | Home 2                                     |
| `team-grid-4.md`                           | Home 3                                     |
| `team-panel.md`                            | About                                      |
| `values-rows.md`                           | About, Careers                             |
| `logos-row.md`                             | Home 2                                     |
| `recognition-awards-badges.md`             | Home 3                                     |
| `results-cards.md`                         | Home 2                                     |
| `fees-fixed-fees.md`                       | Home 3                                     |
| `faq-split.md`                             | Home 3                                     |
| `insights-bronze-panel.md`                 | Home 1, insight posts (related posts), attorney profiles |
| `insights-featured-list.md`                | Home 2                                     |
| `newsletter.md`                            | Insights                                   |
| `contact-split-form.md`                    | Home 1 and most inner pages                |
| `contact-callback-panel.md`                | Home 3                                     |
| `cta-band-navy.md`                         | Home 2                                     |
| `cta-panel-centered.md`                    | Careers, History, Recognition, Fees, Results |
| `search-list.md`                           | Search                                     |
| `cookie-consent.md`                        | The cookie banner on every page ([Cookies & Analytics](/covena/customization/cookies-analytics/)) |

`src/layouts/components/sections/section-ownership.md` is the full list: every section component, the file its content comes from, and the pages that import it. It also lists the page-only sections, such as the fee tables and the attorney profile, whose content lives in the page's own `-index.md` instead of a section file. `npm run verify` checks that every section component has a row there.

### Add A New Section
This needs light code. The short version:

1. Create the component in `src/layouts/components/sections/<kind>/`, using a section of the same kind as a template.
2. Create its content file in every language folder of `src/content/sections/`, with `options.layout` and a comment listing the other layouts of that kind.
3. Add its schema to `src/sections.schema.ts` and register it in `sectionsSchema` with `createSectionOverride`.
4. Add its row to `section-ownership.md`.
5. Import it in the page file, read the page's named block, and pass it as `content`.

`SKILLS.md` in the theme folder has the full recipe, written for AI assistants. See [Customize With AI](/covena/ai-customization/ai-overview/).

### Do It With AI
```text
On the Covena homepage (/), change the heroPortraitNavy section for this page only. In
src/content/homepage/english/-index.md add a heroPortraitNavy block with title "[TITLE]" and
description "[DESCRIPTION]". Don't edit src/content/sections/. Make the same change in the french
and arabic folders with translated text. Then run npm run astro-check.
```