Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Add a header menu item

Add a page from the content tree to the site header's main menu in Exponential 6.0.15+, in the administration (no code) or with one console command, and see why the Layouts editor does not list the menu items.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/build-two-ways/add-a-header-menu-item.md

On this page

Add a header menu item

This page answers one question: how do I put another page into the header menu? It was worked out on the real Fit & Healthy site that ships with Exponential 6.0.15+ (the media site theme, extension sevenx_themes_media). Every screenshot was taken on a throwaway copy of that installation.

The header of the Fit & Healthy site with the menu items Fitness, Healthy eating, Recipes, Running, Video and Tour
The header of the Fit & Healthy site with the menu items Fitness, Healthy eating, Recipes, Running, Video and Tour

Contents

  1. The short answer
  2. Why the Layouts editor does not show the menu items
  3. The three ways
  4. After the change

The short answer

The header menu is a list of node IDs in the setting [SiteInfo] MainMenuID[] of menu.ini, for the siteaccess site. Each ID is one menu item; the item's text is the node's name and its link is the node's URL. To add a page:

  1. Find the node ID of the page (Find a node ID).
  2. Add it to MainMenuID[]:
    • in the administration: Setup > Ini settings, file menu.ini, siteaccess site, Edit on MainMenuID[] (step by step), or
    • in a terminal: ./console exp:ini add menu.ini/SiteInfo/MainMenuID[] 192 siteaccess:site (step by step).
  3. Clear the Template & content caches (the compiled menu template holds the list).

That is all. Adding "Showcase" (node 192) took ten actions in the administration (clicks, choices and one typed line) and two commands in the console (Measured steps and times).

The same header after the change, with a seventh item, Showcase
The same header after the change, with a seventh item, Showcase

Why the Layouts editor does not show the menu items

Open Layouts > Shared layouts > Header / Footer and you see blocks, not menu items: the header zone holds a Template block whose template name is header.

The Header / Footer layout in the editor: the header zone holds a template block named header and a column with the breadcrumb template block
The Header / Footer layout in the editor: the header zone holds a template block named header and a column with the breadcrumb template block

A template block is a placeholder: it tells the page "render the template called header here". The menu inside that template is not stored in the layout. It comes from menu.ini. So:

You want toWhere
Add, remove or reorder header menu itemsmenu.ini [SiteInfo] MainMenuID[] (administration: Setup > Ini settings; console: exp:ini)
Rename a menu itemRename the page (node) in the content tree; the item shows the node's name
Change the header's markup (logo, search, user menu)The templates, see How the header is built
Put blocks above or below the header on every pageThe Layouts editor, shared layout Header / Footer, zone header or post_header

The full chain from the layout block to the menu template is on How the header is built.

The three ways

WayToolWhoPage
AdministrationSetup > Ini settingsadmin, website creatorHeader menu in the administration
Command line./console exp:iniadmin, developer, hostingHeader menu by command line
Content treeRename, move or replace the page whose ID is listededitorHeader menu and the content tree

The order of the items is the order of the IDs. To move or take out an item, see Reorder or remove header menu items.

After the change

The menu template is compiled with the list of IDs in it, so a changed MainMenuID[] shows only after the template cache is cleared. In the administration choose Template & content in the Clear cache box and press Clear; in a terminal run ./console exp:cache clear --tag=template,content --allow-root-user. That also clears the page caches. If the item still does not appear, work through Header menu troubleshooting.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x