# Customizing Menus

## Customizing Menus In Finzo

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

Finzo has one menu file for each language: `src/config/menu.en.json`, `menu.fr.json`, and `menu.ar.json`. Each file has two lists:

- `headerPrimary`: the header menu, with dropdowns and mega menus
- `footer`: the footer menu columns

In the Tina edition, you edit these under **Menus** at `/admin/`, per language. In the Sanity edition, the file doesn't exist: open Content, your language, **Menus** in the Studio, then **Header menu** or **Footer menu**.

For how the menu behaves, and for keyboard support, see [Navigation](../../features/navigation/).

<Aside type="caution">
  Change the menu file of **every language** when you add or remove a link, so
  the menus stay in step.
</Aside>

---

### Header Menu Items
Each object in `headerPrimary` is a top-level menu item.

```json
{
  "enable": true,
  "name": "Home",
  "weight": 0,
  "url": "/"
}
```

- `name`: text displayed in the header
- `url`: link destination. Use `/pricing/` for your own pages, and the language prefix is added for you
- `enable`: `true` shows the item. An item with `false`, or with no `enable` at all, is hidden
- `weight`: the position of the item
- `hasChildren`: makes the item a dropdown
- `hasMegaMenu`: makes the item a mega menu
- `children`: the links inside a dropdown
- `badge`: a small label or dot beside the name

### Finzo Sorts The Menu By `weight`
Finzo sorts the header menu by `weight`, not by the order in the file. Lower numbers come first. This applies at every level: top-level items, dropdown links, nested links, and mega menu groups and their links. An item with no `weight` goes last.

To move an item, change its `weight`, not only its place in the file.

---

### Mega Menus
To enable a mega menu, set `hasMegaMenu` to `true`, and list groups of links in `menus`. You can add a `cta` photo card and a `bar` row along the bottom.

```json
{
  "enable": true,
  "name": "Features",
  "weight": 1,
  "hasMegaMenu": true,
  "cta": {
    "enable": true,
    "image": "/images/menu-cta.png",
    "title": "Gain Actionable Insights",
    "description": "Launch faster, grow smarter, and scale effortlessly.",
    "button": {
      "enable": true,
      "hoverEffect": "text-flip",
      "label": "Get A Free Trial",
      "url": "/contact/"
    }
  },
  "menus": [
    {
      "enable": true,
      "name": "Platform",
      "weight": 0,
      "children": [
        {
          "enable": true,
          "icon": "Focus",
          "name": "Real-Time Reporting",
          "description": "Monitor live data streams.",
          "url": "/features/",
          "weight": 0
        }
      ]
    }
  ],
  "bar": {
    "enable": true,
    "text": "Not sure where to start?",
    "label": "Talk to us",
    "url": "/contact/"
  }
}
```

- `menus`: groups of links, each with its own `name` and `weight`
- `icon`: a [Lucide icon](https://lucide.dev/icons/) name
- `description`: supporting text under the link
- `cta`: the photo card in the mega menu
- `bar`: the row along the bottom of the panel

---

### Dropdowns And Nested Menus
Give an item `"hasChildren": true` and a `children` list. Any child can have its own `hasChildren` and `children`, and it opens to the side.

```json
{
  "name": "Pages",
  "enable": true,
  "weight": 2,
  "hasChildren": true,
  "children": [
    {
      "enable": true,
      "name": "About",
      "url": "/about/",
      "weight": 0
    },
    {
      "enable": true,
      "name": "Integration",
      "weight": 1,
      "hasChildren": true,
      "children": [
        {
          "enable": true,
          "name": "All Integrations",
          "url": "/integration/",
          "weight": 0
        }
      ]
    }
  ]
}
```

In the files, you can nest as deep as you like. The Tina form has fields for at least four levels, counting the top item. After you add a deeper level in the file, run `npm run tina:generate` and the form follows it.

---

### Menu Badges
Badges highlight important links, such as updates or new sections. A badge shows only when its own `enable` is `true`.

```json
{
  "enable": true,
  "name": "Components",
  "url": "/components/",
  "weight": 3,
  "badge": {
    "enable": true,
    "label": "NEW",
    "color": "accent",
    "type": "text"
  }
}
```

- `enable`: shows the badge
- `label`: badge text
- `color`: `accent`, `info`, `success`, `danger`, or `dark`
- `type`: `text` or `dot`

Mega menu links show text badges only, not dots.

---

### Footer Menu
The `footer` list holds the footer columns. Each object is one column.

```json
{
  "label": "Services",
  "list": [
    {
      "enable": true,
      "name": "Cards",
      "url": "/",
      "weight": 0
    }
  ]
}
```

- `label`: the column heading
- `list`: the links in the column

Finzo shows every column and every link here, in the order in the file. `enable` and `weight` have no effect in the footer, so delete a link to remove it. The sample links mostly point at `/`, so set them to your own pages.

### Other Footer Text
Some footer content isn't in the menu file:

- **Description and copyright:** `footerBlock` in `src/i18n/<lang>.json`. See [Footer](../footer/).
- **Contact column:** its heading is `contactBlockLabel` in `footerBlock`. Your address, phone, and email are `contactInfo` in the same file.
- **App store buttons:** `[[settings.downloadButtons]]` in `src/config/config.toml`.

```json
"footerBlock": {
  "description": "We provide seamless solutions to Small and Medium Businesses.",
  "copyright": "Copyright © 2024 Finzo. All Rights Reserved.",
  "contactBlockLabel": "Contact"
}
```

Update these in every language. In the Tina and Sanity editions, `footerBlock` and `contactInfo` are **Footer Block** and **Contact Info** in **Interface labels**, and the buttons are **Download Buttons** under **Site settings > Settings**.

### Do It With AI
```text
Add a link called "[NAME]" to [PLACE IN THE HEADER MENU], pointing to [URL]. Edit headerPrimary in
every src/config/menu.<lang>.json file, and translate the name for each language. Finzo sorts the
header menu by weight, so give the item a weight that puts it in the right place. Keep the same
item shape as the existing items, with "enable": true. Don't change the navigation components.
Then run npm run astro-check.
```