Skip to content
New: Customize your theme with an AI assistant. Read the guide

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

The header menu is built from one file per language. You write the links, and the theme draws the dropdown panel, the Properties mega menu, the flyouts, the phone menu and the keyboard support. For the header layouts, the logo and the header button, see Header. For a shorter guide to the menu file, see Menus.

The Lotline header over the Home 1 hero

How The Menu Behaves

On large screens:

  • Every dropdown and the mega menu share one panel. Moving from one menu to the next, the panel changes width, height and position while the content slides in the direction you moved.
  • A nested item, such as Homepages inside Company, opens a flyout beside its list. A flyout that would run off the screen opens on the other side.
  • Menu rows are text only: a name and an optional one-line description. There are no icons in the menu.

On phones and tablets the menu is a slide-in panel. Submenus open and close like an accordion, and the call button, the main button and the language links sit at the bottom of the panel. Focus stays inside the panel while it’s open.

Visitors who turn on reduce motion get a simple fade instead. On Arabic pages everything mirrors: see RTL & Arabic.

The Menu File

There is one file per language: src/config/menu.en.json, menu.fr.json and menu.ar.json. The header menu is the headerPrimary list, and the footer columns are footer.

There are three kinds of item.

1. A plain link

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

2. A dropdown. Set "hasChildren": true and list the links in children. A child can have a short description, and it can have its own "hasChildren": true and children, which opens a flyout:

{
"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": "About us", "url": "/about/", "weight": 1 }
]
}

3. The Properties mega menu. Set "hasMegaMenu": true and list groups of links in menus. featured adds a listing card on the side, and bar adds a strip along the bottom with a link and your phone number from [business]:

{
"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": "For rent", "description": "Homes and apartments for rent", "url": "/properties/?status=rent", "weight": 2 }
]
}
],
"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/"
}
}

Mega menu links can point at a filtered search, such as /properties/?status=rent or /properties/?type=house. The properties page reads those values and sets its filters to match. See Listing Search & Filters.

The featured card’s title and price are typed text, so update them when that home sells or its price changes.

FieldUsed onWhat it does
enableEverythingtrue shows the item and false hides it
nameEverythingThe text shown
weightEverythingA position number. Keep it in step with the order in the file
urlLinks/agents/ for your own pages (the language prefix is added for you), or a full https:// address
descriptionDropdown and mega menu linksA short line under the name
hasChildrenDropdowns, flyoutstrue when the item has children
childrenDropdowns, mega menu groupsThe links inside. Items in a dropdown can have their own children
hasMegaMenuTop-level itemstrue when the item opens a mega menu
menusMega menuThe groups of links, each with enable, name, weight and children
featuredMega menuThe listing card: enable, label, image, title, price, url, linkLabel
barMega menuThe bottom strip: enable, text, label, url

A menu item with children opens its menu instead of going to a page, so put its own page first in its children if it has one.

Keyboard Support

This works with no setup.

KeyWhat it does
Enter or SpaceOpens the menu on the focused item
Down and UpMove through the links in the open list
Left and RightMove between menus, and in and out of flyouts
Home and EndJump to the first or last link in the list
TabMoves into the panel, in reading order
EscapeCloses the menu and returns focus to where it was

In the phone menu, Escape closes the panel and returns focus to the button that opened it.

Files For Developers

FileWhat it does
src/layouts/components/global/header/SiteHeader.astroThe header, its three layouts and the header button
src/layouts/components/global/header/Navbar.astroThe menu in the header
src/layouts/components/global/header/NavStage.astroThe shared panel and its script
src/layouts/components/global/header/NavStageDropdown.astroDropdown content
src/layouts/components/global/header/NavStageList.astroThe list that repeats for each nested level
src/layouts/components/global/header/NavStageMega.astroThe mega menu, its featured card and bottom strip
src/layouts/components/widgets/HeaderOffcanvasContent.astroThe phone menu
src/styles/navigation.cssThe menu styles

Do It With AI

In src/config/menu.en.json, menu.fr.json and menu.ar.json, add a "[NAME]" link to the
[Company | Services] dropdown in headerPrimary, pointing to [URL], with a one-line description.
Keep the same item shape as the other items, translate the name and description, and keep the
three files in the same order. Then run npm run check-i18n.
Type something to search...