# Menus

## Menus

**Files:** `src/config/menu.<language>.json` · **Skill level:** Beginner

The header menu and the footer link columns live in one JSON file per language: `menu.en.json`, `menu.fr.json` and `menu.ar.json`. Keep the files in the same shape: same items, same order, same URLs. Only the `name`, `description` and `label` texts differ.

Each file has two lists:

```json
{
  "headerPrimary": [ ... ],
  "footer": [ ... ]
}
```

For how the menu behaves on screen and with the keyboard, see [Navigation](/lotline/features/navigation/).

### Header Menu
Each item in `headerPrimary` is one entry in the top menu. There are three kinds of item.

**A plain link**, such as **Agents**:

```json
{ "enable": true, "name": "Agents", "url": "/agents/", "weight": 4 }
```

**A dropdown.** Set `"hasChildren": true` and list the links in `children`. Each link can have a short `description` under its name. This is the **Services** menu, trimmed:

```json
{
  "enable": true,
  "name": "Services",
  "weight": 2,
  "hasChildren": true,
  "children": [
    {
      "enable": true,
      "name": "Buying",
      "description": "Find a home and get help with every step",
      "url": "/services/buying/",
      "weight": 1
    },
    {
      "enable": true,
      "name": "Selling",
      "description": "Get a price and sell with one agent",
      "url": "/services/selling/",
      "weight": 2
    }
  ]
}
```

**A mega menu.** Set `"hasMegaMenu": true` and list groups of links in `menus`. This is the **Properties** menu, trimmed:

```json
{
  "enable": true,
  "name": "Properties",
  "weight": 1,
  "hasMegaMenu": true,
  "menus": [
    {
      "enable": true,
      "name": "Search",
      "weight": 1,
      "children": [
        {
          "enable": true,
          "name": "For sale",
          "description": "Homes on the market now",
          "url": "/properties/?status=sale",
          "weight": 1
        }
      ]
    },
    {
      "enable": true,
      "name": "By type",
      "weight": 2,
      "children": [
        { "enable": true, "name": "Houses", "url": "/properties/?type=house", "weight": 1 }
      ]
    }
  ],
  "featured": {
    "enable": true,
    "label": "Featured listing",
    "image": "/images/lotline/properties/elm-hill-modern-villa/cover.jpg",
    "title": "Five-bedroom villa with city views",
    "price": "$1,920,000",
    "url": "/properties/elm-hill-modern-villa/",
    "linkLabel": "View the home"
  },
  "bar": {
    "enable": true,
    "text": "Thinking of selling?",
    "label": "Book a valuation",
    "url": "/valuation/"
  }
}
```

| Key | What it does |
| --- | ------------ |
| `enable` | `false` hides the item without deleting it |
| `name` | The text in the menu |
| `weight` | A position number. Lotline shows items in the order of the file and doesn't sort by this number, so move an item in the file to move it in the menu |
| `url` | Where it links. Write paths without the language: `/agents/`, not `/fr/agents/`. The other languages add their prefix themselves. A link can carry a filter, such as `/properties/?status=rent` |
| `description` | A short line under a link in a dropdown or the mega menu |
| `hasChildren` | `true` makes the item a dropdown |
| `children` | The links inside the dropdown. A child with its own `hasChildren` and `children` opens a flyout |
| `hasMegaMenu` | `true` makes the item a mega menu |
| `menus` | The columns of a mega menu, each with `enable`, `name`, `weight` and `children`. The `name` is a heading, not a link |
| `featured` | The listing card on the side of the mega menu: `label`, `image`, `title`, `price`, `url` and `linkLabel`. `"enable": false` hides it |
| `bar` | The strip along the bottom of the mega menu, with `enable`, `text`, `label` and `url`. It also shows your phone number from `[business]` |

Menu links have no icons. An item with children opens its menu instead of going to a page, so if that section has its own page, put a link to it first in its `children`.

