Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 37 ยท Menus and Modules

Menus and Menu Items in Joomla

Understand Joomla menus and menu items: how an item maps a URL to a component, the Home item, nesting, aliases, access and parameters, with a runnable URL resolver.

In many CMSs a menu is just a list of links. In Joomla a menu item is much more: it is the thing that creates a page. A menu item says "when the visitor requests this path, run this component with these settings". Without a menu item, Joomla often does not know how to build a nice URL or which modules and template style to use. Understanding menu items is probably the single most important step in becoming comfortable with Joomla.

The backend screens are described in words. The stand-ins resolve URLs against a menu tree so that the logic becomes concrete.

A menu is a named container (Menus > Manage) such as Main Menu, Footer Menu or Top Menu. A menu item lives inside a menu and has:

  • Title: the link text.
  • Alias: the URL part. Together with the aliases of its parents, it forms the path.
  • Menu Item Type: what the item does (single article, category blog, contact form, login, external link, and so on; see the next lesson).
  • Parent Item: for sub-menus.
  • Status, Access, Language, Template Style (use a different design for one page) and Default Page (the home page).
  • Options on several tabs: Link Type (CSS class, icon, whether to open in a new window), Page Display (browser page title, page heading), Metadata (description, robots) and Module Assignment (which modules show on this page).

A fresh installation has one menu, the Main Menu, with one item named Home. Notice the star icon next to it: that is the default item, the one served for the site root /. Exactly one item per language is the default.

A menu item decides...

The URL Alias path such as /about/team
The component Article, blog, contact, login...
The look Template style and page heading
The modules Which ones appear on the page

No menu item, no tidy page

1 / 2

Showing a menu: items versus modules

Creating menu items does not show them anywhere. A menu is displayed by a menu module (Content > Site Modules > New > Menu) placed in a template position such as menu or footer. The module chooses which menu to display and how deep. One menu can be shown by several modules, and a menu item can exist without being shown in any menu (hidden menu items are common for pages you link to by hand). Both concepts are covered in the modules lesson and the navigation lesson.

flowchart LR
    M["Menu: Main Menu"] --> I1["Home (default)"]
    M --> I2["About"]
    M --> I3["News"]
    I2 --> I4["Team"]
    I2 --> I5["History"]
    I3 --> I6["Company"]

A menu is a tree of menu items. Their aliases build the paths /about/team, /news/company, and so on.

From URL to menu item

When a request such as /about/team arrives, the router looks for a menu item whose path matches. Paths are the aliases of the item and its ancestors joined with slashes. If a request has extra segments, for instance /news/company/launch, Joomla finds the best matching item (news/company) and passes the rest (launch) to the component to resolve, which is how an article is found inside a category blog.

Aliases must be unique among siblings in the same menu and language. If you give two items the alias about at the same level, Joomla warns you.

JS Stand-in: resolve a URL against a menu tree

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The "longest match wins" rule explains a lot of real behavior: a category blog item takes over every URL below its path and gives the leftover segments to the component, and that is why deleting a menu item can break URLs of articles shown through it.

The home page

The default menu item is your home page. A common mistake is to treat it like any other item: its URL is /, not /home. Its type decides what the home page shows. Popular choices are Featured Articles, a Category Blog of latest news or a Single Article with a welcome text.

Some items are not pages, and they are available in the System Links type group: Menu Heading (a label without a link that holds a submenu), Separator, External URL, Menu Item Alias (a second entry that points to another item), and URL (any link you type). They are very useful for building navigation, and they are covered next.

Access and visibility

  • Access: a menu item with Registered access disappears from menus for guests, and its page returns an error or login prompt when requested directly.
  • Status: unpublished items vanish from menus and the page is not routed.
  • Publish dates can be set like articles.
  • Hidden: with Display in Menu = No the page still exists but has no menu link.
  • Language: each item has a language, or All.
JS Stand-in: build visible menu links for a user

Press Run (or Ctrl + Enter) to see the console output here.

No output.

A menu module applies the same rules each time a page is rendered, so the menu a visitor sees is personal to their access levels.

Practical tips

  • Plan the tree on paper, then create items in order, parents first.
  • Use meaningful aliases; avoid changing them later or add redirects.
  • Keep one menu per purpose: main, footer, utility, hidden pages.
  • Use the Page Display tab to set a page title and heading that differ from the link text (the heading is the H1 in most templates).
  • Do not link to index.php?option=... by hand: link to menu items so that routing stays consistent.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a menu item do in Joomla?

    Menu items are the routing entries that create pages, not just links.
  2. 2. Which item is served for the site root?

    The default item is the home page, whatever its alias is.
  3. 3. How is the path of a menu item built?

    The path is the chain of aliases, joined by slashes, for example about/team.
  4. 4. How does a menu appear on the page?

    Menu items define pages, but a menu module displays the links.

Summary

  • A menu item is a page definition: URL, component, options, template style and module assignment.
  • Menus contain trees of items; aliases build paths; the default item is the home page.
  • Longest-path matching decides which item handles a request and what is left for the component.
  • Menu modules display menus; hidden items and System Links types extend navigation.
  • Access and status rules decide who sees which links.

Next: Menu Item Types