# Menus

## Menus

**Files:** `src/config/menu.en.json`, `src/config/menu.fr.json`, `src/config/menu.ar.json` · **Skill level:** Beginner

Every menu on the site is plain data in one JSON file per language. The header, the mobile menu, and the footers all read from it. Editing a menu never creates or deletes a page: it only changes the links.

| List in the file | Where it shows                                                                    |
| ---------------- | --------------------------------------------------------------------------------- |
| `headerPrimary`  | The header menu and the mobile menu                                               |
| `footer`         | The link columns in the `marquee` footer (Home 1 and inner pages) and the `columns-light` footer (Home 2) |
| `footerLinks`    | The single row of links in the `offices` footer (Home 3)                          |
| `footerLegal`    | The legal links at the bottom of every footer                                     |

Items show in the order they are in the file. Each item has a `weight` too: keep it in step with the order, so the file stays easy to read.

### The Header Menu
Covena ships seven items in `headerPrimary`: **Home**, **Practice areas**, **Attorneys**, **Results**, **Firm**, **Insights**, and **Contact**. There are three kinds of item.

**1. A plain link**

```json
{ "enable": true, "name": "Contact", "weight": 7, "url": "/contact/" }
```

**2. A dropdown**, like **Home** and **Firm**. Add `"hasChildren": true` and a `children` list. A child with its own `"hasChildren": true` and `children` opens a flyout to the side.

```json
{
  "enable": true,
  "name": "Firm",
  "weight": 5,
  "hasChildren": true,
  "children": [
    { "enable": true, "name": "About", "url": "/about/" },
    { "enable": true, "name": "Our history", "url": "/history/" },
    { "enable": true, "name": "Fees", "url": "/fees/" }
  ]
}
```

**3. A mega menu**, like **Practice areas**. Add `"hasMegaMenu": true` and a `menus` list of groups. Each group is a column with a heading and its links, and each link can have a one-line `description`. `bar` adds a row of links along the bottom of the panel.

```json
{
  "enable": true,
  "name": "Practice areas",
  "weight": 2,
  "hasMegaMenu": true,
  "menus": [
    {
      "enable": true,
      "name": "For businesses",
      "children": [
        {
          "enable": true,
          "name": "Employment",
          "description": "Contracts, dismissals and settlement agreements",
          "url": "/practice-areas/employment/"
        }
      ]
    }
  ],
  "bar": {
    "enable": true,
    "links": [
      { "enable": true, "name": "All practice areas", "url": "/practice-areas/" },
      { "enable": true, "name": "Industries we serve", "url": "/industries/" }
    ]
  }
}
```

The shipped mega menu has three groups: **For businesses**, **For individuals**, and **Disputes & injury**. The menu has no icons, on purpose: the links are text with a short description.

### Fields
| Field         | Used on                 | What it does                                                                  |
| ------------- | ----------------------- | ----------------------------------------------------------------------------- |
| `enable`      | Everything              | `false` hides the item without deleting it                                    |
| `name`        | Everything              | The text shown                                                                |
| `weight`      | Top-level items         | A position number. Keep it in step with the order in the file                 |
| `url`         | Links                   | `/fees/` for your own pages, or a full `https://` address                     |
| `hasChildren` | Dropdowns, flyouts      | `true` when the item has `children`                                           |
| `children`    | Dropdowns, mega groups  | The links inside                                                              |
| `hasMegaMenu` | Top-level items         | `true` when the item opens a mega menu                                        |
| `menus`       | Mega menus              | The groups, each with `enable`, `name`, and `children`                        |
| `description` | Mega menu links         | A short line under the link name                                              |
| `bar`         | Mega menus              | The bottom row, with `enable` and a `links` list                              |

**Write internal links without a language.** Use `/fees/` in every language's file. The theme adds the prefix, so the same link opens `/fr/fees/` on a French page and `/ar/fees/` on an Arabic one.

### Footer Menus
`footer` is a list of columns. Each column has a `label` and a `list` of links:

```json
"footer": [
  {
    "label": "Help",
    "list": [
      { "enable": true, "name": "Free consultation", "url": "/consultation/" },
      { "enable": true, "name": "Fees", "url": "/fees/" },
      { "enable": true, "name": "FAQ", "url": "/faq/" }
    ]
  }
]
```

Covena ships three columns: **Practice areas**, **Firm**, and **Help**. A column with no enabled links is left out.

`footerLinks` and `footerLegal` are flat lists of links, written like the plain link above. The last item in `footerLegal` is **Cookie settings** with the URL `#cookie-settings`: it reopens the cookie banner, and it hides itself while the banner is turned off in `[settings.cookieConsent]`.

The scrolling strip of practice area names at the top of the `marquee` footer is not a separate list. It takes the first ten link names from the groups of the **Practice areas** mega menu, so it stays in step when you change that menu.

See [Footer](/covena/customization/footer/) for the footer layouts.

### Add A Page To The Menu
1. Make sure the page exists. A menu link to a missing page gives a 404.
2. Add the link in `src/config/menu.en.json`, where you want it.
3. Add the same link to `menu.fr.json` and `menu.ar.json`, with the name translated and the same `url`.

When you add a practice area, add it to the mega menu in all three files. The practice areas page and the footer don't add it for you.

<Aside type="caution">
  JSON is strict. A missing comma, or a comma after the last item in a list,
  stops the site from building, and the terminal shows the file and line. Change
  the menu file of every language when you add or remove a link, so the menus
  stay in step.
</Aside>

### Do It With AI
```text
Add a practice area link "[NAME]" with the description "[ONE LINE]" and the URL
"/practice-areas/[slug]/" to the "[GROUP]" group of the Practice areas mega menu in
src/config/menu.en.json. Add the same link to menu.fr.json and menu.ar.json, with the name and
description translated and the same URL. Keep the item shape of the links around it, and check that
all three files are still valid JSON.
```