<Aside type="caution" title="The featured card is typed text">
  The card's `title`, `price` and `image` are not read from the listing. When
  that home sells or its price changes, update the card in every language, or
  point it at another listing. `image` is a path under `src/assets/images/`,
  the same path the listing file uses.
</Aside>

The type links (`?type=house`, `?type=apartment`, `?type=townhouse`, `?type=studio`) match the `type` field of your property files. A property's `type` can also be `villa` or `penthouse`. Add `/properties/?type=villa` or `/properties/?type=penthouse` to **By type** if you list those. See [Listing Search & Filters](/lotline/customization/listing-search/).

### Flyouts
A child that has its own `hasChildren` and `children` opens a flyout to the side, and it flips if there's no room. The **Company** menu uses this for **Homepages**:

```json
{
  "enable": true,
  "name": "Company",
  "weight": 5,
  "hasChildren": true,
  "children": [
    {
      "enable": true,
      "name": "Homepages",
      "weight": 0,
      "hasChildren": true,
      "children": [
        { "enable": true, "name": "Agency home", "description": "Homes for sale and for rent", "url": "/", "weight": 1 },
        { "enable": true, "name": "Developments home", "description": "Fine homes and new developments", "url": "/home-2/", "weight": 2 },
        { "enable": true, "name": "Rentals home", "description": "Rentals and property management", "url": "/home-3/", "weight": 3 }
      ]
    },
    { "enable": true, "name": "About us", "url": "/about/", "weight": 1 }
  ]
}
```

On phones, the same levels open as lists inside the mobile menu.

<Aside type="tip" title="Remove the Homepages flyout on your site">
  **Homepages** links to the three demo homepages. Once you've picked one,
  delete the flyout (or set its `"enable"` to `false`) in every menu file. See
  [Homepages](/lotline/customization/homepages/).
</Aside>

### Footer Menus
`footer` is a list of link columns. Each has a `label` (the column heading) and a `list` of links:

```json
"footer": [
  {
    "label": "Navigation",
    "list": [
      { "enable": true, "name": "About", "url": "/about/" },
      { "enable": true, "name": "Properties", "url": "/properties/" }
    ]
  },
  {
    "label": "Resources",
    "list": [
      { "enable": true, "name": "Neighborhoods", "url": "/neighborhoods/" }
    ]
  },
  {
    "label": "Legal",
    "list": [
      { "enable": true, "name": "Terms", "url": "/terms-conditions/" },
      { "enable": true, "name": "Privacy", "url": "/privacy-policy/" },
      { "enable": true, "name": "Cookie settings", "url": "#cookie-settings" }
    ]
  }
]
```

The shipped file has three columns: **Navigation**, **Resources** and **Legal**. Two rules matter:

- **The last column holds the legal links.** Every footer layout shows it in the bottom row, next to the copyright, instead of as a column. Keep Legal last.
- **The footers show the first link columns only.** The `columns` and `pine` footers show the first two columns next to an **Office** column built from `[business]`. The `minimal` footer shows the first column as one row of links. A third link column is not shown.

The **Cookie settings** link (`#cookie-settings`) reopens the cookie banner. If you turn the banner off in `[settings.cookieConsent]`, set this item's `enable` to `false`. See [Footer & CTA Band](/lotline/customization/footer/).

### Keep Every Language In Step
`npm run check-i18n` (also part of `npm run astro-check`) compares each language's menu file with `menu.en.json` and reports a difference in the number of items or a `url`. So when you add, remove or move a menu item, do it in every file.

JSON is strict: every item but the last in a list needs a comma after it, and every name and URL needs double quotes. A missing comma stops the site from building. See [File Formats](/lotline/beginner/file-formats/).

### Do It With AI
```text
In each src/config/menu.<language>.json: delete the "Homepages" flyout from the Company menu,
remove [ITEMS] from the Services dropdown, and add a link "[NAME]", translated for each
language, to [URL] after Agents. Point the Properties mega menu's "featured" card at
src/content/properties/english/[FILE].md, copying its title, price and image. Keep the Legal
footer column last. Keep every file in the same structure, then run npm run check-i18n.
```