# Customizing Menus

## **Customizing Menus**

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

The navigation menus throughout your site are managed in one file per language: `src/config/menu.en.json`, `src/config/menu.fr.json`, and `src/config/menu.ar.json`. By modifying these files, you can customize the main navigation, dropdowns, mega menus, and footer links. Change the file of every language when you add or remove a link.

In the Tina edition, open **Menus** at `/admin/` and pick the file for a language. Then open **Header Primary**, or one of the footer lists. In the Sanity edition, open your language, then **Menus** in the Studio, and edit **Header menu** and the footer lists.

For all the menu fields and keyboard support, see [Navigation](../../features/navigation/).

### **Main Menu**

The `headerPrimary` list defines the primary navigation menu items. Looka's main menu ships with a mega menu called **Explore**, a multi-level **Pages** dropdown, a **Components** link, and a **Contact** link. Here is a trimmed version of the real structure:

```json
{
  "headerPrimary": [
    {
      "enable": true,
      "name": "Explore",
      "weight": 0,
      "hasMegaMenu": true,
      "menus": [
        {
          "enable": true,
          "name": "REGULAR PAGES",
          "weight": 0,
          "children": [
            { "enable": true, "name": "Services", "weight": 0, "url": "/services/" },
            { "enable": true, "name": "Career", "weight": 1, "url": "/career/" }
          ]
        },
        {
          "enable": true,
          "name": "SERVICES",
          "weight": 3,
          "children": [
            {
              "enable": true,
              "name": "Competitive Analysis",
              "description": "Understand your competitors' strengths and weaknesses.",
              "icon": "ChartNoAxesColumn",
              "weight": 1,
              "url": "/services/service-02/"
            }
          ]
        }
      ],
      "cta": {
        "enable": true,
        "image": "/images/customer-image.png",
        "description": "Looka strategic planning helped us streamline operations and unlock new market opportunities."
      }
    },
    {
      "enable": true,
      "name": "Pages",
      "weight": 1,
      "hasChildren": true,
      "children": [
        { "enable": true, "name": "Home", "weight": 0, "url": "/" },
        {
          "enable": true,
          "name": "Services",
          "weight": 2,
          "hasChildren": true,
          "children": [
            { "enable": true, "name": "Services", "weight": 0, "url": "/services/" }
          ]
        }
      ]
    },
    {
      "enable": true,
      "name": "Components",
      "weight": 2,
      "url": "/elements/",
      "badge": { "enable": true, "label": "NEW", "color": "primary", "type": "text" }
    },
    {
      "enable": true,
      "name": "Contact",
      "weight": 3,
      "url": "/contact/",
      "badge": { "enable": true, "label": "NEW", "color": "danger", "type": "dot" }
    }
  ]
}
```

> `hasMegaMenu: true` opens a mega menu, whatever the item is called. The `"Pages"` item is a regular multi-level dropdown (`hasChildren: true`). Open `src/config/menu.en.json` to see the full set of groups and nested children.

### **Menu Order**

Looka shows menu items in the order they appear in the list. It doesn't sort them by `weight`. To move an item, move it in the list, and keep its `weight` in step. The **Order** field in the Tina and Sanity forms is this same number, so changing it doesn't move an item: move its row in the list.

### **Footer Menus**

The same file holds the footer menus:

| List                  | Where it shows          | In the Sanity Studio |
| --------------------- | ----------------------- | -------------------- |
| `footerMenuQuickLink` | The Quick Links column  | **Footer quick links** |
| `footerMenuResources` | The Resources column    | **Footer resources**   |
| `footerMenuLegal`     | The Legal column        | **Footer legal links** |
| `footerMenu`          | The bottom row          | **Footer bottom row**  |

**Example of Footer Menu:**

```json
{
  "footerMenu": [
    {
      "enable": true,
      "name": "Terms & Conditions",
      "url": "/terms-conditions/"
    },
    {
      "enable": true,
      "name": "Privacy Policy",
      "url": "/privacy-policy/"
    }
  ]
}
```

The column headings are in `src/i18n/<lang>.json`. See [Footer](../footer/).

### **Configuration Options**

- `name`: The display name of the menu item.
- `url`: The URL the menu item links to.
- `enable`: Set to `false` to hide the menu item.
- `weight`: A position number. See **Menu Order** above.
- `hasChildren`: Indicates if the menu has sub-items (for a dropdown menu only). Any child can have its own `hasChildren` and `children`.
- `hasMegaMenu`: Enables mega menu for the item, with groups of links in `menus`.
- `badge`: Displays a badge next to the menu item
  - `label`: The text inside the badge
  - `color`: The color of the badge - `primary`, `info`, `success`, `danger`
  - `type`: The type of badge - `text`, `dot`

### **Services List in Mega Menu**

The **SERVICES** column in the mega menu is a group of links like the others, in `menus`. It doesn't read `src/content/services/`, so when you add a service, add its link here too. `description` is the line under the link, and `icon` is the name of a [Lucide icon](https://lucide.dev/icons/), with a capital letter, such as `Award`.

### **Card in Mega Menu**

The card beside the columns is `cta`. Looka's card uses `image` and `description`. It can also have `eyebrow`, `title`, `items`, and `button`.

```json
"cta": {
  "enable": true,
  "image": "/images/customer-image.png",
  "description": "Looka strategic planning helped us streamline operations and unlock new market opportunities."
}
```

### **Bottom Row in Mega Menu**

Looka's menu doesn't ship with a bottom row, but you can add one to a mega menu with `bar`. It shows your text and link, plus the phone number from `[settings.contactInfo]` in `config.toml`, if you have set one.

```json
"bar": {
  "enable": true,
  "text": "Need help choosing?",
  "label": "Talk to us",
  "url": "/contact/"
}
```

### **Adding New Menu Items**

To add a new menu item:

1. Locate the appropriate list in the `menu.en.json` file (e.g., `headerPrimary` for primary navigation).
2. Add a new object with the required fields (`enable`, `name`, `url`), in the place you want it to show.
3. Do the same in the file of each other language.
4. Save the files, and the new item will appear in the corresponding menu on your site.

### **Disabling Menu Items**

To disable any menu item, set the `enable` property to `false`.

```json
{
  "enable": false,
  "name": "Old Page",
  "url": "/old-page/"
}
```

This will hide "Old Page" from the navigation.

---

By following the above structure, you can easily manage and customize your site's menus through the menu file of each language.