Customizing Menus
Files: src/config/menu.<lang>.json · Skill level: Beginner
Veltro has one menu file for each language: src/config/menu.en.json, menu.fr.json, and menu.ar.json. Each file has three lists:
headerPrimary: the header menu, with dropdowns and the mega menufooter: the footer link columnsfooterLegal: the small links in the lower footer bar
In the Tina edition, edit Menus at /admin/: Header Primary, Footer, and Footer Legal. In the Sanity edition, the files don’t exist: open Content, your language, Menus in the Studio, then Header menu, Footer menu, or Legal links.
For how the menu behaves, and for keyboard support, see Navigation.
Header Menu
The headerPrimary list supports plain links, dropdowns, flyouts, badges, and a mega menu.
{ "name": "Pages", "enable": true, "weight": 2, "hasChildren": true, "children": [ { "enable": true, "name": "About Company", "url": "/about/" }, { "enable": true, "name": "Pricing", "url": "/pricing/" } ]}Useful fields are enable, name, url, weight, hasChildren, children, and badge. Give any child its own hasChildren and children to open a flyout. Pages > Multi Level Menu in the demo goes five levels down.
Menu Order
Veltro shows menu items in the order they have in the file, at every level. It doesn’t sort them by weight, so to move an item, move it in the list. The same goes for the Order field in the Tina and Sanity editions: move the item in the list instead.
Mega Menu
Set hasMegaMenu to true and add menus, a list of link groups. Each group has enable, name, weight, and children. The first group is shown in large type. cta adds the photo card, and bar adds the row along the bottom, which also shows the phone number from [settings.contactInfo].
{ "enable": true, "name": "Our Expertise", "weight": 1, "hasMegaMenu": true, "menus": [ { "enable": true, "name": "Company Services", "weight": 0, "children": [ { "enable": true, "name": "Product Development", "icon": "/images/icons/services/product.svg", "url": "/services/service-1/", "weight": 0 } ] } ], "cta": { "enable": true, "image": "/images/team/teamwork/teamwork-1.png", "title": "Always Here to Support You", "button": { "enable": true, "label": "Let's Talk", "url": "/contact/" } }, "bar": { "enable": true, "text": "Don't Hesitate to Collaborate with Us", "label": "Contact us", "url": "/contact/" }}The desktop panel shows each link’s name and badge. A link’s icon appears only in the mobile menu, where it can be an image path or an icon name.
Footer Menus
footer holds the link columns, each with a label and a list. footerLegal holds the small links in the lower bar.
{ "label": "Company", "list": [ { "enable": true, "name": "Our Team", "url": "/team/" } ]}Footer items also take a badge. In the demo, the Careers link has one.